Index: branches/2839_HiveProjectManagement/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs
===================================================================
--- branches/2839_HiveProjectManagement/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs	(revision 15761)
+++ branches/2839_HiveProjectManagement/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs	(revision 16057)
@@ -1,5 +1,5 @@
 #region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -51,4 +51,5 @@
     private const string SeedParameterName = "Seed";
     private const string InitParamsRandomlyParameterName = "InitializeParametersRandomly";
+    private const string ApplyLinearScalingParameterName = "Apply linear scaling";
 
     public IFixedValueParameter<StringValue> ModelStructureParameter {
@@ -73,4 +74,8 @@
     public IFixedValueParameter<BoolValue> InitParametersRandomlyParameter {
       get { return (IFixedValueParameter<BoolValue>)Parameters[InitParamsRandomlyParameterName]; }
+    }
+
+    public IFixedValueParameter<BoolValue> ApplyLinearScalingParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[ApplyLinearScalingParameterName]; }
     }
 
@@ -103,4 +108,9 @@
       get { return InitParametersRandomlyParameter.Value.Value; }
       set { InitParametersRandomlyParameter.Value.Value = value; }
+    }
+
+    public bool ApplyLinearScaling {
+      get { return ApplyLinearScalingParameter.Value.Value; }
+      set { ApplyLinearScalingParameter.Value.Value = value; }
     }
 
@@ -119,4 +129,5 @@
       Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "Switch to determine if the random number seed should be initialized randomly.", new BoolValue(true)));
       Parameters.Add(new FixedValueParameter<BoolValue>(InitParamsRandomlyParameterName, "Switch to determine if the real-valued model parameters should be initialized randomly in each restart.", new BoolValue(false)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Switch to determine if linear scaling terms should be added to the model", new BoolValue(true)));
 
       SetParameterHiddenState();
@@ -146,4 +157,7 @@
       if (!Parameters.ContainsKey(InitParamsRandomlyParameterName))
         Parameters.Add(new FixedValueParameter<BoolValue>(InitParamsRandomlyParameterName, "Switch to determine if the numeric parameters of the model should be initialized randomly.", new BoolValue(false)));
+      if (!Parameters.ContainsKey(ApplyLinearScalingParameterName))
+        Parameters.Add(new FixedValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Switch to determine if linear scaling terms should be added to the model", new BoolValue(true)));
+
 
       SetParameterHiddenState();
@@ -174,9 +188,9 @@
         if (SetSeedRandomly) Seed = (new System.Random()).Next();
         var rand = new MersenneTwister((uint)Seed);
-        bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, rand);
+        bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling, rand);
         trainRMSERow.Values.Add(bestSolution.TrainingRootMeanSquaredError);
         testRMSERow.Values.Add(bestSolution.TestRootMeanSquaredError);
         for (int r = 0; r < Restarts; r++) {
-          var solution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, rand);
+          var solution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling, rand);
           trainRMSERow.Values.Add(solution.TrainingRootMeanSquaredError);
           testRMSERow.Values.Add(solution.TestRootMeanSquaredError);
@@ -186,5 +200,5 @@
         }
       } else {
-        bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations);
+        bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling);
       }
 
@@ -206,5 +220,5 @@
     /// <param name="random">Optional random number generator for random initialization of numeric constants.</param>
     /// <returns></returns>
-    public static ISymbolicRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData, string modelStructure, int maxIterations, IRandom rand = null) {
+    public static ISymbolicRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData, string modelStructure, int maxIterations, bool applyLinearScaling, IRandom rand = null) {
       var parser = new InfixExpressionParser();
       var tree = parser.Parse(modelStructure);
@@ -262,10 +276,12 @@
 
       SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, tree, problemData, problemData.TrainingIndices,
-        applyLinearScaling: false, maxIterations: maxIterations,
+        applyLinearScaling: applyLinearScaling, maxIterations: maxIterations,
         updateVariableWeights: false, updateConstantsInTree: true);
 
-      var scaledModel = new SymbolicRegressionModel(problemData.TargetVariable, tree, (ISymbolicDataAnalysisExpressionTreeInterpreter)interpreter.Clone());
-      scaledModel.Scale(problemData);
-      SymbolicRegressionSolution solution = new SymbolicRegressionSolution(scaledModel, (IRegressionProblemData)problemData.Clone());
+      var model = new SymbolicRegressionModel(problemData.TargetVariable, tree, (ISymbolicDataAnalysisExpressionTreeInterpreter)interpreter.Clone());
+      if (applyLinearScaling)
+        model.Scale(problemData);
+
+      SymbolicRegressionSolution solution = new SymbolicRegressionSolution(model, (IRegressionProblemData)problemData.Clone());
       solution.Model.Name = "Regression Model";
       solution.Name = "Regression Solution";
