Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs	(revision 17788)
+++ trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleProblemData.cs	(revision 17835)
@@ -73,11 +73,7 @@
 
     public ClassificationEnsembleProblemData() : base() { }
+
     public ClassificationEnsembleProblemData(IClassificationProblemData classificationProblemData)
-      : base(classificationProblemData.Dataset, classificationProblemData.AllowedInputVariables, classificationProblemData.TargetVariable) {
-      this.TrainingPartition.Start = classificationProblemData.TrainingPartition.Start;
-      this.TrainingPartition.End = classificationProblemData.TrainingPartition.End;
-      this.TestPartition.Start = classificationProblemData.TestPartition.Start;
-      this.TestPartition.End = classificationProblemData.TestPartition.End;
-      this.PositiveClass = classificationProblemData.PositiveClass;
+      : base(classificationProblemData) {
     }
 
@@ -85,4 +81,8 @@
       : base(dataset, allowedInputVariables, targetVariable) {
     }
+
+    public ClassificationEnsembleProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<string> classNames, string positiveClass = null)
+      : base(dataset, allowedInputVariables, targetVariable, classNames, positiveClass) {
+    }
   }
 }
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs	(revision 17788)
+++ trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs	(revision 17835)
@@ -260,11 +260,5 @@
       evaluationCache.Clear();
 
-      IClassificationProblemData problemData = new ClassificationProblemData(ProblemData.Dataset,
-                                                                     ProblemData.AllowedInputVariables,
-                                                                     ProblemData.TargetVariable);
-      problemData.TrainingPartition.Start = ProblemData.TrainingPartition.Start;
-      problemData.TrainingPartition.End = ProblemData.TrainingPartition.End;
-      problemData.TestPartition.Start = ProblemData.TestPartition.Start;
-      problemData.TestPartition.End = ProblemData.TestPartition.End;
+      IClassificationProblemData problemData = new ClassificationProblemData(ProblemData);
 
       foreach (var solution in ClassificationSolutions) {
Index: trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs	(revision 17788)
+++ trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs	(revision 17835)
@@ -311,19 +311,14 @@
     }
 
-    public ClassificationProblemData() : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariable) { }
+    public ClassificationProblemData() : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariable, Enumerable.Empty<string>()) { }
 
     public ClassificationProblemData(IClassificationProblemData classificationProblemData)
-      : this(classificationProblemData.Dataset, classificationProblemData.AllowedInputVariables, classificationProblemData.TargetVariable) {
+      : 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 < classificationProblemData.ClassNames.Count(); i++)
-        ClassNamesParameter.Value[i, 0] = classificationProblemData.ClassNames.ElementAt(i);
-
-      //mkommend: The positive class depends on the class names and as a result must only be set after the classe names parameter.
-      PositiveClass = classificationProblemData.PositiveClass;
-
+      
       for (int i = 0; i < Classes; i++) {
         for (int j = 0; j < Classes; j++) {
@@ -334,4 +329,10 @@
 
     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,
+      string positiveClass = null, // can be null in which case it's set as the first class name
+      IEnumerable<ITransformation> transformations = null)
       : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
       var validTargetVariableValues = CheckVariablesForPossibleTargetVariables(dataset).Select(x => new StringValue(x).AsReadOnly()).ToList();
@@ -339,10 +340,33 @@
 
       Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(validTargetVariableValues), target));
-      Parameters.Add(new FixedValueParameter<StringMatrix>(ClassNamesParameterName, ""));
+      Parameters.Add(new FixedValueParameter<StringMatrix>(ClassNamesParameterName, "", new StringMatrix()));
       Parameters.Add(new ConstrainedValueParameter<StringValue>(PositiveClassParameterName, "The positive class which is used for quality measure calculation (e.g., specifity, sensitivity,...)"));
       Parameters.Add(new FixedValueParameter<DoubleMatrix>(ClassificationPenaltiesParameterName, ""));
 
       RegisterParameterEvents();
-      ResetTargetVariableDependentMembers();
+      ResetTargetVariableDependentMembers(); // correctly set the values of the parameters added above
+
+      // set the class names
+      if (classNames.Any()) {
+        // better to allocate lists because we use these multiple times below
+        var names = classNames.ToList();
+        var values = ClassValues.ToList();
+
+        if (names.Count != values.Count) {
+          throw new ArgumentException();
+        }
+
+        ((IStringConvertibleMatrix)ClassNamesParameter.Value).Columns = 1;
+        ((IStringConvertibleMatrix)ClassNamesParameter.Value).Rows = names.Count;
+
+        for (int i = 0; i < names.Count; ++i) {
+          SetClassName(values[i], names[i]);
+        }
+      }
+
+      // set the positive class value
+      if (positiveClass != null) {
+        PositiveClass = positiveClass;
+      }
     }
 
