Index: stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolutionImpactValuesCalculator.cs
===================================================================
--- stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolutionImpactValuesCalculator.cs	(revision 16432)
+++ stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolutionImpactValuesCalculator.cs	(revision 16434)
@@ -43,4 +43,5 @@
       OnlineCalculatorError errorState;
       var dataset = problemData.Dataset;
+      classificationModel.RecalculateModelParameters(classificationProblemData, rows);
       var targetClassValues = dataset.GetDoubleValues(classificationProblemData.TargetVariable, rows);
       var originalClassValues = classificationModel.GetEstimatedClassValues(dataset, rows);
Index: stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs
===================================================================
--- stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs	(revision 16432)
+++ stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisSolutionImpactValuesCalculator.cs	(revision 16434)
@@ -40,11 +40,13 @@
         out double impactValue, out double replacementValue, out double newQualityForImpactsCalculation,
         double qualityForImpactsCalculation = double.NaN) {
-      if (double.IsNaN(qualityForImpactsCalculation))
-        qualityForImpactsCalculation = CalculateQualityForImpacts(model, problemData, rows);
 
       var cloner = new Cloner();
       var tempModel = cloner.Clone(model);
+
+      if (double.IsNaN(qualityForImpactsCalculation)) {
+        qualityForImpactsCalculation = CalculateQualityForImpacts(tempModel, problemData, rows);
+      }
+
       var tempModelNode = (ISymbolicExpressionTreeNode)cloner.GetClone(node);
-
       var tempModelParentNode = tempModelNode.Parent;
       int i = tempModelParentNode.IndexOfSubtree(tempModelNode);
@@ -54,5 +56,5 @@
       newQualityForImpactsCalculation = qualityForImpactsCalculation; // initialize
       // try the potentially reasonable replacement values and use the best one
-      foreach (var repValue in CalculateReplacementValues(node, model.SymbolicExpressionTree, model.Interpreter, problemData.Dataset, problemData.TrainingIndices)) {
+      foreach (var repValue in CalculateReplacementValues(node, model.SymbolicExpressionTree, model.Interpreter, problemData.Dataset, rows)) {
         tempModelParentNode.RemoveSubtree(i);
 
Index: stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionVariableImpactsCalculator.cs
===================================================================
--- stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionVariableImpactsCalculator.cs	(revision 16432)
+++ stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionVariableImpactsCalculator.cs	(revision 16434)
@@ -100,4 +100,5 @@
       var problemData = solution.ProblemData;
       var dataset = problemData.Dataset;
+      var model = (IClassificationModel)solution.Model.Clone(); //mkommend: clone of model is necessary, because the thresholds for IDiscriminantClassificationModels are updated
 
       IEnumerable<int> rows;
@@ -137,5 +138,5 @@
       // calculate impacts for double variables
       foreach (var inputVariable in allowedInputVariables.Where(problemData.Dataset.VariableHasType<double>)) {
-        var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows, replacementMethod);
+        var newEstimates = EvaluateModelWithReplacedVariable(model, inputVariable, modifiableDataset, rows, replacementMethod);
         var newAccuracy = OnlineAccuracyCalculator.Calculate(targetValues, newEstimates, out error);
         if (error != OnlineCalculatorError.None) throw new InvalidOperationException("Error during R² calculation with replaced inputs.");
@@ -150,5 +151,5 @@
           var smallestImpact = double.PositiveInfinity;
           foreach (var repl in problemData.Dataset.GetStringValues(inputVariable, rows).Distinct()) {
-            var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows,
+            var newEstimates = EvaluateModelWithReplacedVariable(model, inputVariable, modifiableDataset, rows,
               Enumerable.Repeat(repl, dataset.Rows));
             var newAccuracy = OnlineAccuracyCalculator.Calculate(targetValues, newEstimates, out error);
@@ -164,5 +165,5 @@
           // calculate impacts for factor variables
 
-          var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows,
+          var newEstimates = EvaluateModelWithReplacedVariable(model, inputVariable, modifiableDataset, rows,
             factorReplacementMethod);
           var newAccuracy = OnlineAccuracyCalculator.Calculate(targetValues, newEstimates, out error);
@@ -263,4 +264,11 @@
       var originalValues = dataset.GetReadOnlyDoubleValues(variable).ToList();
       dataset.ReplaceVariable(variable, replacementValues.ToList());
+
+      var discModel = model as IDiscriminantFunctionClassificationModel;
+      if (discModel != null) {
+        var problemData = new ClassificationProblemData(dataset, dataset.VariableNames, model.TargetVariable);
+        discModel.RecalculateModelParameters(problemData, rows);
+      }
+
       //mkommend: ToList is used on purpose to avoid lazy evaluation that could result in wrong estimates due to variable replacements
       var estimates = model.GetEstimatedClassValues(dataset, rows).ToList();
@@ -273,4 +281,12 @@
       var originalValues = dataset.GetReadOnlyStringValues(variable).ToList();
       dataset.ReplaceVariable(variable, replacementValues.ToList());
+
+
+      var discModel = model as IDiscriminantFunctionClassificationModel;
+      if (discModel != null) {
+        var problemData = new ClassificationProblemData(dataset, dataset.VariableNames, model.TargetVariable);
+        discModel.RecalculateModelParameters(problemData, rows);
+      }
+
       //mkommend: ToList is used on purpose to avoid lazy evaluation that could result in wrong estimates due to variable replacements
       var estimates = model.GetEstimatedClassValues(dataset, rows).ToList();
