Index: trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
===================================================================
--- trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs	(revision 17028)
+++ trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs	(revision 17030)
@@ -21,6 +21,8 @@
 #endregion
 
+using System;
 using System.Linq;
 using System.Threading;
+using HeuristicLab.Algorithms.DataAnalysis.GradientBoostedTrees;
 using HeuristicLab.Analysis;
 using HeuristicLab.Common;
@@ -48,5 +50,5 @@
     private const string LossFunctionParameterName = "LossFunction";
     private const string UpdateIntervalParameterName = "UpdateInterval";
-    private const string CreateSolutionParameterName = "CreateSolution";
+    private const string ModelCreationParameterName = "ModelCreation";
     #endregion
 
@@ -79,6 +81,6 @@
       get { return (IFixedValueParameter<IntValue>)Parameters[UpdateIntervalParameterName]; }
     }
-    public IFixedValueParameter<BoolValue> CreateSolutionParameter {
-      get { return (IFixedValueParameter<BoolValue>)Parameters[CreateSolutionParameterName]; }
+    private IFixedValueParameter<EnumValue<ModelCreation>> ModelCreationParameter {
+      get { return (IFixedValueParameter<EnumValue<ModelCreation>>)Parameters[ModelCreationParameterName]; }
     }
     #endregion
@@ -113,7 +115,7 @@
       set { MParameter.Value.Value = value; }
     }
-    public bool CreateSolution {
-      get { return CreateSolutionParameter.Value.Value; }
-      set { CreateSolutionParameter.Value.Value = value; }
+    public ModelCreation ModelCreation {
+      get { return ModelCreationParameter.Value.Value; }
+      set { ModelCreationParameter.Value.Value = value; }
     }
     #endregion
@@ -146,5 +148,5 @@
       Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
       Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
-      Parameters.Add(new FixedValueParameter<IntValue>(MaxSizeParameterName, "Maximal size of the tree learned in each step (prefer smaller sizes if possible)", new IntValue(10)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaxSizeParameterName, "Maximal size of the tree learned in each step (prefer smaller sizes (3 to 10) if possible)", new IntValue(10)));
       Parameters.Add(new FixedValueParameter<DoubleValue>(RParameterName, "Ratio of training rows selected randomly in each step (0 < R <= 1)", new DoubleValue(0.5)));
       Parameters.Add(new FixedValueParameter<DoubleValue>(MParameterName, "Ratio of variables selected randomly in each step (0 < M <= 1)", new DoubleValue(0.5)));
@@ -152,6 +154,6 @@
       Parameters.Add(new FixedValueParameter<IntValue>(UpdateIntervalParameterName, "", new IntValue(100)));
       Parameters[UpdateIntervalParameterName].Hidden = true;
-      Parameters.Add(new FixedValueParameter<BoolValue>(CreateSolutionParameterName, "Flag that indicates if a solution should be produced at the end of the run", new BoolValue(true)));
-      Parameters[CreateSolutionParameterName].Hidden = true;
+      Parameters.Add(new FixedValueParameter<EnumValue<ModelCreation>>(ModelCreationParameterName, "Defines the results produced at the end of the run (Surrogate => Less disk space, lazy recalculation of model)", new EnumValue<ModelCreation>(ModelCreation.Model)));
+      Parameters[ModelCreationParameterName].Hidden = true;
 
       var lossFunctions = ApplicationManager.Manager.GetInstances<ILossFunction>();
@@ -164,4 +166,6 @@
       // BackwardsCompatibility3.4
       #region Backwards compatible code, remove with 3.5
+
+      #region LossFunction
       // parameter type has been changed
       var lossFunctionParam = Parameters[LossFunctionParameterName] as ConstrainedValueParameter<StringValue>;
@@ -182,4 +186,17 @@
       }
       #endregion
+
+      #region CreateSolution
+      // parameter type has been changed
+      if (Parameters.ContainsKey("CreateSolution")) {
+        var createSolutionParam = Parameters["CreateSolution"] as FixedValueParameter<BoolValue>;
+        Parameters.Remove(createSolutionParam);
+
+        ModelCreation value = createSolutionParam.Value.Value ? ModelCreation.Model : ModelCreation.QualityOnly;
+        Parameters.Add(new FixedValueParameter<EnumValue<ModelCreation>>(ModelCreationParameterName, "Defines the results produced at the end of the run (Surrogate => Less disk space, lazy recalculation of model)", new EnumValue<ModelCreation>(value)));
+        Parameters[ModelCreationParameterName].Hidden = true;
+      }
+      #endregion
+      #endregion
     }
 
@@ -248,6 +265,10 @@
 
       // produce solution 
