Changeset 18146 for branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/StructuredSymbolicRegressionSingleObjectiveProblem.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/SingleObjective/StructuredSymbolicRegressionSingleObjectiveProblem.cs
r18134 r18146 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using System.Text;5 using System.Threading.Tasks;6 using HeuristicLab.Core;7 using HeuristicLab.Optimization;8 4 using HEAL.Attic; 9 5 using HeuristicLab.Common; 10 using HeuristicLab.Problems.Instances; 11 using HeuristicLab.Parameters; 6 using HeuristicLab.Core; 12 7 using HeuristicLab.Data; 13 8 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 9 using HeuristicLab.Optimization; 10 using HeuristicLab.Parameters; 14 11 using HeuristicLab.PluginInfrastructure; 12 using HeuristicLab.Problems.Instances; 15 13 using HeuristicLab.Problems.Instances.DataAnalysis; 16 14 … … 196 194 197 195 // dpiringe: needed when Maximization = true 198 if (TreeEvaluatorParameter.Value is SymbolicRegression ConstantOptimizationEvaluator constantOptEvaluator) {196 if (TreeEvaluatorParameter.Value is SymbolicRegressionParameterOptimizationEvaluator constantOptEvaluator) { 199 197 constantOptEvaluator.RandomParameter.Value = random; 200 constantOptEvaluator.RelativeNumberOfEvaluatedSamplesParameter.Value = 201 (PercentValue)constantOptEvaluator. ConstantOptimizationRowsPercentage.Clone();198 constantOptEvaluator.RelativeNumberOfEvaluatedSamplesParameter.Value = 199 (PercentValue)constantOptEvaluator.ParameterOptimizationRowsPercentage.Clone(); 202 200 } 203 201 … … 213 211 private static void AdjustLinearScalingParams(IRegressionProblemData problemData, ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter) { 214 212 var offsetNode = tree.Root.GetSubtree(0).GetSubtree(0); 215 var scalingNode = offsetNode.Subtrees.Where(x => !(x is ConstantTreeNode)).First();216 217 var offset ConstantNode = (ConstantTreeNode)offsetNode.Subtrees.Where(x => x is ConstantTreeNode).First();218 var scaling ConstantNode = (ConstantTreeNode)scalingNode.Subtrees.Where(x => x is ConstantTreeNode).First();213 var scalingNode = offsetNode.Subtrees.Where(x => !(x is NumberTreeNode)).First(); 214 215 var offsetNumberNode = (NumberTreeNode)offsetNode.Subtrees.Where(x => x is NumberTreeNode).First(); 216 var scalingNumberNode = (NumberTreeNode)scalingNode.Subtrees.Where(x => x is NumberTreeNode).First(); 219 217 220 218 var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TrainingIndices); … … 223 221 OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out double a, out double b, out OnlineCalculatorError error); 224 222 if (error == OnlineCalculatorError.None) { 225 offset ConstantNode.Value = a;226 scaling ConstantNode.Value = b;223 offsetNumberNode.Value = a; 224 scalingNumberNode.Value = b; 227 225 } 228 226 }
Note: See TracChangeset
for help on using the changeset viewer.