Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 8 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/ClassificationPerformanceMeasuresCalculator.cs
r12012 r14029 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Common; 25 using HeuristicLab.Problems.DataAnalysis.OnlineCalculators; 25 26 26 27 namespace HeuristicLab.Problems.DataAnalysis { -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/HoeffdingsDependenceCalculator.cs
r12012 r14029 41 41 if (errorState != OnlineCalculatorError.None) return double.NaN; 42 42 return d; 43 } 44 45 public double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState) { 46 return HoeffD(values.Select(v => v.Item1), values.Select(v => v.Item2), out errorState); 43 47 } 44 48 -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/PearsonsRDependenceCalculator.cs
r12492 r14029 35 35 return OnlinePearsonsRCalculator.Calculate(originalValues, estimatedValues, out errorState); 36 36 } 37 38 public double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState) { 39 var calculator = new OnlinePearsonsRCalculator(); 40 foreach (var tuple in values) { 41 calculator.Add(tuple.Item1, tuple.Item2); 42 if (calculator.ErrorState != OnlineCalculatorError.None) break; 43 } 44 errorState = calculator.ErrorState; 45 return calculator.R; 46 } 37 47 } 38 48 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/PearsonsRSquaredDependenceCalculator.cs
r12641 r14029 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 … … 35 36 return r * r; 36 37 } 38 39 public double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState) { 40 var calculator = new OnlinePearsonsRCalculator(); 41 foreach (var tuple in values) { 42 calculator.Add(tuple.Item1, tuple.Item2); 43 if (calculator.ErrorState != OnlineCalculatorError.None) break; 44 } 45 errorState = calculator.ErrorState; 46 var r = calculator.R; 47 return r * r; 48 } 37 49 } 38 50 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/SpearmansRankCorrelationCoefficientCalculator.cs
r12012 r14029 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; … … 33 34 34 35 public double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) { 35 return SpearmansRankCorrelationCoefficientCalculator.CalculateSpearmansRank(originalValues, estimatedValues, out errorState); 36 return CalculateSpearmansRank(originalValues, estimatedValues, out errorState); 37 } 38 public double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState) { 39 return CalculateSpearmansRank(values.Select(v => v.Item1), values.Select(v => v.Item2), out errorState); 36 40 } 37 41 … … 50 54 return rs; 51 55 } 56 57 52 58 } 53 59 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlinePearsonsRCalculator.cs
r12492 r14029 37 37 return 0.0; 38 38 } else { 39 return covCalculator.Covariance / (Math.Sqrt(xVar) * Math.Sqrt(yVar)); 39 var r = covCalculator.Covariance / (Math.Sqrt(xVar) * Math.Sqrt(yVar)); 40 if (r < -1.0) r = -1.0; 41 else if (r > 1.0) r = 1.0; 42 return r; 40 43 } 41 44 }
Note: See TracChangeset
for help on using the changeset viewer.