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