- Timestamp:
- 09/12/08 17:29:01 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Evaluation/MeanAbsolutePercentageErrorEvaluator.cs
r482 r555 57 57 public override void Evaluate(int start, int end) { 58 58 double errorsSum = 0.0; 59 int n = 0; 59 60 for(int sample = start; sample < end; sample++) { 60 61 double estimated = GetEstimatedValue(sample); 61 62 double original = GetOriginalValue(sample); 62 63 SetOriginalValue(sample, estimated); 63 if(!double.IsNaN(original) && !double.IsInfinity(original) ) {64 if(!double.IsNaN(original) && !double.IsInfinity(original) && original!=0.0) { 64 65 double percent_error = Math.Abs((estimated - original) / original); 65 66 errorsSum += percent_error; 67 n++; 66 68 } 67 69 } 68 double quality = errorsSum / (end - start);70 double quality = errorsSum / n; 69 71 if(double.IsNaN(quality) || double.IsInfinity(quality)) 70 72 quality = double.MaxValue;
Note: See TracChangeset
for help on using the changeset viewer.