-      if (CreateSolution) {
-        var model = state.GetModel();
+      if (ModelCreation == ModelCreation.SurrogateModel || ModelCreation == ModelCreation.Model) {
+        IRegressionModel model = state.GetModel();
+
+        if (ModelCreation == ModelCreation.SurrogateModel) {
+          model = new GradientBoostedTreesModelSurrogate(problemData, (uint)Seed, lossFunction, Iterations, MaxSize, R, M, Nu, (GradientBoostedTreesModel)model);
+        }
 
         // for logistic regression we produce a classification solution
@@ -271,4 +292,8 @@
           Results.Add(new Result("Solution", new GradientBoostedTreesSolution(model, problemData)));
         }
+      } else if (ModelCreation == ModelCreation.QualityOnly) {
+        //Do nothing
+      } else {
+        throw new NotImplementedException("Selected parameter for CreateSolution isn't implemented yet");
       }
     }
Index: trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs
===================================================================
--- trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs	(revision 17028)
+++ trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithmStatic.cs	(revision 17030)
@@ -101,11 +101,5 @@
 
       public IRegressionModel GetModel() {
-#pragma warning disable 618
-        var model = new GradientBoostedTreesModel(models, weights);
-#pragma warning restore 618
-        // we don't know the number of iterations here but the number of weights is equal 
-        // to the number of iterations + 1 (for the constant model)
-        // wrap the actual model in a surrogate that enables persistence and lazy recalculation of the model if necessary
-        return new GradientBoostedTreesModelSurrogate(problemData, randSeed, lossFunction, weights.Count - 1, maxSize, r, m, nu, model);
+        return new GradientBoostedTreesModel(models, weights);
       }
       public IEnumerable<KeyValuePair<string, double>> GetVariableRelevance() {
Index: trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
===================================================================
--- trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs	(revision 17028)
+++ trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs	(revision 17030)
@@ -36,23 +36,20 @@
     // BackwardsCompatibility3.4 for allowing deserialization & serialization of old models
     #region Backwards compatible code, remove with 3.5
-    private bool isCompatibilityLoaded = false; // only set to true if the model is deserialized from the old format, needed to make sure that information is serialized again if it was loaded from the old format
 
     [Storable(Name = "models")]
     private IList<IRegressionModel> __persistedModels {
       set {
-        this.isCompatibilityLoaded = true;
         this.models.Clear();
         foreach (var m in value) this.models.Add(m);
       }
-      get { if (this.isCompatibilityLoaded) return models; else return null; }
+      get { return models; }
     }
     [Storable(Name = "weights")]
     private IList<double> __persistedWeights {
       set {
-        this.isCompatibilityLoaded = true;
         this.weights.Clear();
         foreach (var w in value) this.weights.Add(w);
       }
-      get { if (this.isCompatibilityLoaded) return weights; else return null; }
+      get { return weights; }
     }
     #endregion
@@ -77,7 +74,6 @@
       this.weights = new List<double>(original.weights);
       this.models = new List<IRegressionModel>(original.models.Select(m => cloner.Clone(m)));
-      this.isCompatibilityLoaded = original.isCompatibilityLoaded;
     }
-    [Obsolete("The constructor of GBTModel should not be used directly anymore (use GBTModelSurrogate instead)")]
+
     internal GradientBoostedTreesModel(IEnumerable<IRegressionModel> models, IEnumerable<double> weights)
       : base(string.Empty, "Gradient boosted tree model", string.Empty) {
Index: trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/ModelCreation.cs
===================================================================
--- trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/ModelCreation.cs	(revision 17030)
+++ trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/ModelCreation.cs	(revision 17030)
@@ -0,0 +1,39 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * and the BEACON Center for the Study of Evolution in Action.
+ * 
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HEAL.Attic;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.GradientBoostedTrees {
+
+  /// <summary>
+  /// Defines what part of the Model should be stored.
+  /// Quality - only the resulting Quality will be stored.
+  /// Parameter - only the parameters will be stored, the models can be calculated afterwards
+  /// Complete - the complete model will be stored (consider the amount of memory needed)
+  /// </summary>
+  [StorableType("EE55C357-C4B3-4662-B40B-D1D06A851809")]
+  public enum ModelCreation {
+    QualityOnly,
+    SurrogateModel,
+    Model
+  }
+}
Index: trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
===================================================================
--- trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj	(revision 17028)
+++ trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj	(revision 17030)
@@ -217,4 +217,5 @@
     <Compile Include="GradientBoostedTrees\LossFunctions\SquaredErrorLoss.cs" />
     <Compile Include="GradientBoostedTrees\GradientBoostedTreesSolution.cs" />
+    <Compile Include="GradientBoostedTrees\ModelCreation.cs" />
     <Compile Include="GradientBoostedTrees\RegressionTreeBuilder.cs" />
     <Compile Include="GradientBoostedTrees\RegressionTreeModel.cs" />
