Changeset 7085 for branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMeanAbsoluteErrorCalculator.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/OnlineMeanAbsoluteErrorCalculator.cs
r6643 r7085 65 65 #endregion 66 66 67 public static double Calculate(IEnumerable<double> first, IEnumerable<double> second, out OnlineCalculatorError errorState) {68 IEnumerator<double> firstEnumerator = first.GetEnumerator();69 IEnumerator<double> secondEnumerator = second.GetEnumerator();67 public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) { 68 IEnumerator<double> originalEnumerator = originalValues.GetEnumerator(); 69 IEnumerator<double> estimatedEnumerator = estimatedValues.GetEnumerator(); 70 70 OnlineMeanAbsoluteErrorCalculator maeCalculator = new OnlineMeanAbsoluteErrorCalculator(); 71 71 72 72 // always move forward both enumerators (do not use short-circuit evaluation!) 73 while ( firstEnumerator.MoveNext() & secondEnumerator.MoveNext()) {74 double estimated = secondEnumerator.Current;75 double original = firstEnumerator.Current;73 while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) { 74 double original = originalEnumerator.Current; 75 double estimated = estimatedEnumerator.Current; 76 76 maeCalculator.Add(original, estimated); 77 77 if (maeCalculator.ErrorState != OnlineCalculatorError.None) break; … … 80 80 // check if both enumerators are at the end to make sure both enumerations have the same length 81 81 if (maeCalculator.ErrorState == OnlineCalculatorError.None && 82 ( secondEnumerator.MoveNext() || firstEnumerator.MoveNext())) {83 throw new ArgumentException("Number of elements in first and second enumerationdoesn't match.");82 (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext())) { 83 throw new ArgumentException("Number of elements in originalValues and estimatedValues enumerations doesn't match."); 84 84 } else { 85 85 errorState = maeCalculator.ErrorState;
Note: See TracChangeset
for help on using the changeset viewer.