Changeset 478
- Timestamp:
- 08/09/08 14:14:30 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/ClassificationMeanSquaredErrorEvaluator.cs
r476 r478 33 33 public class ClassificationMeanSquaredErrorEvaluator : GPEvaluatorBase { 34 34 protected double[] backupValues; 35 private const double EPSILON = 1.0E-6; 35 36 public override string Description { 36 37 get { … … 69 70 // on the lower end and upper end only add linear error if the absolute error is larger than 1 70 71 // the error>1.0 constraint is needed for balance because in the interval ]-1, 1[ the squared error is smaller than the absolute error 71 if(error < -1.0 && original == classesArr[0]&& estimated < classesArr[0] ||72 error > 1.0 && original == classesArr[classesArr.Length - 1]&& estimated > classesArr[classesArr.Length - 1]) {72 if(error < -1.0 && IsEqual(original, classesArr[0]) && estimated < classesArr[0] || 73 error > 1.0 && IsEqual(original, classesArr[classesArr.Length - 1]) && estimated > classesArr[classesArr.Length - 1]) { 73 74 errorsSquaredSum += Math.Abs(error); // only add linear error below the smallest class or above the largest class 74 75 } else { … … 84 85 return errorsSquaredSum; 85 86 } 87 88 private bool IsEqual(double x, double y) { 89 return Math.Abs(x - y) < EPSILON; 90 } 86 91 } 87 92 }
Note: See TracChangeset
for help on using the changeset viewer.