Changeset 17195
- Timestamp:
- 08/09/19 09:02:36 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Extensions/ConstrainedConstantOptimizationEvaluator.cs
r17176 r17195 240 240 var targetMean = target.Average(); 241 241 var pred = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TrainingIndices).ToArray(); 242 if (pred.Any(pi => double.IsInfinity(pi) || double.IsNaN(pi))) return targetVariance; 243 242 244 var predStDev = pred.StandardDeviationPop(); 245 if (predStDev == 0) return targetVariance; // constant expression 243 246 var predMean = pred.Average(); 244 247 … … 441 444 442 445 // evaluate tree with updated constants 443 var residualVariance = SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.Calculate(interpreter, scaledTree, lowerEstimationLimit, upperEstimationLimit, problemData, rows, applyLinearScaling: false);446 var residualVariance = SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.Calculate(interpreter, tree, lowerEstimationLimit, upperEstimationLimit, problemData, rows, applyLinearScaling: true); 444 447 return Math.Min(residualVariance, targetVariance); 445 448 }
Note: See TracChangeset
for help on using the changeset viewer.