Changeset 1794 for trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanSquaredErrorEvaluator.cs
- Timestamp:
- 05/14/09 09:34:08 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanSquaredErrorEvaluator.cs
r712 r1794 45 45 public override void Evaluate(IScope scope, BakedTreeEvaluator evaluator, Dataset dataset, int targetVariable, int start, int end, bool updateTargetValues) { 46 46 double errorsSquaredSum = 0; 47 int n = 0; 47 48 for (int sample = start; sample < end; sample++) { 48 49 double original = dataset.GetValue(sample, targetVariable); … … 54 55 double error = estimated - original; 55 56 errorsSquaredSum += error * error; 57 n++; 56 58 } 57 59 } 58 60 59 errorsSquaredSum /= (end - start);61 errorsSquaredSum /= n; 60 62 if (double.IsNaN(errorsSquaredSum) || double.IsInfinity(errorsSquaredSum)) { 61 63 errorsSquaredSum = double.MaxValue;
Note: See TracChangeset
for help on using the changeset viewer.