Changeset 18146 for branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/NMSEMultiObjectiveConstraintsEvaluator.cs
- Timestamp:
- 12/16/21 14:23:48 (2 years ago)
- Location:
- branches/3136_Structural_GP
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP
- Property svn:mergeinfo changed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Property svn:mergeinfo changed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Property svn:mergeinfo changed
-
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/NMSEMultiObjectiveConstraintsEvaluator.cs
r17958 r18146 90 90 var applyLinearScaling = ApplyLinearScalingParameter.ActualValue.Value; 91 91 92 if (Use ConstantOptimization) {93 SymbolicRegression ConstantOptimizationEvaluator.OptimizeConstants(interpreter, tree, problemData, rows,92 if (UseParameterOptimization) { 93 SymbolicRegressionParameterOptimizationEvaluator.OptimizeParameters(interpreter, tree, problemData, rows, 94 94 false, 95 ConstantOptimizationIterations,96 ConstantOptimizationUpdateVariableWeights,95 ParameterOptimizationIterations, 96 ParameterOptimizationUpdateVariableWeights, 97 97 estimationLimits.Lower, 98 98 estimationLimits.Upper); … … 105 105 var scaling = offset.GetSubtree(0); 106 106 107 // Check if tree contains offset and scaling nodes107 // Check if tree contains offset and scaling nodes 108 108 if (!(offset.Symbol is Addition) || !(scaling.Symbol is Multiplication)) 109 109 throw new ArgumentException($"{ItemName} can only be used with LinearScalingGrammar."); … … 115 115 var newTree = new SymbolicExpressionTree(rootNode); 116 116 117 // calculate alpha and beta for scaling117 // calculate alpha and beta for scaling 118 118 var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(newTree, problemData.Dataset, rows); 119 119 … … 122 122 out var errorState); 123 123 if (errorState == OnlineCalculatorError.None) { 124 // Set alpha and beta to the scaling nodes from iagrammar125 var offsetParameter = offset.GetSubtree(1) as ConstantTreeNode;124 // Set alpha and beta to the scaling nodes from linear scaling grammar 125 var offsetParameter = offset.GetSubtree(1) as NumberTreeNode; 126 126 offsetParameter.Value = alpha; 127 var scalingParameter = scaling.GetSubtree(1) as ConstantTreeNode;127 var scalingParameter = scaling.GetSubtree(1) as NumberTreeNode; 128 128 scalingParameter.Value = beta; 129 129 } … … 162 162 double upperEstimationLimit, 163 163 IRegressionProblemData problemData, IEnumerable<int> rows, IBoundsEstimator estimator, int decimalPlaces) { 164 OnlineCalculatorError errorState;165 164 var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 166 165 var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); … … 174 173 175 174 var boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 176 nmse = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState);175 nmse = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(targetValues, boundedEstimatedValues, out OnlineCalculatorError errorState); 177 176 178 177 if (errorState != OnlineCalculatorError.None) nmse = 1.0;
Note: See TracChangeset
for help on using the changeset viewer.