Changeset 18104
- Timestamp:
- 12/03/21 13:46:20 (3 years ago)
- Location:
- branches/3136_Structural_GP
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3136_Structural_GP/HeuristicLab.Parameters/3.3/ValueLookupParameter.cs
r17180 r18104 151 151 } 152 152 153 protected override IItem GetActualValue() { 154 if (ExecutionContext == null) 155 return Value; 156 return base.GetActualValue(); 157 } 158 153 159 public override string ToString() { 154 160 if (Value != null) -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/NMSESingleObjectiveConstraintsEvaluator.cs
r18103 r18104 141 141 .GetSubtree(0); //Offset 142 142 var scaling = offset.GetSubtree(0); 143 143 144 144 //Check if tree contains offset and scaling nodes 145 145 if (!(offset.Symbol is Addition) || !(scaling.Symbol is Multiplication)) … … 155 155 156 156 var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 157 OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out var alpha, out var beta, 158 out var errorState); 157 OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out var alpha, out var beta, out var errorState); 159 158 if (errorState == OnlineCalculatorError.None) { 160 159 //Set alpha and beta to the scaling nodes from ia grammar … … 249 248 interpreter, tree, 250 249 problemData, rows, 251 applyLinearScaling: false, // OptimizeConstants deletes the scaling terms -> wrong estimations250 applyLinearScaling: false, // Tree already contains scaling terms 252 251 ConstantOptimizationIterations, 253 252 updateVariableWeights: true, … … 255 254 upperEstimationLimit); 256 255 257 if (applyLinearScaling) // extra scaling terms, which are included in tree258 CalcLinearScalingTerms(tree, problemData, rows, interpreter); 259 256 else if (applyLinearScaling) // extra scaling terms, which are included in tree 257 CalcLinearScalingTerms(tree, problemData, rows, interpreter); 258 260 259 return Calculate( 261 260 tree, problemData, -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
r18103 r18104 202 202 var propability = random.NextDouble(); 203 203 if (propability < ConstantOptimizationProbability.Value) { 204 IEnumerable<int> constantOptimizationRows = GenerateRowsToEvaluate(ConstantOptimizationRowsPercentage.Value);205 204 quality = OptimizeConstants( 206 205 interpreter, tree, 207 problemData, constantOptimizationRows,206 problemData, rows, 208 207 applyLinearScaling, 209 208 ConstantOptimizationIterations.Value, -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs
r18103 r18104 59 59 } 60 60 61 //TODO: refactor like evaluate method62 61 public static double Calculate( 63 62 ISymbolicExpressionTree tree, -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/StructuredSymbolicRegressionSingleObjectiveProblem.cs
r18103 r18104 194 194 individual[SymbolicExpressionTreeName] = tree; 195 195 196 if(TreeEvaluatorParameter.Value is SymbolicRegressionConstantOptimizationEvaluator) 197 TreeEvaluatorParameter.Value.RandomParameter.Value = random; 196 // dpiringe: needed when Maximization = true 197 if (TreeEvaluatorParameter.Value is SymbolicRegressionConstantOptimizationEvaluator constantOptEvaluator) { 198 constantOptEvaluator.RandomParameter.Value = random; 199 constantOptEvaluator.RelativeNumberOfEvaluatedSamplesParameter.Value = 200 (PercentValue)constantOptEvaluator.ConstantOptimizationRowsPercentage.Clone(); 201 } 198 202 199 203 return TreeEvaluatorParameter.Value.Evaluate( -
branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
r17817 r18104 302 302 return t * alpha + beta; 303 303 } else return ConvertToAutoDiff(node.GetSubtree(0)); 304 } 305 if (node.Symbol is SubFunctionSymbol) { 306 return ConvertToAutoDiff(node.GetSubtree(0)); 304 307 } 305 308 throw new ConversionException(); … … 350 353 !(n.Symbol is Cube) && 351 354 !(n.Symbol is CubeRoot) && 352 !(n.Symbol is Power) 355 !(n.Symbol is Power) && 356 !(n.Symbol is SubFunctionSymbol) 353 357 select n).Any(); 354 358 return !containsUnknownSymbol;
Note: See TracChangeset
for help on using the changeset viewer.