Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/06/09 17:12:37 (15 years ago)
Author:
gkronber
Message:

Improved handling of exceptional cases in data-based modeling evaluators. #688 (SimpleEvaluators should handle exceptional cases more gracefully)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanSquaredErrorEvaluator.cs

    r1894 r2136  
    4545
    4646    public override double Evaluate(double[,] values) {
    47       double quality = SimpleMSEEvaluator.Calculate(values);
    48 
    49       if (double.IsNaN(quality) || double.IsInfinity(quality)) {
    50         quality = double.MaxValue;
     47      try { return SimpleMSEEvaluator.Calculate(values); }
     48      catch (ArgumentException) {
     49        return double.PositiveInfinity;
    5150      }
    52 
    53       return quality;
    5451    }
    5552  }
Note: See TracChangeset for help on using the changeset viewer.