Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/13 16:54:01 (11 years ago)
Author:
sforsten
Message:

#1980:

  • renamed algorithm Learning Classifier System to XCS
  • DecisionListSolution and XCSSolution show more information
  • VariableVectorClassificationProblemData can now also import datasets where the last variable is not the target variable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionListSolution.cs

    r9475 r9494  
    4040    private const string TrainingNumberOfAliveRulesName = "Number of alive rules (training)";
    4141    private const string TrainingAliveRulesName = "Alive Rules (training)";
    42     //private const string TestNumberOfAliveRules = "Number of alive rules (test)";
     42    private const string TestNumberOfAliveRulesName = "Number of alive rules (test)";
     43    private const string TestAliveRulesName = "Alive Rules (test)";
    4344    private const string TrainingTheoryLengthName = "Theory Length (training)";
    4445    private const string TrainingExceptionsLengthName = "Exceptions Length (training)";
     46    private const string DefaultRuleName = "Default Rule Action";
     47    private const string RulesName = "Rules";
     48    private const string NumberOfRulesName = "Number of Rules";
    4549
    4650    public double TrainingAccuracy {
     
    6771      get { return ((DoubleValue)this[TrainingExceptionsLengthName].Value).Value; }
    6872      private set { ((DoubleValue)this[TrainingExceptionsLengthName].Value).Value = value; }
     73    }
     74    public int TestNumberOfAliveRules {
     75      get { return ((IntValue)this[TestNumberOfAliveRulesName].Value).Value; }
     76      private set { ((IntValue)this[TestNumberOfAliveRulesName].Value).Value = value; }
     77    }
     78    public ItemSet<Rule> TestAliveRules {
     79      get { return (ItemSet<Rule>)this[TestAliveRulesName].Value; }
     80      private set { this[TestAliveRulesName].Value = value; }
     81    }
     82    public IAction DefaultRule {
     83      get { return (IAction)this[DefaultRuleName].Value; }
     84      private set { this[DefaultRuleName].Value = value; }
     85    }
     86    public ItemList<Rule> Rules {
     87      get { return (ItemList<Rule>)this[RulesName].Value; }
     88      private set { this[RulesName].Value = value; }
     89    }
     90    public int NumberOfRules {
     91      get { return ((IntValue)this[NumberOfRulesName].Value).Value; }
     92      private set { ((IntValue)this[NumberOfRulesName].Value).Value = value; }
    6993    }
    7094
     
    122146      Add(new Result(TrainingTheoryLengthName, "", new DoubleValue()));
    123147      Add(new Result(TrainingExceptionsLengthName, "", new DoubleValue()));
     148      Add(new Result(TestNumberOfAliveRulesName, "", new IntValue()));
     149      Add(new Result(TestAliveRulesName, "", new ItemSet<Rule>()));
     150      Add(new Result(DefaultRuleName, model.DefaultAction));
     151      Add(new Result(RulesName, new ItemList<Rule>(model.Rules)));
     152      Add(new Result(NumberOfRulesName, new IntValue(model.RuleSetSize)));
    124153
    125154      problemData.Changed += new EventHandler(ProblemData_Changed);
     
    132161
    133162    private void RecalculateResults() {
     163      DefaultRule = Model.DefaultAction;
     164      Rules = new ItemList<Rule>(Model.Rules);
     165      NumberOfRules = Model.RuleSetSize;
    134166      var originalTrainingCondition = ProblemData.FetchInput(ProblemData.TrainingIndices);
    135167      var originalTestCondition = ProblemData.FetchInput(ProblemData.TestIndices);
    136       ItemSet<Rule> aliveRules;
    137       double theoryLength;
    138       var estimatedTraining = Model.Evaluate(originalTrainingCondition, out aliveRules, out theoryLength);
    139       TrainingNumberOfAliveRules = aliveRules.Count + (Model.DefaultAction != null ? 1 : 0);
    140       TrainingAliveRules = aliveRules;
    141       TrainingTheoryLength = theoryLength;
    142       var estimatedTest = Model.Evaluate(originalTestCondition);
     168      ItemSet<Rule> trainingAliveRules;
     169      double trainingTheoryLength;
     170      var estimatedTraining = Model.Evaluate(originalTrainingCondition, out trainingAliveRules, out trainingTheoryLength);
     171      TrainingNumberOfAliveRules = trainingAliveRules.Count + (Model.DefaultAction != null ? 1 : 0);
     172      TrainingAliveRules = trainingAliveRules;
     173      TrainingTheoryLength = trainingTheoryLength;
     174      ItemSet<Rule> testAliveRules;
     175      var estimatedTest = Model.Evaluate(originalTestCondition, out testAliveRules);
     176      TestNumberOfAliveRules = testAliveRules.Count + (Model.DefaultAction != null ? 1 : 0);
     177      TestAliveRules = testAliveRules;
    143178
    144179      var originalTrainingAction = ProblemData.FetchAction(ProblemData.TrainingIndices);
Note: See TracChangeset for help on using the changeset viewer.