Changeset 9494 for branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionListSolution.cs
- Timestamp:
- 05/14/13 16:54:01 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionListSolution.cs
r9475 r9494 40 40 private const string TrainingNumberOfAliveRulesName = "Number of alive rules (training)"; 41 41 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)"; 43 44 private const string TrainingTheoryLengthName = "Theory Length (training)"; 44 45 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"; 45 49 46 50 public double TrainingAccuracy { … … 67 71 get { return ((DoubleValue)this[TrainingExceptionsLengthName].Value).Value; } 68 72 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; } 69 93 } 70 94 … … 122 146 Add(new Result(TrainingTheoryLengthName, "", new DoubleValue())); 123 147 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))); 124 153 125 154 problemData.Changed += new EventHandler(ProblemData_Changed); … … 132 161 133 162 private void RecalculateResults() { 163 DefaultRule = Model.DefaultAction; 164 Rules = new ItemList<Rule>(Model.Rules); 165 NumberOfRules = Model.RuleSetSize; 134 166 var originalTrainingCondition = ProblemData.FetchInput(ProblemData.TrainingIndices); 135 167 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; 143 178 144 179 var originalTrainingAction = ProblemData.FetchAction(ProblemData.TrainingIndices);
Note: See TracChangeset
for help on using the changeset viewer.