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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.