Changeset 4202
- Timestamp:
- 08/11/10 18:39:49 (14 years ago)
- Location:
- branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs
r4195 r4202 32 32 using HeuristicLab.Problems.DataAnalysis.Evaluators; 33 33 using HeuristicLab.Problems.DataAnalysis.Symbolic; 34 using System; 34 35 35 36 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers { … … 285 286 int trainingEnd = ProblemData.TrainingSamplesEnd.Value; 286 287 IEnumerable<int> trainingRows = Enumerable.Range(trainingStart, trainingEnd - trainingStart); 287 SymbolicRegressionScaledMeanSquaredErrorEvaluator.Calculate(SymbolicExpressionTreeInterpreter, bestTree, 288 lowerEstimationLimit, upperEstimationLimit, 289 ProblemData.Dataset, targetVariable, 290 trainingRows, out beta, out alpha); 288 IEnumerable<double> originalValues = ProblemData.Dataset.GetEnumeratedVariableValues(targetVariable, trainingRows); 289 IEnumerable<double> estimatedValues = 290 GetBoundedValues(SymbolicExpressionTreeInterpreter.GetSymbolicExpressionTreeValues(bestTree, ProblemData.Dataset, trainingRows), 291 lowerEstimationLimit, upperEstimationLimit); 292 293 294 SymbolicRegressionScaledMeanSquaredErrorEvaluator.CalculateScalingParameters(originalValues, estimatedValues, out beta, out alpha); 291 295 292 296 // scale tree for solution … … 317 321 AddValue(validationValues, bestQuality, CurrentBestValidationQualityParameterName, CurrentBestValidationQualityParameterName); 318 322 return base.Apply(); 323 } 324 325 private IEnumerable<double> GetBoundedValues(IEnumerable<double> values, double lowerEstimationLimit, double upperEstimationLimit) { 326 foreach (double v in values) { 327 if (double.IsNaN(v)) yield return upperEstimationLimit; 328 else yield return Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, v)); 329 } 319 330 } 320 331 -
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionPearsonsRSquaredEvaluator.cs
r4195 r4202 54 54 double original = originalEnumerator.Current; 55 55 if (double.IsNaN(estimated)) 56 estimated = upperEstimationLimit;56 return 0.0; 57 57 else 58 58 estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
Note: See TracChangeset
for help on using the changeset viewer.