Index: /trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs
===================================================================
--- /trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs	(revision 17844)
+++ /trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs	(revision 17845)
@@ -281,5 +281,5 @@
             new AccuracyMaximizationThresholdCalculator());
           var classificationProblemData = new ClassificationProblemData(problemData.Dataset,
-            problemData.AllowedInputVariables, problemData.TargetVariable, problemData.Transformations);
+            problemData.AllowedInputVariables, problemData.TargetVariable, transformations: problemData.Transformations);
           classificationProblemData.TrainingPartition.Start = Problem.ProblemData.TrainingPartition.Start;
           classificationProblemData.TrainingPartition.End = Problem.ProblemData.TrainingPartition.End;
Index: /trunk/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs
===================================================================
--- /trunk/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs	(revision 17844)
+++ /trunk/HeuristicLab.DataPreprocessing/3.4/ProblemDataCreator.cs	(revision 17845)
@@ -96,5 +96,5 @@
         targetVariable = context.Data.VariableNames.First();
       var inputVariables = GetDoubleInputVariables(targetVariable);
-      var newProblemData = new ClassificationProblemData(ExportedDataset, inputVariables, targetVariable, Transformations) {
+      var newProblemData = new ClassificationProblemData(ExportedDataset, inputVariables, targetVariable, transformations: Transformations) {
         PositiveClass = oldProblemData.PositiveClass
       };
Index: /trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
===================================================================
--- /trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs	(revision 17844)
+++ /trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs	(revision 17845)
@@ -306,4 +306,5 @@
         classNamesCache.Add(ClassNamesParameter.Value[i, 0]);
     }
+
     public override IDeepCloneable Clone(Cloner cloner) {
       if (this == emptyProblemData) return emptyProblemData;
@@ -314,11 +315,22 @@
 
     public ClassificationProblemData(IClassificationProblemData classificationProblemData)
-      : this(classificationProblemData.Dataset, classificationProblemData.AllowedInputVariables, classificationProblemData.TargetVariable, classificationProblemData.ClassNames, classificationProblemData.PositiveClass) {
-      
+      : this(classificationProblemData, classificationProblemData.Dataset) {
+    }
+
+    /// <summary>
+    /// This method satisfies a common use case: making a copy of the problem but providing a different dataset.
+    /// One must be careful here that the dataset passed is not modified, as that would invalidate the problem data internals.
+    /// Passing a ModifiableDataset to this constructor is therefore discouraged.
+    /// </summary>
+    /// <param name="classificationProblemData">The original instance of classification problem data.</param>
+    /// <param name="dataset">The new dataset.</param>
+    public ClassificationProblemData(IClassificationProblemData classificationProblemData, IDataset dataset)
+    : this(classificationProblemData.Dataset, classificationProblemData.AllowedInputVariables, classificationProblemData.TargetVariable, classificationProblemData.ClassNames, classificationProblemData.PositiveClass) {
+
       TrainingPartition.Start = classificationProblemData.TrainingPartition.Start;
       TrainingPartition.End = classificationProblemData.TrainingPartition.End;
       TestPartition.Start = classificationProblemData.TestPartition.Start;
       TestPartition.End = classificationProblemData.TestPartition.End;
-      
+
       for (int i = 0; i < Classes; i++) {
         for (int j = 0; j < Classes; j++) {
@@ -328,9 +340,6 @@
     }
 
-    public ClassificationProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
-      : this(dataset, allowedInputVariables, targetVariable, Enumerable.Empty<string>(), null, transformations) { }
-
     public ClassificationProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable,
-      IEnumerable<string> classNames,
+      IEnumerable<string> classNames = null,
       string positiveClass = null, // can be null in which case it's set as the first class name
       IEnumerable<ITransformation> transformations = null)
@@ -348,8 +357,8 @@
 
       // set the class names
-      if (classNames.Any()) {
+      if (classNames != null && classNames.Any()) {
         // better to allocate lists because we use these multiple times below
         var names = classNames.ToList();
-        var values = ClassValues.ToList();
+        var values = ClassValuesCache;
 
         if (names.Count != values.Count) {
