Changeset 13221 for branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 11/17/15 15:57:52 (9 years ago)
- Location:
- branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/PearsonRSquaredTreeComplexityEvaluator.cs
r13211 r13221 65 65 if (decimalPlaces >= 0) 66 66 r2 = Math.Round(r2, decimalPlaces); 67 return new double[2] { r2, SymbolicDataAnalysisModelComplexity Analyzer.CalculateComplexity(solution.Root.GetSubtree(0).GetSubtree(0)) };67 return new double[2] { r2, SymbolicDataAnalysisModelComplexityCalculator.CalculateComplexity(solution) }; 68 68 } 69 69 -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveTrainingBestSolutionAnalyzer.cs
r13211 r13221 96 96 public override IOperation Apply() { 97 97 var operation = base.Apply(); 98 99 98 var paretoFront = TrainingBestSolutionsParameter.ActualValue; 100 99 … … 131 130 } 132 131 133 134 135 132 qualityToTreeSize.Rows.Clear(); 136 133 var trainingRow = new ScatterPlotDataRow("Training NMSE", "", sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TrainingNormalizedMeanSquaredError))); 137 trainingRow.VisualProperties.PointSize = 5;134 trainingRow.VisualProperties.PointSize = 8; 138 135 qualityToTreeSize.Rows.Add(trainingRow); 139 136 … … 147 144 sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, 148 145 OnlineNormalizedMeanSquaredErrorCalculator.Calculate(targetValues, x.GetEstimatedValues(validationIndizes), out error)))); 149 validationRow.VisualProperties.PointSize = 5;146 validationRow.VisualProperties.PointSize = 7; 150 147 qualityToTreeSize.Rows.Add(validationRow); 151 148 } 152 153 double trainingArea = sizeParetoFront.Select(s => s.Model.SymbolicExpressionTree.Length * s.TrainingNormalizedMeanSquaredError).Average();154 double testArea = sizeParetoFront.Select(s => s.Model.SymbolicExpressionTree.Length * s.TestNormalizedMeanSquaredError).Average();155 156 ResultCollection paretoFrontResults;157 if (!ResultCollection.TryGetValue("Pareto Front Results", out result)) {158 paretoFrontResults = new ResultCollection();159 ResultCollection.Add(new Result("Pareto Front Results", paretoFrontResults));160 } else paretoFrontResults = (ResultCollection)result.Value;161 162 DoubleValue trainingAreaResult, testAreaResult, areaDifferenceResult, avgTrainingNMSE, avgTestNMSE;163 if (!paretoFrontResults.TryGetValue("Non Dominated Area (training)", out result)) {164 trainingAreaResult = new DoubleValue();165 paretoFrontResults.Add(new Result("Non Dominated Area (training)", trainingAreaResult));166 } else trainingAreaResult = (DoubleValue)result.Value;167 if (!paretoFrontResults.TryGetValue("Non Dominated Area (test)", out result)) {168 testAreaResult = new DoubleValue();169 paretoFrontResults.Add(new Result("Non Dominated Area (test)", testAreaResult));170 } else testAreaResult = (DoubleValue)result.Value;171 if (!paretoFrontResults.TryGetValue("Non Dominated Area Difference", out result)) {172 areaDifferenceResult = new DoubleValue();173 paretoFrontResults.Add(new Result("Non Dominated Area Difference", areaDifferenceResult));174 } else areaDifferenceResult = (DoubleValue)result.Value;175 if (!paretoFrontResults.TryGetValue("Average Training NMSE", out result)) {176 avgTrainingNMSE = new DoubleValue();177 paretoFrontResults.Add(new Result("Average Training NMSE", avgTrainingNMSE));178 } else avgTrainingNMSE = (DoubleValue)result.Value;179 if (!paretoFrontResults.TryGetValue("Average Test NMSE", out result)) {180 avgTestNMSE = new DoubleValue();181 paretoFrontResults.Add(new Result("Average Test NMSE", avgTestNMSE));182 } else avgTestNMSE = (DoubleValue)result.Value;183 184 trainingAreaResult.Value = trainingArea;185 testAreaResult.Value = testArea;186 areaDifferenceResult.Value = trainingArea - testArea;187 avgTrainingNMSE.Value = sizeParetoFront.Select(s => s.TrainingNormalizedMeanSquaredError).Average();188 avgTestNMSE.Value = sizeParetoFront.Select(s => s.TestNormalizedMeanSquaredError).Average();189 149 190 150 return operation; -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs
r12130 r13221 64 64 } 65 65 66 public double ModelComplexity {67 get { return ((DoubleValue)this["Complexity"].Value).Value; }68 private set { ((DoubleValue)this["Complexity"].Value).Value = value; }69 }70 71 66 private ResultCollection EstimationLimitsResultCollection { 72 67 get { return (ResultCollection)this[EstimationLimitsResultsResultName].Value; } … … 123 118 estimationLimitResults.Add(new Result(TestNaNEvaluationsResultName, "", new IntValue())); 124 119 Add(new Result(EstimationLimitsResultsResultName, "Results concerning the estimation limits of symbolic regression solution", estimationLimitResults)); 125 Add(new Result("Complexity", "", new DoubleValue()));126 120 RecalculateResults(); 127 121 } … … 133 127 [StorableHook(HookType.AfterDeserialization)] 134 128 private void AfterDeserialization() { 135 if (!ContainsKey("Complexity")) Add(new Result("Complexity", "", new DoubleValue()));136 129 if (!ContainsKey(EstimationLimitsResultsResultName)) { 137 130 ResultCollection estimationLimitResults = new ResultCollection(); … … 156 149 ModelLength = Model.SymbolicExpressionTree.Length; 157 150 ModelDepth = Model.SymbolicExpressionTree.Depth; 158 ModelComplexity = SymbolicDataAnalysisModelComplexityAnalyzer.CalculateComplexity(Model.SymbolicExpressionTree.Root.GetSubtree(0).GetSubtree(0));159 151 160 152 EstimationLimits.Lower = Model.LowerEstimationLimit;
Note: See TracChangeset
for help on using the changeset viewer.