Changeset 2828


Ignore:
Timestamp:
02/18/10 16:14:04 (11 years ago)
Author:
gkronber
Message:

Prevented division by zero in relative error calculation for Theil's U. #879

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Modeling/3.2/SimpleTheilInequalityCoefficientEvaluator.cs

    r2827 r2828  
    6060        double estimatedValue = values[sample, ESTIMATION_INDEX];
    6161        double originalValue = values[sample, ORIGINAL_INDEX];
    62         if (!double.IsNaN(originalValue) && !double.IsInfinity(originalValue)) {
     62        if (!double.IsNaN(originalValue) && !double.IsInfinity(originalValue) && prevValue != 0.0) {
    6363          double errorEstimatedChange = (estimatedValue - originalValue) / prevValue; // percentage error of predicted change
    6464          errorsSquaredSum += errorEstimatedChange * errorEstimatedChange;
Note: See TracChangeset for help on using the changeset viewer.