Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/09/10 17:01:36 (14 years ago)
Author:
gkronber
Message:

Worked on symbolic regression classes to prepare for time series prognosis plugin. #1081

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs

    r3996 r4022  
    4747    }
    4848
    49     #region IPairedEnumerableEvaluator Members
     49    #region IOnlineEvaluator Members
     50    public double Value {
     51      get { return MeanAbsolutePercentageError; }
     52    }
    5053    public void Reset() {
    5154      n = 0;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlineMeanSquaredErrorEvaluator.cs

    r3996 r4022  
    4848
    4949    #region IOnlineEvaluator Members
     50    public double Value {
     51      get { return MeanSquaredError; }
     52    }
    5053    public void Reset() {
    5154      n = 0;
     
    5659      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
    5760          double.IsNaN(original) || double.IsInfinity(original)) {
    58             throw new ArgumentException("Mean squared error is not defined for NaN or infinity elements");
     61        throw new ArgumentException("Mean squared error is not defined for NaN or infinity elements");
    5962      } else {
    6063        double error = estimated - original;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/OnlinePearsonsRSquaredEvaluator.cs

    r3996 r4022  
    6161
    6262    #region IOnlineEvaluator Members
     63    public double Value {
     64      get { return RSquared; }
     65    }
    6366    public void Reset() {
    6467      sum_sq_x = 0.0;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Evaluators/SimpleNMSEEvaluator.cs

    r3462 r4022  
    5050
    5151    public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated) {
    52       double mse = SimpleMSEEvaluator.Calculate(original, estimated);
    53       return mse / original.Variance();
     52      OnlineNormalizedMeanSquaredErrorEvaluator nmseEvaluator = new OnlineNormalizedMeanSquaredErrorEvaluator();
     53      var originalEnumerator = original.GetEnumerator();
     54      var estimatedEnumerator = estimated.GetEnumerator();
     55      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
     56        nmseEvaluator.Add(originalEnumerator.Current, estimatedEnumerator.Current);
     57      }
     58      if (originalEnumerator.MoveNext() || estimatedEnumerator.MoveNext()) {
     59        throw new ArgumentException("Number of elements in original and estimated enumerations doesn't match.");
     60      }
     61      return nmseEvaluator.NormalizedMeanSquaredError;
    5462    }
    5563  }
Note: See TracChangeset for help on using the changeset viewer.