Changeset 7000 for branches/Benchmarking/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineAccuracyCalculator.cs
- Timestamp:
- 11/16/11 15:07:36 (12 years ago)
- Location:
- branches/Benchmarking
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Benchmarking
- Property svn:mergeinfo changed
/trunk (added) merged: 6918-6919,6921-6923,6928-6930,6933,6935,6938-6939,6942,6944,6949-6954,6959,6961-6964,6974-6983,6985-6986,6993-6995,6997-6999
- Property svn:mergeinfo changed
-
branches/Benchmarking/sources
- Property svn:mergeinfo changed
/trunk/sources (added) merged: 6918-6919,6921-6923,6928-6930,6935,6938-6939,6942,6944,6949-6954,6959,6961-6964,6974-6983,6986,6993-6995,6997-6999
- Property svn:mergeinfo changed
-
branches/Benchmarking/sources/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis (added) merged: 6961,6963-6964,6974,6980,6982
- Property svn:mergeinfo changed
-
branches/Benchmarking/sources/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineAccuracyCalculator.cs
r5945 r7000 68 68 #endregion 69 69 70 public static double Calculate(IEnumerable<double> first, IEnumerable<double> second, out OnlineCalculatorError errorState) {71 IEnumerator<double> firstEnumerator = first.GetEnumerator();72 IEnumerator<double> secondEnumerator = second.GetEnumerator();70 public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) { 71 IEnumerator<double> originalEnumerator = originalValues.GetEnumerator(); 72 IEnumerator<double> estimatedEnumerator = estimatedValues.GetEnumerator(); 73 73 OnlineAccuracyCalculator accuracyCalculator = new OnlineAccuracyCalculator(); 74 74 75 75 // always move forward both enumerators (do not use short-circuit evaluation!) 76 while ( firstEnumerator.MoveNext() & secondEnumerator.MoveNext()) {77 double estimated = secondEnumerator.Current;78 double original = firstEnumerator.Current;76 while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) { 77 double original = originalEnumerator.Current; 78 double estimated = estimatedEnumerator.Current; 79 79 accuracyCalculator.Add(original, estimated); 80 80 if (accuracyCalculator.ErrorState != OnlineCalculatorError.None) break; … … 83 83 // check if both enumerators are at the end to make sure both enumerations have the same length 84 84 if (accuracyCalculator.ErrorState == OnlineCalculatorError.None && 85 ( secondEnumerator.MoveNext() || firstEnumerator.MoveNext())) {86 throw new ArgumentException("Number of elements in first and second enumerationdoesn't match.");85 (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext())) { 86 throw new ArgumentException("Number of elements in originalValues and estimatedValues enumerations doesn't match."); 87 87 } else { 88 88 errorState = accuracyCalculator.ErrorState;
Note: See TracChangeset
for help on using the changeset viewer.