Changeset 13938 for trunk/sources/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 06/27/16 15:28:26 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDependencyCalculator.cs
r12012 r13938 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 … … 29 30 30 31 double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState); 32 double Calculate(IEnumerable<Tuple<double, double>> values, out OnlineCalculatorError errorState); 31 33 } 32 34 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/HoeffdingsDependenceCalculator.cs
r12012 r13938 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 -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/PearsonsRDependenceCalculator.cs
r12492 r13938 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 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/PearsonsRSquaredDependenceCalculator.cs
r12641 r13938 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 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/DependencyCalculator/SpearmansRankCorrelationCoefficientCalculator.cs
r12817 r13938 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 }
Note: See TracChangeset
for help on using the changeset viewer.