Changeset 8660 for branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators
- Timestamp:
- 09/14/12 18:58:15 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveEvaluator.cs
r8206 r8660 74 74 var targetValuesEnumerator = targetValues.GetEnumerator(); 75 75 var estimatedValuesEnumerator = estimatedValues.GetEnumerator(); 76 while (targetValuesEnumerator.MoveNext() & &estimatedValuesEnumerator.MoveNext()) {76 while (targetValuesEnumerator.MoveNext() & estimatedValuesEnumerator.MoveNext()) { 77 77 double target = targetValuesEnumerator.Current; 78 78 double estimated = estimatedValuesEnumerator.Current; … … 81 81 i++; 82 82 } 83 if (linearScalingCalculator.ErrorState == OnlineCalculatorError.None && (targetValuesEnumerator.MoveNext() || estimatedValuesEnumerator.MoveNext())) 84 throw new ArgumentException("Number of elements in target and estimated values enumeration do not match."); 85 83 86 double alpha = linearScalingCalculator.Alpha; 84 87 double beta = linearScalingCalculator.Beta; 88 if (linearScalingCalculator.ErrorState != OnlineCalculatorError.None) { 89 alpha = 0.0; 90 beta = 1.0; 91 } 85 92 86 93 //calculate the quality by using the passed online calculator -
branches/GP-MoveOperators/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveMeanAbsoluteErrorEvaluator.cs
r8206 r8660 58 58 OnlineCalculatorError errorState; 59 59 60 double m se;60 double mae; 61 61 if (applyLinearScaling) { 62 62 var maeCalculator = new OnlineMeanAbsoluteErrorCalculator(); 63 63 CalculateWithScaling(targetValues, estimatedValues, lowerEstimationLimit, upperEstimationLimit, maeCalculator, problemData.Dataset.Rows); 64 64 errorState = maeCalculator.ErrorState; 65 m se = maeCalculator.MeanAbsoluteError;65 mae = maeCalculator.MeanAbsoluteError; 66 66 } else { 67 IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, 68 upperEstimationLimit); 69 mse = OnlineMeanSquaredErrorCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState); 67 IEnumerable<double> boundedEstimatedValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit); 68 mae = OnlineMeanAbsoluteErrorCalculator.Calculate(targetValues, boundedEstimatedValues, out errorState); 70 69 } 71 70 if (errorState != OnlineCalculatorError.None) return Double.NaN; 72 else return m se;71 else return mae; 73 72 } 74 73
Note: See TracChangeset
for help on using the changeset viewer.