Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/17/09 13:32:19 (15 years ago)
Author:
gkronber
Message:

Fixed a bug in the variable impact calculation operators. #750.

Location:
trunk/sources/HeuristicLab.Modeling/3.2
Files:
2 edited

Legend:

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

    r2330 r2368  
    9797      foreach (string variableName in variables) {
    9898        if (variableName != targetVariableName) {
    99           mean = dataset.GetMean(variableName, start, end);
    100           oldValues = dirtyDataset.ReplaceVariableValues(variableName, Enumerable.Repeat(mean, end - start), start, end);
    101           newValues = predictor.Predict(dirtyDataset, start, end);
    102           evaluationImpacts[variableName] = 1 - CalculateVAF(referenceValues, newValues);
    103           dirtyDataset.ReplaceVariableValues(variableName, oldValues, start, end);
     99          if (dataset.CountMissingValues(variableName, start, end) < (end - start) && dataset.GetRange(variableName, start, end) > 0.0) {
     100            mean = dataset.GetMean(variableName, start, end);
     101            oldValues = dirtyDataset.ReplaceVariableValues(variableName, Enumerable.Repeat(mean, end - start), start, end);
     102            newValues = predictor.Predict(dirtyDataset, start, end);
     103            evaluationImpacts[variableName] = 1 - CalculateVAF(referenceValues, newValues);
     104            dirtyDataset.ReplaceVariableValues(variableName, oldValues, start, end);
     105          } else {
     106            evaluationImpacts[variableName] = 0.0;
     107          }
    104108        }
    105109      }
  • trunk/sources/HeuristicLab.Modeling/3.2/VariableQualityImpactCalculator.cs

    r2357 r2368  
    9999
    100100      foreach (string variableName in variables) {
    101         if (variableName != targetVariableName) {
     101        if (dataset.CountMissingValues(variableName, start, end) < (end - start) &&
     102          dataset.GetRange(variableName, start, end) > 0.0 &&
     103          variableName != targetVariableName) {
    102104          mean = dataset.GetMean(variableName, start, end);
    103105          oldValues = dirtyDataset.ReplaceVariableValues(variableName, Enumerable.Repeat(mean, end - start), start, end);
     
    106108          evaluationImpacts[variableName] = newMSE / oldMSE;
    107109          dirtyDataset.ReplaceVariableValues(variableName, oldValues, start, end);
     110        } else {
     111          evaluationImpacts[variableName] = 1.0;
    108112        }
    109113      }
Note: See TracChangeset for help on using the changeset viewer.