Index: trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs
===================================================================
--- trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs	(revision 17184)
+++ trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs	(revision 17450)
@@ -20,9 +20,14 @@
 #endregion
 
+using System.Collections.Generic;
+using System.Linq;
+using HEAL.Attic;
+using HeuristicLab.Analysis;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Data;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
-using HEAL.Attic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
@@ -38,4 +43,7 @@
     private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
     private const string EstimationLimitsParameterName = "EstimationLimits";
+    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
+    private const string ValidationPartitionParameterName = "ValidationPartition";
+    private const string AnalyzeTestErrorParameterName = "Analyze Test Error";
 
     #region parameter properties
@@ -55,4 +63,17 @@
       get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
     }
+    public ILookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
+      get { return (ILookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeLengthParameterName]; }
+    }
+    public IValueLookupParameter<IntRange> ValidationPartitionParameter {
+      get { return (IValueLookupParameter<IntRange>)Parameters[ValidationPartitionParameterName]; }
+    }
+    public IFixedValueParameter<BoolValue> AnalyzeTestErrorParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[AnalyzeTestErrorParameterName]; }
+    }
+    public bool AnalyzeTestError {
+      get { return AnalyzeTestErrorParameter.Value.Value; }
+      set { AnalyzeTestErrorParameter.Value.Value = value; }
+    }
     #endregion
 
@@ -66,4 +87,8 @@
       Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));
       Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model."));
+      Parameters.Add(new LookupParameter<IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "Maximal length of the symbolic expression.") { Hidden = true });
+      Parameters.Add(new ValueLookupParameter<IntRange>(ValidationPartitionParameterName, "The validation partition."));
+      Parameters.Add(new FixedValueParameter<BoolValue>(AnalyzeTestErrorParameterName, "Flag whether the test error should be displayed in the Pareto-Front", new BoolValue(false)));
+
     }
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -87,4 +112,67 @@
       return model.CreateClassificationSolution((IClassificationProblemData)ProblemDataParameter.ActualValue.Clone());
     }
+
+    public override IOperation Apply() {
+      var operation = base.Apply();
+      var paretoFront = TrainingBestSolutionsParameter.ActualValue;
+
+      IResult result;
+      ScatterPlot qualityToTreeSize;
+      if (!ResultCollection.TryGetValue("Pareto Front Analysis", out result)) {
+        qualityToTreeSize = new ScatterPlot("Quality vs Tree Size", "");
+        qualityToTreeSize.VisualProperties.XAxisMinimumAuto = false;
+        qualityToTreeSize.VisualProperties.XAxisMaximumAuto = false;
+        qualityToTreeSize.VisualProperties.YAxisMinimumAuto = false;
+        qualityToTreeSize.VisualProperties.YAxisMaximumAuto = false;
+
+        qualityToTreeSize.VisualProperties.XAxisMinimumFixedValue = 0;
+        qualityToTreeSize.VisualProperties.XAxisMaximumFixedValue = MaximumSymbolicExpressionTreeLengthParameter.ActualValue.Value;
+        qualityToTreeSize.VisualProperties.YAxisMinimumFixedValue = 0;
+        qualityToTreeSize.VisualProperties.YAxisMaximumFixedValue = 1;
+        ResultCollection.Add(new Result("Pareto Front Analysis", qualityToTreeSize));
+      } else {
+        qualityToTreeSize = (ScatterPlot)result.Value;
+      }
+
+      int previousTreeLength = -1;
+      var sizeParetoFront = new LinkedList<ISymbolicClassificationSolution>();
+      foreach (var solution in paretoFront.OrderBy(s => s.Model.SymbolicExpressionTree.Length)) {
+        int treeLength = solution.Model.SymbolicExpressionTree.Length;
+        if (!sizeParetoFront.Any()) sizeParetoFront.AddLast(solution);
+        if (solution.TrainingAccuracy > sizeParetoFront.Last.Value.TrainingAccuracy) {
+          if (treeLength == previousTreeLength)
+            sizeParetoFront.RemoveLast();
+          sizeParetoFront.AddLast(solution);
+        }
+        previousTreeLength = treeLength;
+      }
+
+      qualityToTreeSize.Rows.Clear();
+      var trainingRow = new ScatterPlotDataRow("Training Accuracy", "", sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TrainingAccuracy, x)));
+      trainingRow.VisualProperties.PointSize = 8;
+      qualityToTreeSize.Rows.Add(trainingRow);
+
+      if (AnalyzeTestError) {
+        var testRow = new ScatterPlotDataRow("Test Accuracy", "",
+          sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length, x.TestAccuracy, x)));
+        testRow.VisualProperties.PointSize = 8;
+        qualityToTreeSize.Rows.Add(testRow);
+      }
+
+      var validationPartition = ValidationPartitionParameter.ActualValue;
+      if (validationPartition.Size != 0) {
+        var problemData = ProblemDataParameter.ActualValue;
+        var validationIndizes = Enumerable.Range(validationPartition.Start, validationPartition.Size).ToList();
+        var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, validationIndizes).ToList();
+        OnlineCalculatorError error;
+        var validationRow = new ScatterPlotDataRow("Validation Accuracy", "",
+          sizeParetoFront.Select(x => new Point2D<double>(x.Model.SymbolicExpressionTree.Length,
+          OnlineAccuracyCalculator.Calculate(targetValues, x.GetEstimatedClassValues(validationIndizes), out error))));
+        validationRow.VisualProperties.PointSize = 7;
+        qualityToTreeSize.Rows.Add(validationRow);
+      }
+
+      return operation;
+    }
   }
 }
