- Timestamp:
- 09/24/12 18:48:16 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/SpearmansRankCorrelationCoefficientCalculator.cs
r8542 r8689 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; … … 27 28 28 29 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 31 39 return rs; 32 40 }
Note: See TracChangeset
for help on using the changeset viewer.