Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/24/12 18:48:16 (12 years ago)
Author:
sforsten
Message:

#1292:

  • NaN values are used, if the calculation is invalid (e.g. missing values, infinity etc.)
  • Variables can now be filtered. Initially allowed input variables and target variable are shown, but with a right click a dialog can be opened to select variables, which shall be shown
File:
1 edited

Legend:

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

    r8542 r8689  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    2728
    2829    public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
    29       double rs = alglib.basestat.spearmancorr2(originalValues.ToArray(), estimatedValues.ToArray(), originalValues.Count());
    30       errorState = OnlineCalculatorError.None;
     30      double rs = double.NaN;
     31      try {
     32        rs = alglib.basestat.spearmancorr2(originalValues.ToArray(), estimatedValues.ToArray(), originalValues.Count());
     33        errorState = OnlineCalculatorError.None;
     34      }
     35      catch (Exception ex) {
     36        errorState = OnlineCalculatorError.InvalidValueAdded;
     37      }
     38
    3139      return rs;
    3240    }
Note: See TracChangeset for help on using the changeset viewer.