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