Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/15/09 13:22:12 (15 years ago)
Author:
mkommend
Message:

fixed memory leak in VariableImpactCalculators by cloning the IPredictor (ticket #815)

File:
1 edited

Legend:

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

    r2440 r2559  
    8484      Dictionary<string, double> evaluationImpacts = new Dictionary<string, double>();
    8585      Dataset dirtyDataset = (Dataset)dataset.Clone();
     86      IPredictor dirtyPredictor = (IPredictor)predictor.Clone();
    8687      double[] referenceValues = predictor.Predict(dataset, start, end);
    8788
     
    100101            mean = dataset.GetMean(variableName, start, end);
    101102            oldValues = dirtyDataset.ReplaceVariableValues(variableName, Enumerable.Repeat(mean, end - start), start, end);
    102             newValues = predictor.Predict(dirtyDataset, start, end);
     103            newValues = dirtyPredictor.Predict(dirtyDataset, start, end);
    103104            evaluationImpacts[variableName] = 1 - CalculateVAF(referenceValues, newValues);
    104105            dirtyDataset.ReplaceVariableValues(variableName, oldValues, start, end);
Note: See TracChangeset for help on using the changeset viewer.