Changeset 15481 for trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective
- Timestamp:
- 11/21/17 15:40:19 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
r15480 r15481 213 213 if (applyLinearScaling) { 214 214 c = new double[initialConstants.Length + 2]; 215 { 216 Array.Copy(initialConstants, 0, c, 0, initialConstants.Length); 217 c[c.Length - 2] = 0.0; 218 c[c.Length - 1] = 1.0; 219 } 215 c[0] = 0.0; 216 c[1] = 1.0; 217 Array.Copy(initialConstants, 0, c, 2, initialConstants.Length); 220 218 } else { 221 219 c = (double[])initialConstants.Clone(); … … 273 271 //retVal == -7 => constant optimization failed due to wrong gradient 274 272 if (retVal != -7) { 275 if (applyLinearScaling) UpdateConstants(tree, c, updateVariableWeights); 276 else UpdateConstants(tree, c, updateVariableWeights); 273 if (applyLinearScaling) { 274 var tmp = new double[c.Length - 2]; 275 Array.Copy(c, 2, tmp, 0, tmp.Length); 276 UpdateConstants(tree, tmp, updateVariableWeights); 277 } else UpdateConstants(tree, c, updateVariableWeights); 277 278 } 278 279 var quality = SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.Calculate(interpreter, tree, lowerEstimationLimit, upperEstimationLimit, problemData, rows, applyLinearScaling);
Note: See TracChangeset
for help on using the changeset viewer.