- Timestamp:
- 03/17/11 21:40:31 (14 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineCovarianceEvaluator.cs
r5564 r5742 30 30 public double Covariance { 31 31 get { 32 if (n < 1) 33 throw new InvalidOperationException("No elements"); 34 else 35 return Cn / n; 32 return n > 0 ? Cn / n : 0.0; 36 33 } 37 34 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs
r5564 r5742 31 31 public double MeanAbsolutePercentageError { 32 32 get { 33 if (n < 1) 34 throw new InvalidOperationException("No elements"); 35 else 36 return sre / n; 33 return n > 0 ? sre / n : 0.0; 37 34 } 38 35 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlinePearsonsRSquaredEvaluator.cs
r5564 r5742 66 66 #endregion 67 67 68 private bool IsInvalidValue(double x) {68 private static bool IsInvalidValue(double x) { 69 69 return double.IsNaN(x) || double.IsInfinity(x); 70 70 } … … 79 79 double estimated = secondEnumerator.Current; 80 80 double original = firstEnumerator.Current; 81 rSquaredEvaluator.Add(original, estimated); 81 if (!IsInvalidValue(estimated) && !IsInvalidValue(original)) 82 rSquaredEvaluator.Add(original, estimated); 82 83 } 83 84
Note: See TracChangeset
for help on using the changeset viewer.