Changeset 7085 for branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineAccuracyCalculator.cs
- Timestamp:
- 11/28/11 13:47:28 (13 years ago)
- Location:
- branches/RegressionBenchmarks
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RegressionBenchmarks
- Property svn:ignore
-
old new 4 4 *.suo 5 5 *.vsp 6 Doxygen 6 7 Google.ProtocolBuffers-0.9.1.dll 7 8 HeuristicLab 3.3.5.1.ReSharper.user 8 9 HeuristicLab 3.3.6.0.ReSharper.user 9 10 HeuristicLab.4.5.resharper.user 11 HeuristicLab.ExtLibs.6.0.ReSharper.user 10 12 HeuristicLab.resharper.user 11 13 ProtoGen.exe … … 16 18 bin 17 19 protoc.exe 18 HeuristicLab.ExtLibs.6.0.ReSharper.user19 Doxygen
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis (added) merged: 6961,6963-6964,6974,6980,6982,7011,7017,7021,7023,7043,7049
- Property svn:mergeinfo changed
-
branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineAccuracyCalculator.cs
r5945 r7085 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.