Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/DefaultClassificationAlgorithmOperators.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/DefaultClassificationAlgorithmOperators.cs	(revision 2341)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/DefaultClassificationAlgorithmOperators.cs	(revision 2341)
@@ -0,0 +1,95 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * 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 HeuristicLab.Core;
+using HeuristicLab.DataAnalysis;
+using HeuristicLab.GP.Interfaces;
+using HeuristicLab.Operators;
+using HeuristicLab.Modeling;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.GP.StructureIdentification.Classification {
+  internal static class DefaultClassificationAlgorithmOperators {
+    internal static IOperator CreatePostProcessingOperator() {
+      SequentialProcessor seq = new SequentialProcessor();
+      seq.AddSubOperator(DefaultStructureIdentificationAlgorithmOperators.CreatePostProcessingOperator());
+
+      UniformSequentialSubScopesProcessor subScopesProc = new UniformSequentialSubScopesProcessor();
+      SequentialProcessor individualProc = new SequentialProcessor();
+      subScopesProc.AddSubOperator(individualProc);
+      seq.AddSubOperator(subScopesProc);
+      AccuracyEvaluator trainingAccuracy = new AccuracyEvaluator();
+      trainingAccuracy.Name = "TrainingAccuracyEvaluator";
+      trainingAccuracy.GetVariableInfo("Accuracy").ActualName = "TrainingAccuracy";
+      trainingAccuracy.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
+      trainingAccuracy.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+
+      AccuracyEvaluator validationAccuracy = new AccuracyEvaluator();
+      validationAccuracy.Name = "ValidationAccuracyEvaluator";
+      validationAccuracy.GetVariableInfo("Accuracy").ActualName = "ValidationAccuracy";
+      validationAccuracy.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
+      validationAccuracy.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
+
+      AccuracyEvaluator testAccuracy = new AccuracyEvaluator();
+      testAccuracy.Name = "TestAccuracyEvaluator";
+      testAccuracy.GetVariableInfo("Accuracy").ActualName = "TestAccuracy";
+      testAccuracy.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
+      testAccuracy.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
+
+      ConfusionMatrixEvaluator trainingConfusionMatrix = new ConfusionMatrixEvaluator();
+      trainingConfusionMatrix.Name = "TrainingConfusionMatrixEvaluator";
+      trainingConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TrainingConfusionMatrix";
+      trainingConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "TrainingSamplesStart";
+      trainingConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "TrainingSamplesEnd";
+
+      ConfusionMatrixEvaluator validationConfusionMatrix = new ConfusionMatrixEvaluator();
+      validationConfusionMatrix.Name = "ValidationConfusionMatrixEvaluator";
+      validationConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "ValidationConfusionMatrix";
+      validationConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
+      validationConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
+
+      ConfusionMatrixEvaluator testConfusionMatrix = new ConfusionMatrixEvaluator();
+      testConfusionMatrix.Name = "TestConfusionMatrixEvaluator";
+      testConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TestConfusionMatrix";
+      testConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
+      testConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
+
+      individualProc.AddSubOperator(trainingAccuracy);
+      individualProc.AddSubOperator(validationAccuracy);
+      individualProc.AddSubOperator(testAccuracy);
+      individualProc.AddSubOperator(trainingConfusionMatrix);
+      individualProc.AddSubOperator(validationConfusionMatrix);
+      individualProc.AddSubOperator(testConfusionMatrix);
+      return seq;
+    }
+
+    internal static IOperator CreateProblemInjector() {
+      CombinedOperator op = new CombinedOperator();
+      op.Name = "ProblemInjector";
+      SequentialProcessor seq = new SequentialProcessor();
+      seq.AddSubOperator(new ProblemInjector());
+      seq.AddSubOperator(new TargetClassesCalculator());
+      op.OperatorGraph.AddOperator(seq);
+      op.OperatorGraph.InitialOperator = seq;
+      return op;
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/HeuristicLab.GP.StructureIdentification.Classification-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/HeuristicLab.GP.StructureIdentification.Classification-3.3.csproj	(revision 2328)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/HeuristicLab.GP.StructureIdentification.Classification-3.3.csproj	(revision 2341)
@@ -83,4 +83,6 @@
     <Compile Include="ClassificationMeanSquaredErrorEvaluator.cs" />
     <Compile Include="ConfusionMatrixEvaluator.cs" />
+    <Compile Include="TargetClassesCalculator.cs" />
+    <Compile Include="DefaultClassificationAlgorithmOperators.cs" />
     <Compile Include="GPClassificationEvaluatorBase.cs" />
     <Compile Include="CrossValidation.cs" />
@@ -109,4 +111,8 @@
       <Project>{F473D9AF-3F09-4296-9F28-3C65118DAFFA}</Project>
       <Name>HeuristicLab.Data-3.2</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.GP.Algorithms\3.2\HeuristicLab.GP.Algorithms-3.2.csproj">
+      <Project>{3127719F-110E-4558-8845-98559DBB422D}</Project>
+      <Name>HeuristicLab.GP.Algorithms-3.2</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.GP.Interfaces\3.3\HeuristicLab.GP.Interfaces-3.3.csproj">
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs	(revision 2328)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/OffspringSelectionGP.cs	(revision 2341)
@@ -27,9 +27,10 @@
   public class OffspringSelectionGP : HeuristicLab.GP.StructureIdentification.OffspringSelectionGP, IClassificationAlgorithm {
 
-    protected override IOperator CreateBestSolutionProcessor() {
-      IOperator seq = new SequentialProcessor();
-      seq.AddSubOperator(base.CreateBestSolutionProcessor());
-      seq.AddSubOperator(StandardGP.BestSolutionProcessor);
-      return seq;
+    protected override IOperator CreateProblemInjector() {
+      return DefaultClassificationAlgorithmOperators.CreateProblemInjector();
+    }
+
+    protected override IOperator CreatePostProcessingOperator() {
+      return DefaultClassificationAlgorithmOperators.CreatePostProcessingOperator();
     }
   }
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs	(revision 2328)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/StandardGP.cs	(revision 2341)
@@ -23,54 +23,10 @@
 using HeuristicLab.Modeling;
 using HeuristicLab.Operators;
+using System;
 
 namespace HeuristicLab.GP.StructureIdentification.Classification {
   public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, IClassificationAlgorithm {
-    protected override IOperator CreateBestSolutionProcessor() {
-      IOperator bestSolutionProcessor = BestSolutionProcessor;
-      bestSolutionProcessor.AddSubOperator(base.CreateBestSolutionProcessor());
-      return bestSolutionProcessor;
-    }
-
-    internal static IOperator BestSolutionProcessor {
-      get {
-        SequentialProcessor seq = new SequentialProcessor();
-        AccuracyEvaluator trainingAccuracy = new AccuracyEvaluator();
-        trainingAccuracy.GetVariableInfo("Accuracy").ActualName = "TrainingAccuracy";
-        trainingAccuracy.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
-        trainingAccuracy.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
-
-        AccuracyEvaluator validationAccuracy = new AccuracyEvaluator();
-        validationAccuracy.GetVariableInfo("Accuracy").ActualName = "ValidationAccuracy";
-        validationAccuracy.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
-        validationAccuracy.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
-
-        AccuracyEvaluator testAccuracy = new AccuracyEvaluator();
-        testAccuracy.GetVariableInfo("Accuracy").ActualName = "TestAccuracy";
-        testAccuracy.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
-        testAccuracy.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
-
-        ConfusionMatrixEvaluator trainingConfusionMatrix = new ConfusionMatrixEvaluator();
-        trainingConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TrainingConfusionMatrix";
-        trainingConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "ActualTrainingSamplesStart";
-        trainingConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "ActualTrainingSamplesEnd";
-
-        ConfusionMatrixEvaluator validationConfusionMatrix = new ConfusionMatrixEvaluator();
-        validationConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "ValidationConfusionMatrix";
-        validationConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "ValidationSamplesStart";
-        validationConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "ValidationSamplesEnd";
-
-        ConfusionMatrixEvaluator testConfusionMatrix = new ConfusionMatrixEvaluator();
-        testConfusionMatrix.GetVariableInfo("ConfusionMatrix").ActualName = "TestConfusionMatrix";
-        testConfusionMatrix.GetVariableInfo("SamplesStart").ActualName = "TestSamplesStart";
-        testConfusionMatrix.GetVariableInfo("SamplesEnd").ActualName = "TestSamplesEnd";
-
-        seq.AddSubOperator(trainingAccuracy);
-        seq.AddSubOperator(validationAccuracy);
-        seq.AddSubOperator(testAccuracy);
-        seq.AddSubOperator(trainingConfusionMatrix);
-        seq.AddSubOperator(validationConfusionMatrix);
-        seq.AddSubOperator(testConfusionMatrix);
-        return seq;
-      }
+    protected override IOperator CreatePostProcessingOperator() {
+      return DefaultClassificationAlgorithmOperators.CreatePostProcessingOperator();
     }
   }
Index: trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/TargetClassesCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/TargetClassesCalculator.cs	(revision 2341)
+++ trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/TargetClassesCalculator.cs	(revision 2341)
@@ -0,0 +1,51 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * 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 System;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.DataAnalysis;
+using System.Linq;
+
+namespace HeuristicLab.GP.StructureIdentification.Classification {
+  public class TargetClassesCalculator : OperatorBase {
+
+    public TargetClassesCalculator()
+      : base() {
+      AddVariableInfo(new VariableInfo("Dataset", "The dataset", typeof(Dataset), VariableKind.In));
+      AddVariableInfo(new VariableInfo("TargetVariable", "Index of the target variable", typeof(IntData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("TargetClassValues", "The original class values of target variable (for instance negative=0 and positive=1).", typeof(ItemList<DoubleData>), VariableKind.New));
+    }
+
+    public override IOperation Apply(IScope scope) {
+      Dataset dataset = GetVariableValue<Dataset>("Dataset", scope, true);
+      int targetVariable = GetVariableValue<IntData>("TargetVariable", scope, true).Data;
+
+      ItemList<DoubleData> classes = new ItemList<DoubleData>();
+      foreach(double x in dataset.GetVariableValues(targetVariable).Distinct().OrderBy(v=>v)) {
+        classes.Add(new DoubleData(x));
+      }
+
+      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TargetClassValues"), classes));
+      return null;
+    }
+  }
+}
