Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2330


Ignore:
Timestamp:
09/03/09 15:25:09 (15 years ago)
Author:
gkronber
Message:

Implemented #735

File:
1 edited

Legend:

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

    r2324 r2330  
    100100          oldValues = dirtyDataset.ReplaceVariableValues(variableName, Enumerable.Repeat(mean, end - start), start, end);
    101101          newValues = predictor.Predict(dirtyDataset, start, end);
    102           evaluationImpacts[variableName] = CalculateMSE(referenceValues, newValues);
     102          evaluationImpacts[variableName] = 1 - CalculateVAF(referenceValues, newValues);
    103103          dirtyDataset.ReplaceVariableValues(variableName, oldValues, start, end);
    104104        }
    105105      }
    106106
    107       double impactsSum = evaluationImpacts.Values.Sum();
    108       if (impactsSum.IsAlmost(0.0)) impactsSum = 1.0;
    109       foreach (KeyValuePair<string, double> p in evaluationImpacts.ToList())
    110         evaluationImpacts[p.Key] = p.Value / impactsSum;
    111 
    112107      return evaluationImpacts;
    113108    }
    114109
    115     private static double CalculateMSE(double[] referenceValues, double[] newValues) {
     110    private static double CalculateVAF(double[] referenceValues, double[] newValues) {
    116111      try {
    117         return SimpleMSEEvaluator.Calculate(MatrixCreator<double>.CreateMatrix(referenceValues, newValues));
     112        return SimpleVarianceAccountedForEvaluator.Calculate(MatrixCreator<double>.CreateMatrix(referenceValues, newValues));
    118113      }
    119114      catch (ArgumentException) {
Note: See TracChangeset for help on using the changeset viewer.