Changeset 5904 for trunk/sources/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 03/31/11 10:43:58 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineCovarianceEvaluator.cs
r5894 r5904 55 55 56 56 public void Add(double original, double estimated) { 57 if (double.IsNaN(estimated) || double.IsInfinity(estimated) || double.IsNaN(original) || double.IsInfinity(original) ) {57 if (double.IsNaN(estimated) || double.IsInfinity(estimated) || double.IsNaN(original) || double.IsInfinity(original) || (errorState & OnlineEvaluatorError.InvalidValueAdded) > 0) { 58 58 errorState = errorState | OnlineEvaluatorError.InvalidValueAdded; 59 } else if (!errorState.HasFlag(OnlineEvaluatorError.InvalidValueAdded)){59 } else { 60 60 n++; 61 errorState = OnlineEvaluatorError.None; // n >= 161 errorState = errorState & (~OnlineEvaluatorError.InsufficientElementsAdded); // n >= 1 62 62 63 63 // online calculation of tMean -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineMeanAbsolutePercentageErrorEvaluator.cs
r5894 r5904 58 58 original.IsAlmost(0.0)) { 59 59 errorState = errorState | OnlineEvaluatorError.InvalidValueAdded; 60 } else if (!errorState.HasFlag(OnlineEvaluatorError.InvalidValueAdded)){60 } else { 61 61 sre += Math.Abs((estimated - original) / original); 62 62 n++; 63 errorState = OnlineEvaluatorError.None;// n >= 163 errorState = errorState & (~OnlineEvaluatorError.InsufficientElementsAdded); // n >= 1 64 64 } 65 65 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineMeanAndVarianceCalculator.cs
r5894 r5904 74 74 75 75 public void Add(double x) { 76 if (double.IsNaN(x) || double.IsInfinity(x) ) {76 if (double.IsNaN(x) || double.IsInfinity(x) || (errorState & OnlineEvaluatorError.InvalidValueAdded) > 0) { 77 77 errorState = errorState | OnlineEvaluatorError.InvalidValueAdded; 78 78 varianceErrorState = errorState | OnlineEvaluatorError.InvalidValueAdded; 79 } else if (!errorState.HasFlag(OnlineEvaluatorError.InvalidValueAdded)){79 } else { 80 80 n++; 81 81 // See Knuth TAOCP vol 2, 3rd edition, page 232 … … 83 83 m_oldM = m_newM = x; 84 84 m_oldS = 0.0; 85 errorState = OnlineEvaluatorError.None;// n >= 185 errorState = errorState & (~OnlineEvaluatorError.InsufficientElementsAdded); // n >= 1 86 86 } else { 87 varianceErrorState = OnlineEvaluatorError.None; // n >= 187 varianceErrorState = varianceErrorState & (~OnlineEvaluatorError.InsufficientElementsAdded); // n >= 2 88 88 m_newM = m_oldM + (x - m_oldM) / n; 89 89 m_newS = m_oldS + (x - m_oldM) * (x - m_newM); -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineMeanSquaredErrorEvaluator.cs
r5894 r5904 54 54 public void Add(double original, double estimated) { 55 55 if (double.IsNaN(estimated) || double.IsInfinity(estimated) || 56 double.IsNaN(original) || double.IsInfinity(original) ) {56 double.IsNaN(original) || double.IsInfinity(original) || (errorState & OnlineEvaluatorError.InvalidValueAdded) > 0) { 57 57 errorState = errorState | OnlineEvaluatorError.InvalidValueAdded; 58 } else if (!errorState.HasFlag(OnlineEvaluatorError.InvalidValueAdded)){58 } else { 59 59 double error = estimated - original; 60 60 sse += error * error; 61 61 n++; 62 errorState = OnlineEvaluatorError.None;// n >= 162 errorState = errorState & (~OnlineEvaluatorError.InsufficientElementsAdded); // n >= 1 63 63 } 64 64 }
Note: See TracChangeset
for help on using the changeset viewer.