Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/08/11 12:16:27 (12 years ago)
Author:
gkronber
Message:

#1670 changed remaining calculators to follow originalValues/estimatedValues convention.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/NormalizedGiniCalculator.cs

    r6913 r6964  
    2828  public class NormalizedGiniCalculator {
    2929
    30     public static double Calculate(IEnumerable<double> original, IEnumerable<double> estimated, out OnlineCalculatorError errorState) {
    31       if (original.Count() != estimated.Count()) {
    32         throw new ArgumentException("Number of elements in first and second enumeration doesn't match.");
     30    public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
     31      var originalValuesArr = originalValues.ToArray();
     32      var estimatedValuesArr = estimatedValues.ToArray();
     33      if (originalValuesArr.Count() != estimatedValuesArr.Count()) {
     34        throw new ArgumentException("Number of elements in originalValues and estimatedValues enumerations doesn't match.");
    3335      }
    34       double oe = Gini(original, estimated, out errorState);
     36      double oe = Gini(originalValuesArr, estimatedValuesArr, out errorState);
    3537      if (errorState != OnlineCalculatorError.None) return double.NaN;
    3638
    37       return oe / (Gini(original, original, out errorState));
     39      return oe / (Gini(originalValuesArr, estimatedValuesArr, out errorState));
    3840    }
    3941
Note: See TracChangeset for help on using the changeset viewer.