Changeset 18115 for branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression
- Timestamp:
- 12/13/21 17:49:34 (3 years ago)
- Location:
- branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/IMultiObjectiveConstraintsEvaluator.cs
r17959 r18115 27 27 [StorableType("F96C5253-5A78-491C-95AE-78F64BD1F3B1")] 28 28 public interface IMultiObjectiveConstraintsEvaluator : ISymbolicRegressionMultiObjectiveEvaluator { 29 30 29 IFixedValueParameter<IntValue> NumConstraintsParameter { get; } 31 30 } -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/NMSEMultiObjectiveConstraintsEvaluator.cs
r18113 r18115 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 iagrammar124 // Set alpha and beta to the scaling nodes from linear scaling grammar 125 125 var offsetParameter = offset.GetSubtree(1) as NumberTreeNode; 126 126 offsetParameter.Value = alpha; … … 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; -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/NMSESingleObjectiveConstraintsEvaluator.cs
r18113 r18115 97 97 public NMSESingleObjectiveConstraintsEvaluator() { 98 98 Parameters.Add(new FixedValueParameter<BoolValue>(OptimizeParametersParameterName, 99 "Define whether optimization of numericparameters is active or not (default: false).", new BoolValue(false)));99 "Define whether optimization of parameters is active or not (default: false).", new BoolValue(false))); 100 100 Parameters.Add(new FixedValueParameter<IntValue>(ParameterOptimizationIterationsParameterName, 101 101 "Define how many parameter optimization steps should be performed (default: 10).", new IntValue(10))); … … 109 109 110 110 [StorableHook(HookType.AfterDeserialization)] 111 private void AfterDeserialization() { 112 if (!Parameters.ContainsKey(ParameterOptimizationIterationsParameterName)) { 113 if (Parameters.ContainsKey("ParameterOptimizationIterations")) { 114 Parameters.Add(new FixedValueParameter<IntValue>(ParameterOptimizationIterationsParameterName, "Define how many parameter optimization steps should be performed (default: 10).", (IntValue)Parameters["ParameterOptimizationIterations"].ActualValue)); 115 Parameters.Remove("ParameterOptimizationIterations"); 116 } else { 117 Parameters.Add(new FixedValueParameter<IntValue>(ParameterOptimizationIterationsParameterName, "Define how many parameter optimization steps should be performed (default: 10).", new IntValue(10))); 118 } 119 } 120 121 } 111 private void AfterDeserialization() { } 122 112 123 113 public override IDeepCloneable Clone(Cloner cloner) { -
branches/3140_NumberSymbol/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionPruningOperator.cs
r18114 r18115 91 91 for (int i = 0; i < nodes.Count; ++i) { 92 92 var node = nodes[i]; 93 if (node is NumberTreeNode) continue;93 if (node is INumericTreeNode) continue; // skip constants and numbers 94 94 95 95 impactValuesCalculator.CalculateImpactAndReplacementValues(model, node, problemData, rows,
Note: See TracChangeset
for help on using the changeset viewer.