Changeset 13211 for branches/DataAnalysis.ComplexityAnalyzer
- Timestamp:
- 11/17/15 13:55:11 (9 years ago)
- Location:
- branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/PearsonRSquaredNestedTreeSizeEvaluator.cs
r12849 r13211 55 55 56 56 if (UseConstantOptimization) { 57 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, 5, estimationLimits.Upper, estimationLimits.Lower);57 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, ConstantOptimizationIterations, estimationLimits.Upper, estimationLimits.Lower); 58 58 } 59 59 -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/PearsonRSquaredNumberOfVariablesEvaluator.cs
r12849 r13211 55 55 56 56 if (UseConstantOptimization) { 57 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, 5, estimationLimits.Upper, estimationLimits.Lower);57 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, ConstantOptimizationIterations, estimationLimits.Upper, estimationLimits.Lower); 58 58 } 59 59 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value, DecimalPlaces); -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/PearsonRSquaredTreeComplexityEvaluator.cs
r12848 r13211 54 54 55 55 if (UseConstantOptimization) { 56 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, 5, estimationLimits.Upper, estimationLimits.Lower);56 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, ConstantOptimizationIterations, estimationLimits.Upper, estimationLimits.Lower); 57 57 } 58 58 double[] qualities = Calculate(interpreter, solution, estimationLimits.Lower, estimationLimits.Upper, problemData, rows, applyLinearScaling, DecimalPlaces); -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveEvaluator.cs
r12848 r13211 32 32 private const string DecimalPlacesParameterName = "Decimal Places"; 33 33 private const string UseConstantOptimizationParameterName = "Use constant optimization"; 34 private const string ConstantOptimizationIterationsParameterName = "Constant optimization iterations"; 34 35 35 36 public IFixedValueParameter<IntValue> DecimalPlacesParameter { … … 40 41 } 41 42 43 public IFixedValueParameter<IntValue> ConstantOptimizationIterationsParameter { 44 get { return (IFixedValueParameter<IntValue>)Parameters[ConstantOptimizationIterationsParameterName]; } 45 } 46 47 42 48 public int DecimalPlaces { 43 49 get { return DecimalPlacesParameter.Value.Value; } … … 47 53 get { return UseConstantOptimizationParameter.Value.Value; } 48 54 set { UseConstantOptimizationParameter.Value.Value = value; } 55 } 56 public int ConstantOptimizationIterations { 57 get { return ConstantOptimizationIterationsParameter.Value.Value; } 58 set { ConstantOptimizationIterationsParameter.Value.Value = value; } 49 59 } 50 60 … … 59 69 Parameters.Add(new FixedValueParameter<IntValue>(DecimalPlacesParameterName, "The number of decimal places used for rounding the quality values.", new IntValue(5)) { Hidden = true }); 60 70 Parameters.Add(new FixedValueParameter<BoolValue>(UseConstantOptimizationParameterName, "", new BoolValue(false))); 71 Parameters.Add(new FixedValueParameter<IntValue>(ConstantOptimizationIterationsParameterName, "The number of iterations constant optimization should be applied.", new IntValue(5))); 61 72 } 62 73 … … 69 80 Parameters.Add(new FixedValueParameter<IntValue>(DecimalPlacesParameterName, "The number of decimal places used for rounding the quality values.", new IntValue(-1)) { Hidden = true }); 70 81 } 82 if (!Parameters.ContainsKey(ConstantOptimizationIterationsParameterName)) { 83 Parameters.Add(new FixedValueParameter<IntValue>(ConstantOptimizationIterationsParameterName, "The number of iterations constant optimization should be applied.", new IntValue(5))); 84 } 71 85 } 72 86 } -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r12848 r13211 54 54 55 55 if (UseConstantOptimization) { 56 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, 5, estimationLimits.Upper, estimationLimits.Lower);56 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, ConstantOptimizationIterations, estimationLimits.Upper, estimationLimits.Lower); 57 57 } 58 58 -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r12848 r13211 54 54 55 55 if (UseConstantOptimization) { 56 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, 5, estimationLimits.Upper, estimationLimits.Lower);56 SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, solution, problemData, rows, applyLinearScaling, ConstantOptimizationIterations, estimationLimits.Upper, estimationLimits.Lower); 57 57 } 58 58 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value, DecimalPlaces); -
branches/DataAnalysis.ComplexityAnalyzer/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveTrainingBestSolutionAnalyzer.cs
r12130 r13211 43 43 private const string EstimationLimitsParameterName = "EstimationLimits"; 44 44 private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength"; 45 private const string ValidationPartitionParameterName = "ValidationPartition"; 45 46 46 47 #region parameter properties … … 57 58 get { return (ILookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; } 58 59 } 60 61 public IValueLookupParameter<IntRange> ValidationPartitionParameter { 62 get { return (IValueLookupParameter<IntRange>)Parameters[ValidationPartitionParameterName]; } 63 } 59 64 #endregion 60 65 … … 64 69 public SymbolicRegressionMultiObjectiveTrainingBestSolutionAnalyzer() 65 70 : base() { 66 Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression solution.")); 67 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree.")); 68 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model.")); 69 Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "Maximal length of the symbolic expression.")); 71 Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression solution.") { Hidden = true }); 72 Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree.") { Hidden = true }); 73 Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model.") { Hidden = true }); 74 Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "Maximal length of the symbolic expression.") { Hidden = true }); 75 Parameters.Add(new ValueLookupParameter<IntRange>(ValidationPartitionParameterName, "The validation partition.")); 70 76 } 71 77 … … 73 79 private void AfterDeserialization() { 74 80 if (!Parameters.ContainsKey(MaximumSymbolicExpressionTreeLengthParameterName)) 75 Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "Maximal length of the symbolic expression.")); 81 Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "Maximal length of the symbolic expression.") { Hidden = true }); 82 if (!Parameters.ContainsKey(ValidationPartitionParameterName)) 83 Parameters.Add(new ValueLookupParameter<IntRange>(ValidationPartitionParameterName, "The validation partition.")); 76 84 } 77 85 … … 123 131 } 124 132 133 134 125 135 qualityToTreeSize.Rows.Clear(); 126 136 var trainingRow = new ScatterPlotDataRow("Training NMSE", "", sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TrainingNormalizedMeanSquaredError))); 127 137 trainingRow.VisualProperties.PointSize = 5; 128 var testRow = new ScatterPlotDataRow("Test NMSE", "", sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TestNormalizedMeanSquaredError)));129 testRow.VisualProperties.PointSize = 5;130 138 qualityToTreeSize.Rows.Add(trainingRow); 131 qualityToTreeSize.Rows.Add(testRow); 139 140 var validationPartition = ValidationPartitionParameter.ActualValue; 141 if (validationPartition.Size != 0) { 142 var problemData = ProblemDataParameter.ActualValue; 143 var validationIndizes = Enumerable.Range(validationPartition.Start, validationPartition.Size).ToList(); 144 var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, validationIndizes).ToList(); 145 OnlineCalculatorError error; 146 var validationRow = new ScatterPlotDataRow("Validation NMSE", "", 147 sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, 148 OnlineNormalizedMeanSquaredErrorCalculator.Calculate(targetValues, x.GetEstimatedValues(validationIndizes), out error)))); 149 validationRow.VisualProperties.PointSize = 5; 150 qualityToTreeSize.Rows.Add(validationRow); 151 } 132 152 133 153 double trainingArea = sizeParetoFront.Select(s => s.Model.SymbolicExpressionTree.Length * s.TrainingNormalizedMeanSquaredError).Average();
Note: See TracChangeset
for help on using the changeset viewer.