Changeset 10750
- Timestamp:
- 04/15/14 13:18:14 (11 years ago)
- Location:
- branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
r10596 r10750 117 117 </ItemGroup> 118 118 <ItemGroup> 119 <Compile Include="MultiObjective\SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator.cs" /> 119 120 <Compile Include="MultiObjective\SymbolicRegressionMultiObjectiveValidationBestSolutionAnalyzer.cs" /> 120 121 <Compile Include="Plugin.cs" /> -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator.cs
r10744 r10750 28 28 29 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression { 30 [Item("Pearson R² & Tree size Evaluator", "Calculates the Pearson R² and the tree sizeof a symbolic regression solution.")]30 [Item("Pearson R² & Tree Complexity Evaluator", "Calculates the Pearson R² and the tree complexity of a symbolic regression solution.")] 31 31 [StorableClass] 32 public class SymbolicRegressionMultiObjectivePearsonRSquaredTree SizeEvaluator : SymbolicRegressionMultiObjectiveEvaluator {32 public class SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator : SymbolicRegressionMultiObjectiveEvaluator { 33 33 [StorableConstructor] 34 protected SymbolicRegressionMultiObjectivePearsonRSquaredTree SizeEvaluator(bool deserializing) : base(deserializing) { }35 protected SymbolicRegressionMultiObjectivePearsonRSquaredTree SizeEvaluator(SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator original, Cloner cloner)34 protected SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator(bool deserializing) : base(deserializing) { } 35 protected SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator(SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator original, Cloner cloner) 36 36 : base(original, cloner) { 37 37 } 38 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new SymbolicRegressionMultiObjectivePearsonRSquaredTree SizeEvaluator(this, cloner);39 return new SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator(this, cloner); 40 40 } 41 41 42 public SymbolicRegressionMultiObjectivePearsonRSquaredTree SizeEvaluator() : base() { }42 public SymbolicRegressionMultiObjectivePearsonRSquaredTreeComplexityEvaluator() : base() { } 43 43 44 44 public override IEnumerable<bool> Maximization { get { return new bool[2] { true, false }; } } … … 69 69 70 70 if (errorState != OnlineCalculatorError.None) r2 = double.NaN; 71 return new double[2] { r2, solution.Length};71 return new double[2] { r2, SymbolicDataAnalysisModelComplexityAnalyzer.CalculateComplexity(solution.Root.GetSubtree(0).GetSubtree(0)) }; 72 72 } 73 73 -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs
r9456 r10750 63 63 } 64 64 65 public double ModelComplexity { 66 get { return ((DoubleValue)this["Complexity"].Value).Value; } 67 private set { ((DoubleValue)this["Complexity"].Value).Value = value; } 68 } 69 65 70 private ResultCollection EstimationLimitsResultCollection { 66 71 get { return (ResultCollection)this[EstimationLimitsResultsResultName].Value; } … … 114 119 estimationLimitResults.Add(new Result(TestNaNEvaluationsResultName, "", new IntValue())); 115 120 Add(new Result(EstimationLimitsResultsResultName, "Results concerning the estimation limits of symbolic regression solution", estimationLimitResults)); 116 121 Add(new Result("Complexity", "", new DoubleValue())); 117 122 RecalculateResults(); 118 123 } … … 124 129 [StorableHook(HookType.AfterDeserialization)] 125 130 private void AfterDeserialization() { 131 if (!ContainsKey("Complexity")) Add(new Result("Complexity", "", new DoubleValue())); 126 132 if (!ContainsKey(EstimationLimitsResultsResultName)) { 127 133 ResultCollection estimationLimitResults = new ResultCollection(); … … 146 152 ModelLength = Model.SymbolicExpressionTree.Length; 147 153 ModelDepth = Model.SymbolicExpressionTree.Depth; 154 ModelComplexity = SymbolicDataAnalysisModelComplexityAnalyzer.CalculateComplexity(Model.SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0)); 148 155 149 156 EstimationLimits.Lower = Model.LowerEstimationLimit;
Note: See TracChangeset
for help on using the changeset viewer.