Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2559 for trunk/sources


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)

Location:
trunk/sources/HeuristicLab.Modeling/3.2
Files:
2 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);
  • trunk/sources/HeuristicLab.Modeling/3.2/VariableQualityImpactCalculator.cs

    r2440 r2559  
    8383      Dictionary<string, double> evaluationImpacts = new Dictionary<string, double>();
    8484      Dataset dirtyDataset = (Dataset)dataset.Clone();
     85      IPredictor dirtyPredictor = (IPredictor)predictor.Clone();
    8586
    8687      double[] predictedValues = predictor.Predict(dataset, start, end);
     
    104105          mean = dataset.GetMean(variableName, start, end);
    105106          oldValues = dirtyDataset.ReplaceVariableValues(variableName, Enumerable.Repeat(mean, end - start), start, end);
    106           predictedValues = predictor.Predict(dirtyDataset, start, end);
     107          predictedValues = dirtyPredictor.Predict(dirtyDataset, start, end);
    107108          newMSE = CalculateMSE(predictedValues, targetValues);
    108109          evaluationImpacts[variableName] = newMSE / oldMSE;
Note: See TracChangeset for help on using the changeset viewer.