Changeset 5275 for branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionPearsonsRSquaredEvaluator.cs
- Timestamp:
- 01/11/11 15:03:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionPearsonsRSquaredEvaluator.cs
r4225 r5275 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 using HeuristicLab.Parameters;28 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 28 using HeuristicLab.Problems.DataAnalysis.Evaluators; … … 34 33 [StorableClass] 35 34 public class SymbolicRegressionPearsonsRSquaredEvaluator : SingleObjectiveSymbolicRegressionEvaluator { 36 public SymbolicRegressionPearsonsRSquaredEvaluator() 37 : base() { 35 [StorableConstructor] 36 protected SymbolicRegressionPearsonsRSquaredEvaluator(bool deserializing) : base(deserializing) { } 37 protected SymbolicRegressionPearsonsRSquaredEvaluator(SymbolicRegressionPearsonsRSquaredEvaluator original, Cloner cloner) 38 : base(original, cloner) { 38 39 } 40 public SymbolicRegressionPearsonsRSquaredEvaluator() : base() { } 39 41 42 public override IDeepCloneable Clone(Cloner cloner) { 43 return new SymbolicRegressionPearsonsRSquaredEvaluator(this, cloner); 44 } 40 45 public override double Evaluate(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, Dataset dataset, string targetVariable, IEnumerable<int> rows) { 41 double r2= Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows);42 return r2;46 double mse = Calculate(interpreter, solution, lowerEstimationLimit, upperEstimationLimit, dataset, targetVariable, rows); 47 return mse; 43 48 } 44 49 … … 54 59 double original = originalEnumerator.Current; 55 60 if (double.IsNaN(estimated)) 56 return 0.0;61 estimated = upperEstimationLimit; 57 62 else 58 63 estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
Note: See TracChangeset
for help on using the changeset viewer.