Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/11/11 15:03:46 (13 years ago)
Author:
gkronber
Message:

Merged changes from trunk to data analysis exploration branch and added fractional distance metric evaluator. #1142

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SymbolicRegressionPearsonsRSquaredEvaluator.cs

    r4225 r5275  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    25 using HeuristicLab.Data;
    2626using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    27 using HeuristicLab.Parameters;
    2827using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2928using HeuristicLab.Problems.DataAnalysis.Evaluators;
     
    3433  [StorableClass]
    3534  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) {
    3839    }
     40    public SymbolicRegressionPearsonsRSquaredEvaluator() : base() { }
    3941
     42    public override IDeepCloneable Clone(Cloner cloner) {
     43      return new SymbolicRegressionPearsonsRSquaredEvaluator(this, cloner);
     44    }
    4045    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;
    4348    }
    4449
     
    5459        double original = originalEnumerator.Current;
    5560        if (double.IsNaN(estimated))
    56           return 0.0;
     61          estimated = upperEstimationLimit;
    5762        else
    5863          estimated = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, estimated));
Note: See TracChangeset for help on using the changeset viewer.