Index: /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/FixedDataAnalysisAlgorithm.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/FixedDataAnalysisAlgorithm.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/FixedDataAnalysisAlgorithm.cs	(revision 5649)
@@ -76,6 +76,13 @@
       base.Start();
       OnStarted();
-      Run();
-      OnStopped();
+      try {
+        Run();
+      }
+      catch (Exception e) {
+        OnExceptionOccurred(e);
+      }
+      finally {
+        OnStopped();
+      }
     }
 
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs	(revision 5649)
@@ -42,5 +42,5 @@
   [StorableClass]
   public sealed class LinearRegression : FixedDataAnalysisAlgorithm<IRegressionProblem> {
-    private const string LinearRegressionModelResultName = "LinearRegressionModel";
+    private const string LinearRegressionModelResultName = "Linear regression solution";
 
     [StorableConstructor]
@@ -51,4 +51,5 @@
     public LinearRegression()
       : base() {
+      Problem = new RegressionProblem();
     }
     [StorableHook(HookType.AfterDeserialization)]
@@ -63,7 +64,7 @@
       double rmsError, cvRmsError;
       var solution = CreateLinearRegressionSolution(Problem.ProblemData, out rmsError, out cvRmsError);
-      Results.Add(new Result(LinearRegressionModelResultName, "The linear regression model.", solution));
-      Results.Add(new Result("Root mean square error", "The root of the mean of squared errors of the linear regression model on the training set.", new DoubleValue(rmsError)));
-      Results.Add(new Result("Estimated root mean square error (cross-validation)", "The estimated root of the mean of squared errors of the linear regression model via cross validation.", new DoubleValue(cvRmsError)));
+      Results.Add(new Result(LinearRegressionModelResultName, "The linear regression solution.", solution));
+      Results.Add(new Result("Root mean square error", "The root of the mean of squared errors of the linear regression solution on the training set.", new DoubleValue(rmsError)));
+      Results.Add(new Result("Estimated root mean square error (cross-validation)", "The estimated root of the mean of squared errors of the linear regression solution via cross validation.", new DoubleValue(cvRmsError)));
     }
 
@@ -71,9 +72,7 @@
       Dataset dataset = problemData.Dataset;
       string targetVariable = problemData.TargetVariable;
-      IEnumerable<string> allowedInputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value);
+      IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables;
       int samplesStart = problemData.TrainingPartitionStart.Value;
       int samplesEnd = problemData.TrainingPartitionEnd.Value;
-
-      IEnumerable<string> selectedInputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value);
 
       double[,] inputMatrix = LinearRegressionUtil.PrepareInputMatrix(dataset, targetVariable, allowedInputVariables, samplesStart, samplesEnd);
@@ -87,5 +86,5 @@
       int retVal = 1;
       alglib.lrbuild(inputMatrix, nRows, nFeatures, out retVal, out lm, out ar);
-      if (retVal != 1) throw new ArgumentException("Error in calculation of linear regression model");
+      if (retVal != 1) throw new ArgumentException("Error in calculation of linear regression solution");
       rmsError = ar.rmserror;
       cvRmsError = ar.cvrmserror;
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassification.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassification.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassification.cs	(revision 5649)
@@ -88,4 +88,6 @@
     public SupportVectorClassification()
       : base() {
+      Problem = new ClassificationProblem();
+
       List<StringValue> svrTypes = (from type in new List<string> { "NU_SVC", "EPSILON_SVC" }
                                     select new StringValue(type).AsReadOnly())
@@ -95,5 +97,5 @@
                                        select new StringValue(type).AsReadOnly())
                                    .ToList();
-      ItemSet<StringValue> kernelTypeSet = new ItemSet<StringValue>(svrTypes);
+      ItemSet<StringValue> kernelTypeSet = new ItemSet<StringValue>(kernelTypes);
       Parameters.Add(new ConstrainedValueParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", svrTypeSet, svrTypes[0]));
       Parameters.Add(new ConstrainedValueParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", kernelTypeSet, kernelTypes[3]));
@@ -112,5 +114,5 @@
     protected override void Run() {
       IClassificationProblemData problemData = Problem.ProblemData;
-      IEnumerable<string> selectedInputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value);
+      IEnumerable<string> selectedInputVariables = problemData.AllowedInputVariables;
       var solution = CreateSupportVectorClassificationSolution(problemData, selectedInputVariables, SvmType.Value, KernelType.Value, Cost.Value, Nu.Value, Gamma.Value);
 
@@ -140,9 +142,7 @@
       SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
       SVM.Problem scaledProblem = SVM.Scaling.Scale(rangeTransform, problem);
-      var model = new SupportVectorMachineModel();
-      model.Model = SVM.Training.Train(scaledProblem, parameter);
-      model.RangeTransform = rangeTransform;
+      var model = new SupportVectorMachineModel(SVM.Training.Train(scaledProblem, parameter), rangeTransform, targetVariable, allowedInputVariables);
 
-      return new SupportVectorClassificationSolution(model, problemData, allowedInputVariables, double.NegativeInfinity, double.PositiveInfinity);
+      return new SupportVectorClassificationSolution(model, problemData);
     }
     #endregion
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassificationSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassificationSolution.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassificationSolution.cs	(revision 5649)
@@ -41,23 +41,4 @@
     }
 
-    [Storable]
-    private double lowerEstimationLimit;
-    public double LowerEstimationLimit {
-      get { return lowerEstimationLimit; }
-    }
-
-    [Storable]
-    private double upperEstimationLimit;
-    public double UpperEstimationLimit {
-      get { return upperEstimationLimit; }
-    }
-
-    private List<string> inputVariables;
-    [Storable]
-    private IEnumerable<string> InputVariablesStorable {
-      get { return inputVariables; }
-      set { inputVariables = new List<string>(value); }
-    }
-
     public Dataset SupportVectors {
       get { return CalculateSupportVectors(); }
@@ -68,13 +49,7 @@
     private SupportVectorClassificationSolution(SupportVectorClassificationSolution original, Cloner cloner)
       : base(original, cloner) {
-      inputVariables = new List<string>(original.inputVariables);
-      lowerEstimationLimit = original.lowerEstimationLimit;
-      upperEstimationLimit = original.upperEstimationLimit;
     }
-    public SupportVectorClassificationSolution(SupportVectorMachineModel model, IClassificationProblemData problemData, IEnumerable<string> inputVariables, double lowerEstimationLimit, double upperEstimationLimit)
+    public SupportVectorClassificationSolution(SupportVectorMachineModel model, IClassificationProblemData problemData)
       : base(model, problemData) {
-      this.inputVariables = new List<string>(inputVariables);
-      this.lowerEstimationLimit = lowerEstimationLimit;
-      this.upperEstimationLimit = upperEstimationLimit;
     }
 
@@ -87,5 +62,5 @@
       base.OnProblemDataChanged(e);
     }
-    
+
     private Dataset CalculateSupportVectors() {
       if (Model.Model.SupportVectorIndizes.Length == 0)
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineModel.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineModel.cs	(revision 5649)
@@ -30,4 +30,5 @@
 using SVM;
 using HeuristicLab.Problems.DataAnalysis;
+using System.Drawing;
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
@@ -38,13 +39,4 @@
   [Item("SupportVectorMachineModel", "Represents a support vector machine model.")]
   public sealed class SupportVectorMachineModel : NamedItem, IRegressionModel, IClassificationModel {
-    [StorableConstructor]
-    private SupportVectorMachineModel(bool deserializing) : base(deserializing) { }
-    private SupportVectorMachineModel(SupportVectorMachineModel original, Cloner cloner)
-      : base(original, cloner) {
-      // only using a shallow copy here! (gkronber)
-      this.model = original.model;
-      this.rangeTransform = original.rangeTransform;
-    }
-    public SupportVectorMachineModel() : base() { }
 
     private SVM.Model model;
@@ -77,21 +69,46 @@
       }
     }
+
+    [Storable]
+    private string targetVariable;
+    [Storable]
+    private string[] allowedInputVariables;
+
+    [StorableConstructor]
+    private SupportVectorMachineModel(bool deserializing) : base(deserializing) { }
+    private SupportVectorMachineModel(SupportVectorMachineModel original, Cloner cloner)
+      : base(original, cloner) {
+      // only using a shallow copy here! (gkronber)
+      this.model = original.model;
+      this.rangeTransform = original.rangeTransform;
+
+    }
+    public SupportVectorMachineModel(SVM.Model model, SVM.RangeTransform rangeTransform, string targetVariable, IEnumerable<string> allowedInputVariables)
+      : base() {
+      this.name = ItemName;
+      this.description = ItemDescription;
+      this.model = model;
+      this.rangeTransform = rangeTransform;
+      this.targetVariable = targetVariable;
+      this.allowedInputVariables = allowedInputVariables.ToArray();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SupportVectorMachineModel(this, cloner);
+    }
+
+
     #region IRegressionModel Members
-    public IEnumerable<double> GetEstimatedValues(IRegressionProblemData problemData, IEnumerable<int> rows) {
-      return GetEstimatedValues(problemData, problemData.TargetVariable, rows);
+    public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) {
+      return GetEstimatedValuesHelper(dataset, rows);
     }
     #endregion
     #region IClassificationModel Members
-    public IEnumerable<double> GetEstimatedValues(IClassificationProblemData problemData, IEnumerable<int> rows) {
-      return GetEstimatedValues(problemData, problemData.TargetVariable, rows);
-    }
-
-    public IEnumerable<double> GetEstimatedClassValues(IClassificationProblemData problemData, IEnumerable<int> rows) {
-      return GetEstimatedValues(problemData, problemData.TargetVariable, rows);
+    public IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows) {
+      return GetEstimatedValuesHelper(dataset, rows);
     }
     #endregion
-    private IEnumerable<double> GetEstimatedValues(IDataAnalysisProblemData problemData, string targetVariable, IEnumerable<int> rows) {
-      var allowedInputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value);
-      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData.Dataset, targetVariable, allowedInputVariables, rows);
+    private IEnumerable<double> GetEstimatedValuesHelper(Dataset dataset, IEnumerable<int> rows) {
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(dataset, targetVariable, allowedInputVariables, rows);
       SVM.Problem scaledProblem = Scaling.Scale(RangeTransform, problem);
 
@@ -149,47 +166,4 @@
     }
     #endregion
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new SupportVectorMachineModel(this, cloner);
-    }
-
-    /// <summary>
-    ///  Exports the <paramref name="model"/> in string representation to stream <paramref name="s"/>
-    /// </summary>
-    /// <param name="model">The support vector machine model to export</param>
-    /// <param name="s">The stream to export the model to</param>
-    public static void Export(SupportVectorMachineModel model, Stream s) {
-      StreamWriter writer = new StreamWriter(s);
-      writer.WriteLine("RangeTransform:");
-      writer.Flush();
-      using (MemoryStream memStream = new MemoryStream()) {
-        SVM.RangeTransform.Write(memStream, model.RangeTransform);
-        memStream.Seek(0, SeekOrigin.Begin);
-        memStream.WriteTo(s);
-      }
-      writer.WriteLine("Model:");
-      writer.Flush();
-      using (MemoryStream memStream = new MemoryStream()) {
-        SVM.Model.Write(memStream, model.Model);
-        memStream.Seek(0, SeekOrigin.Begin);
-        memStream.WriteTo(s);
-      }
-      s.Flush();
-    }
-
-    /// <summary>
-    /// Imports a support vector machine model given as string representation.
-    /// </summary>
-    /// <param name="reader">The reader to retrieve the string representation from</param>
-    /// <returns>The imported support vector machine model.</returns>
-    public static SupportVectorMachineModel Import(TextReader reader) {
-      SupportVectorMachineModel model = new SupportVectorMachineModel();
-      while (reader.ReadLine().Trim() != "RangeTransform:") ; // read until line "RangeTransform";
-      model.RangeTransform = SVM.RangeTransform.Read(reader);
-      // read until "Model:"
-      while (reader.ReadLine().Trim() != "Model:") ;
-      model.Model = SVM.Model.Read(reader);
-      return model;
-    }
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs	(revision 5649)
@@ -95,4 +95,6 @@
     public SupportVectorRegression()
       : base() {
+      Problem = new RegressionProblem();
+
       List<StringValue> svrTypes = (from type in new List<string> { "NU_SVR", "EPSILON_SVR" }
                                     select new StringValue(type).AsReadOnly())
@@ -102,5 +104,5 @@
                                        select new StringValue(type).AsReadOnly())
                                    .ToList();
-      ItemSet<StringValue> kernelTypeSet = new ItemSet<StringValue>(svrTypes);
+      ItemSet<StringValue> kernelTypeSet = new ItemSet<StringValue>(kernelTypes);
       Parameters.Add(new ConstrainedValueParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", svrTypeSet, svrTypes[0]));
       Parameters.Add(new ConstrainedValueParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", kernelTypeSet, kernelTypes[3]));
@@ -120,5 +122,5 @@
     protected override void Run() {
       IRegressionProblemData problemData = Problem.ProblemData;
-      IEnumerable<string> selectedInputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value);
+      IEnumerable<string> selectedInputVariables = problemData.AllowedInputVariables;
       var solution = CreateSupportVectorRegressionSolution(problemData, selectedInputVariables, SvmType.Value, KernelType.Value, Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value);
 
@@ -149,9 +151,6 @@
       SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
       SVM.Problem scaledProblem = SVM.Scaling.Scale(rangeTransform, problem);
-      var model = new SupportVectorMachineModel();
-      model.Model = SVM.Training.Train(scaledProblem, parameter);
-      model.RangeTransform = rangeTransform;
-
-      return new SupportVectorRegressionSolution(model, problemData, allowedInputVariables, double.NegativeInfinity, double.PositiveInfinity);
+      var model = new SupportVectorMachineModel(SVM.Training.Train(scaledProblem, parameter), rangeTransform, targetVariable, allowedInputVariables);
+      return new SupportVectorRegressionSolution(model, problemData);
     }
     #endregion
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegressionSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegressionSolution.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegressionSolution.cs	(revision 5649)
@@ -41,23 +41,4 @@
     }
 
-    [Storable]
-    private double lowerEstimationLimit;
-    public double LowerEstimationLimit {
-      get { return lowerEstimationLimit; }
-    }
-
-    [Storable]
-    private double upperEstimationLimit;
-    public double UpperEstimationLimit {
-      get { return upperEstimationLimit; }
-    }
-
-    private List<string> inputVariables;
-    [Storable]
-    private IEnumerable<string> InputVariablesStorable {
-      get { return inputVariables; }
-      set { inputVariables = new List<string>(value); }
-    }
-
     public Dataset SupportVectors {
       get { return CalculateSupportVectors(); }
@@ -68,13 +49,7 @@
     private SupportVectorRegressionSolution(SupportVectorRegressionSolution original, Cloner cloner)
       : base(original, cloner) {
-      inputVariables = new List<string>(original.inputVariables);
-      lowerEstimationLimit = original.lowerEstimationLimit;
-      upperEstimationLimit = original.upperEstimationLimit;
     }
-    public SupportVectorRegressionSolution(SupportVectorMachineModel model, IRegressionProblemData problemData, IEnumerable<string> inputVariables, double lowerEstimationLimit, double upperEstimationLimit)
+    public SupportVectorRegressionSolution(SupportVectorMachineModel model, IRegressionProblemData problemData)
       : base(model, problemData) {
-      this.inputVariables = new List<string>(inputVariables);
-      this.lowerEstimationLimit = lowerEstimationLimit;
-      this.upperEstimationLimit = upperEstimationLimit;
     }
 
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj	(revision 5649)
@@ -108,4 +108,7 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Interfaces\ISymbolicDiscriminantFunctionClassificationModel.cs" />
+    <Compile Include="SymbolicDiscriminantFunctionClassificationModel.cs" />
+    <Compile Include="SymbolicDiscriminantFunctionClassificationSolution.cs" />
     <Compile Include="Interfaces\ISymbolicClassificationModel.cs" />
     <Compile Include="Interfaces\ISymbolicClassificationSolution.cs" />
@@ -121,5 +124,7 @@
     <Compile Include="SingleObjective\SymbolicClassificationSingleObjectiveProblem.cs" />
     <Compile Include="SingleObjective\SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs" />
-    <Compile Include="SymbolicClassificationModel.cs" />
+    <Compile Include="SymbolicClassificationModel.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Include="SymbolicClassificationSolution.cs" />
     <None Include="HeuristicLab.snk" />
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationSolution.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationSolution.cs	(revision 5649)
@@ -22,4 +22,6 @@
 
 using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using System.Collections.Generic;
+using System;
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
   public interface ISymbolicClassificationSolution : IClassificationSolution, ISymbolicDataAnalysisSolution {
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicDiscriminantFunctionClassificationModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicDiscriminantFunctionClassificationModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicDiscriminantFunctionClassificationModel.cs	(revision 5649)
@@ -0,0 +1,26 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Encodings.SymbolicExpressionTreeEncoding;
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
+  public interface ISymbolicDiscriminantFunctionClassificationModel : IDiscriminantFunctionClassificationModel, ISymbolicDataAnalysisModel {
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer.cs	(revision 5649)
@@ -37,5 +37,24 @@
   [Item("SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic classification solution for multi objective symbolic classification problems.")]
   [StorableClass]
-  public sealed class SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer : SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer<ISymbolicClassificationSolution> {
+  public sealed class SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer : SymbolicDataAnalysisMultiObjectiveTrainingBestSolutionAnalyzer<ISymbolicClassificationSolution>,
+    ISymbolicDataAnalysisInterpreterOperator {
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
+    #region parameter properties
+    public ILookupParameter<IClassificationProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IClassificationProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    #endregion
+    #region properties
+    public IClassificationProblemData ProblemData {
+      get { return ProblemDataParameter.ActualValue; }
+    }
+    public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicDataAnalysisTreeInterpreter {
+      get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }
+    }
+    #endregion
     [StorableConstructor]
     private SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
@@ -43,4 +62,5 @@
     public SymbolicClassificationMultiObjectiveTrainingBestSolutionAnalyzer()
       : base() {
+      Parameters.Add(new LookupParameter<IClassificationProblemData>(ProblemDataParameterName, "The problem data for the symbolic classification solution."));
     }
     public override IDeepCloneable Clone(Cloner cloner) {
@@ -50,5 +70,6 @@
 
     protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double[] bestQuality) {
-      throw new System.NotImplementedException();
+      var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, ProblemData.ClassValues);
+      return new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData);
     }
   }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs	(revision 5649)
@@ -37,6 +37,24 @@
   [Item("SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer", "An operator that analyzes the training best symbolic classification solution for single objective symbolic classification problems.")]
   [StorableClass]
-  public sealed class SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<ISymbolicClassificationSolution> {
-
+  public sealed class SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<ISymbolicClassificationSolution>,
+    ISymbolicDataAnalysisInterpreterOperator {
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
+    #region parameter properties
+    public ILookupParameter<IClassificationProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IClassificationProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    }
+    #endregion
+    #region properties
+    public IClassificationProblemData ProblemData {
+      get { return ProblemDataParameter.ActualValue; }
+    }
+    public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicDataAnalysisTreeInterpreter {
+      get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }
+    }
+    #endregion
     [StorableConstructor]
     private SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
@@ -50,5 +68,6 @@
 
     protected override ISymbolicClassificationSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {
-      throw new System.NotImplementedException();
+      var model = new SymbolicDiscriminantFunctionClassificationModel(bestTree, SymbolicDataAnalysisTreeInterpreter, ProblemData.ClassValues);
+      return new SymbolicDiscriminantFunctionClassificationSolution(model, ProblemData);
     }
   }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs	(revision 5649)
@@ -55,10 +55,6 @@
     #region IClassificationModel Members
 
-    public IEnumerable<double> GetEstimatedValues(IClassificationProblemData problemData, IEnumerable<int> rows) {
-      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, problemData.Dataset, rows);
-    }
-
-    public IEnumerable<double> GetEstimatedClassValues(IClassificationProblemData problemData, IEnumerable<int> rows) {
-      throw new NotImplementedException();
+    public IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows) {
+      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows);
     }
 
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs	(revision 5649)
@@ -0,0 +1,94 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Optimization;
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
+  /// <summary>
+  /// Represents a symbolic classification model
+  /// </summary>
+  [StorableClass]
+  [Item(Name = "SymbolicDiscriminantFunctionClassificationModel", Description = "Represents a symbolic classification model unsing a discriminant function.")]
+  public class SymbolicDiscriminantFunctionClassificationModel : SymbolicDataAnalysisModel, ISymbolicDiscriminantFunctionClassificationModel {
+    [Storable]
+    private double[] classValues;
+
+    [Storable]
+    private double[] thresholds;
+    public IEnumerable<double> Thresholds {
+      get { return (IEnumerable<double>)thresholds.Clone(); }
+      set {
+        thresholds = value.ToArray();
+        OnThresholdsChanged(EventArgs.Empty);
+      }
+    }
+
+    [StorableConstructor]
+    protected SymbolicDiscriminantFunctionClassificationModel(bool deserializing) : base(deserializing) { }
+    protected SymbolicDiscriminantFunctionClassificationModel(SymbolicDiscriminantFunctionClassificationModel original, Cloner cloner)
+      : base(original, cloner) {
+      classValues = (double[])original.classValues.Clone();
+      thresholds = (double[])original.thresholds.Clone();
+    }
+    public SymbolicDiscriminantFunctionClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, IEnumerable<double> classValues)
+      : base(tree, interpreter) {
+      this.classValues = classValues.ToArray();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDiscriminantFunctionClassificationModel(this, cloner);
+    }
+
+    public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) {
+      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows);
+    }
+
+    public IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows) {
+      foreach (var x in GetEstimatedValues(dataset, rows)) {
+        int classIndex = 0;
+        // find first threshold value which is smaller than x => class index = threshold index + 1
+        for (int i = 0; i < thresholds.Length; i++) {
+          if (x > thresholds[i]) classIndex++;
+          else break;
+        }
+        yield return classValues.ElementAt(classIndex);
+      }
+    }
+
+    #region events
+    public event EventHandler ThresholdsChanged;
+    protected virtual void OnThresholdsChanged(EventArgs e) {
+      var listener = ThresholdsChanged;
+      if (listener != null) listener(this, e);
+    }
+    #endregion
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolution.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationSolution.cs	(revision 5649)
@@ -0,0 +1,65 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Optimization;
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
+  /// <summary>
+  /// Represents a symbolic classification solution (model + data) and attributes of the solution like accuracy and complexity
+  /// </summary>
+  [StorableClass]
+  [Item(Name = "SymbolicDiscriminantFunctionClassificationSolution", Description = "Represents a symbolic classification solution (model + data) and attributes of the solution like accuracy and complexity.")]
+  public class SymbolicDiscriminantFunctionClassificationSolution : DiscriminantFunctionClassificationSolution, ISymbolicClassificationSolution {
+    #region ISymbolicClassificationSolution Members
+
+    public new ISymbolicClassificationModel Model {
+      get { return (ISymbolicClassificationModel)base.Model; }
+    }
+
+    ISymbolicDataAnalysisModel ISymbolicDataAnalysisSolution.Model {
+      get { return (ISymbolicDataAnalysisModel)base.Model; }
+    }
+
+    #endregion
+    [StorableConstructor]
+    protected SymbolicDiscriminantFunctionClassificationSolution(bool deserializing) : base(deserializing) { }
+    protected SymbolicDiscriminantFunctionClassificationSolution(SymbolicDiscriminantFunctionClassificationSolution original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public SymbolicDiscriminantFunctionClassificationSolution(IDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData)
+      : base(model, problemData) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicDiscriminantFunctionClassificationSolution(this, cloner);
+    }
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs	(revision 5649)
@@ -53,6 +53,6 @@
     }
 
-    public IEnumerable<double> GetEstimatedValues(IRegressionProblemData problemData, IEnumerable<int> rows) {
-      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, problemData.Dataset, rows);
+    public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) {
+      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows);
     }
   }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs	(revision 5649)
@@ -55,6 +55,6 @@
       get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
     }
-    public IValueLookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
-      get { return (IValueLookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
     }
     public IValueLookupParameter<T> ProblemDataParameter {
@@ -119,5 +119,5 @@
       : base() {
       Parameters.Add(new ValueLookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
-      Parameters.Add(new ValueLookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree."));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree."));
       Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic data analysis solution encoded as a symbolic expression tree."));
       Parameters.Add(new ValueLookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated."));
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisInterpreterOperator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisInterpreterOperator.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisInterpreterOperator.cs	(revision 5649)
@@ -24,5 +24,5 @@
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   public interface ISymbolicDataAnalysisInterpreterOperator : IOperator {
-    IValueLookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter { get; }
+    ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter { get; }
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs	(revision 5649)
@@ -31,4 +31,5 @@
 using HeuristicLab.Optimization;
 using System;
+using System.Drawing;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
@@ -38,4 +39,8 @@
   [StorableClass]
   public abstract class SymbolicDataAnalysisModel : NamedItem, ISymbolicDataAnalysisModel {
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
+    }
+
     #region properties
 
@@ -63,4 +68,6 @@
     public SymbolicDataAnalysisModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter)
       : base() {
+      this.name = ItemName;
+      this.description = ItemDescription;
       this.symbolicExpressionTree = tree;
       this.interpreter = interpreter;
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationModel.cs	(revision 5649)
@@ -0,0 +1,51 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+using System.Drawing;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents a general classification model.
+  /// </summary>
+  [StorableClass]
+  [Item("ClassificationModel", "Represents a general classification model.")]
+  public abstract class ClassificationModel : DataAnalysisModel, IClassificationModel {
+    [StorableConstructor]
+    protected ClassificationModel(bool deserializing) : base(deserializing) { }
+    protected ClassificationModel(ClassificationModel original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public ClassificationModel()
+      : base() {
+    }
+
+    public abstract IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows);
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblem.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblem.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblem.cs	(revision 5649)
@@ -26,5 +26,5 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   [StorableClass]
-  [Item("ClassificationProblem", "")]
+  [Item("ClassificationProblem", "A general classification problem.")]
   [Creatable("Problems")]
   public class ClassificationProblem : DataAnalysisProblem<IClassificationProblemData>, IClassificationProblem {
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblemData.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblemData.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationProblemData.cs	(revision 5649)
@@ -194,5 +194,5 @@
     #endregion
 
-    #region propeties
+    #region properties
     public string TargetVariable {
       get { return TargetVariableParameter.Value.Value; }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationSolution.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationSolution.cs	(revision 5649)
@@ -37,5 +37,6 @@
   [StorableClass]
   public abstract class ClassificationSolution : DataAnalysisSolution, IClassificationSolution {
-    private const string ThresholdsResultsName = "Thresholds";
+    private const string TrainingAccuracyResultName = "Accuracy (training)";
+    private const string TestAccuracyResultName = "Accuracy (test)";
     [StorableConstructor]
     protected ClassificationSolution(bool deserializing) : base(deserializing) { }
@@ -45,8 +46,14 @@
     public ClassificationSolution(IClassificationModel model, IClassificationProblemData problemData)
       : base(model, problemData) {
-      DoubleArray thresholds = new DoubleArray();
-      Add(new Result(ThresholdsResultsName, "The threshold values for class boundaries.", thresholds));
-      thresholds.Reset += new EventHandler(thresholds_Reset);
-      thresholds.ItemChanged += new EventHandler<EventArgs<int>>(thresholds_ItemChanged);
+      double[] estimatedTrainingClassValues = EstimatedTrainingClassValues.ToArray(); // cache values
+      IEnumerable<double> originalTrainingClassValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
+      double[] estimatedTestClassValues = EstimatedTestClassValues.ToArray(); // cache values
+      IEnumerable<double> originalTestClassValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
+
+      double trainingAccuracy = OnlineAccuracyEvaluator.Calculate(estimatedTrainingClassValues, originalTrainingClassValues);
+      double testAccuracy = OnlineAccuracyEvaluator.Calculate(estimatedTestClassValues, originalTestClassValues);
+
+      Add(new Result(TrainingAccuracyResultName, "Accuracy of the model on the training partition (percentage of correctly classified instances).", new PercentValue(trainingAccuracy)));
+      Add(new Result(TestAccuracyResultName, "Accuracy of the model on the test partition (percentage of correctly classified instances).", new PercentValue(testAccuracy)));
     }
 
@@ -61,33 +68,5 @@
     }
 
-    public virtual IEnumerable<double> EstimatedValues {
-      get {
-        return GetEstimatedValues(Enumerable.Range(0, ProblemData.Dataset.Rows));
-      }
-    }
-
-    public virtual IEnumerable<double> EstimatedTrainingValues {
-      get {
-        return GetEstimatedValues(ProblemData.TrainingIndizes);
-      }
-    }
-
-    public virtual IEnumerable<double> EstimatedTestValues {
-      get {
-        return GetEstimatedValues(ProblemData.TestIndizes);
-      }
-    }
-
-    public virtual IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) {
-      return Model.GetEstimatedValues(ProblemData, rows);
-    }
-
-    public IEnumerable<double> Thresholds {
-      get {
-        return (DoubleArray)this[ThresholdsResultsName].Value;
-      }
-    }
-
-    public IEnumerable<double> EstimatedClassValues {
+    public virtual IEnumerable<double> EstimatedClassValues {
       get {
         return GetEstimatedClassValues(Enumerable.Range(0, ProblemData.Dataset.Rows));
@@ -95,5 +74,5 @@
     }
 
-    public IEnumerable<double> EstimatedTrainingClassValues {
+    public virtual IEnumerable<double> EstimatedTrainingClassValues {
       get {
         return GetEstimatedClassValues(ProblemData.TrainingIndizes);
@@ -101,5 +80,5 @@
     }
 
-    public IEnumerable<double> EstimatedTestClassValues {
+    public virtual IEnumerable<double> EstimatedTestClassValues {
       get {
         return GetEstimatedClassValues(ProblemData.TestIndizes);
@@ -107,22 +86,6 @@
     }
 
-    public IEnumerable<double> GetEstimatedClassValues(IEnumerable<int> rows) {
-      return Model.GetEstimatedClassValues(ProblemData, rows);
-    }
-
-    #endregion
-    #region events
-    private void thresholds_ItemChanged(object sender, EventArgs<int> e) {
-      OnThresholdsChanged(EventArgs.Empty);
-    }
-
-    private void thresholds_Reset(object sender, EventArgs e) {
-      OnThresholdsChanged(EventArgs.Empty);
-    }
-
-    public event EventHandler ThresholdsChanged;
-    private void OnThresholdsChanged(EventArgs e) {
-      var listeners = ThresholdsChanged;
-      if (listeners != null) listeners(this, e);
+    public virtual IEnumerable<double> GetEstimatedClassValues(IEnumerable<int> rows) {
+      return Model.GetEstimatedClassValues(ProblemData.Dataset, rows);
     }
     #endregion
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringModel.cs	(revision 5649)
@@ -0,0 +1,51 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+using System.Drawing;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents a general clustering model.
+  /// </summary>
+  [StorableClass]
+  [Item("ClusteringModel", "Represents a general clustering model.")]
+  public abstract class ClusteringModel : DataAnalysisModel, IClusteringModel {
+    [StorableConstructor]
+    protected ClusteringModel(bool deserializing) : base(deserializing) { }
+    protected ClusteringModel(ClusteringModel original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public ClusteringModel()
+      : base() {
+    }
+
+    public abstract IEnumerable<double> GetClusterValues(Dataset dataset, IEnumerable<int> rows);
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringProblem.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringProblem.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringProblem.cs	(revision 5649)
@@ -0,0 +1,46 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [StorableClass]
+  [Item("ClusteringProblem", "A general clustering problem")]
+  [Creatable("Problems")]
+  public class ClusteringProblem : DataAnalysisProblem<IClusteringProblemData>, IClusteringProblem {
+    [StorableConstructor]
+    public ClusteringProblem(bool deserializing) : base(deserializing) { }
+    public ClusteringProblem(ClusteringProblem original, Cloner cloner) : base(original, cloner) { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new ClusteringProblem(this, cloner); }
+
+    public ClusteringProblem()
+      : base() {
+      ProblemData = new ClusteringProblemData();
+    }
+
+    public override void ImportProblemDataFromFile(string fileName) {
+      ClusteringProblemData problemData = ClusteringProblemData.ImportFromFile(fileName);
+      ProblemData = problemData;
+    }
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringProblemData.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringProblemData.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringProblemData.cs	(revision 5649)
@@ -0,0 +1,111 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  [StorableClass]
+  [Item("ClusteringProblemData", "Represents an item containing all data defining a clustering problem.")]
+  public sealed class ClusteringProblemData : DataAnalysisProblemData, IClusteringProblemData {
+
+    #region default data
+    private static double[,] kozaF1 = new double[,] {
+          {2.017885919,	-1.449165046},
+          {1.30060506,	-1.344523885},
+          {1.147134798,	-1.317989331},
+          {0.877182504,	-1.266142284},
+          {0.852562452,	-1.261020794},
+          {0.431095788,	-1.158793317},
+          {0.112586002,	-1.050908405},
+          {0.04594507,	-1.021989402},
+          {0.042572879,	-1.020438113},
+          {-0.074027291,	-0.959859562},
+          {-0.109178553,	-0.938094706},
+          {-0.259721109,	-0.803635355},
+          {-0.272991057,	-0.387519561},
+          {-0.161978191,	-0.193611001},
+          {-0.102489983,	-0.114215349},
+          {-0.01469968,	-0.014918985},
+          {-0.008863365,	-0.008942626},
+          {0.026751057,	0.026054094},
+          {0.166922436,	0.14309643},
+          {0.176953808,	0.1504144},
+          {0.190233418,	0.159916534},
+          {0.199800708,	0.166635331},
+          {0.261502822,	0.207600348},
+          {0.30182879,	0.232370249},
+          {0.83763905,	0.468046718}
+    };
+    private static Dataset defaultDataset;
+    private static IEnumerable<string> defaultAllowedInputVariables;
+
+    static ClusteringProblemData() {
+      defaultDataset = new Dataset(new string[] { "y", "x" }, kozaF1);
+      defaultDataset.Name = "Fourth-order Polynomial Function Benchmark Dataset";
+      defaultDataset.Description = "f(x) = x^4 + x^3 + x^2 + x^1";
+      defaultAllowedInputVariables = new List<string>() { "x", "y" };
+    }
+    #endregion
+
+    [StorableConstructor]
+    private ClusteringProblemData(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+    }
+
+
+    private ClusteringProblemData(ClusteringProblemData original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new ClusteringProblemData(this, cloner); }
+
+    public ClusteringProblemData()
+      : this(defaultDataset, defaultAllowedInputVariables) {
+    }
+
+    public ClusteringProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables)
+      : base(dataset, allowedInputVariables) {
+    }
+
+
+    #region Import from file
+    public static ClusteringProblemData ImportFromFile(string fileName) {
+      TableFileParser csvFileParser = new TableFileParser();
+      csvFileParser.Parse(fileName);
+
+      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
+      dataset.Name = Path.GetFileName(fileName);
+
+      ClusteringProblemData problemData = new ClusteringProblemData(dataset, dataset.VariableNames);
+      problemData.Name = "Data imported from " + Path.GetFileName(fileName);
+      return problemData;
+    }
+    #endregion
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringSolution.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClusteringSolution.cs	(revision 5649)
@@ -0,0 +1,82 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Optimization;
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Abstract base class for clustering data analysis solutions
+  /// </summary>
+  [StorableClass]
+  public abstract class ClusteringSolution : DataAnalysisSolution, IClusteringSolution {
+
+    [StorableConstructor]
+    protected ClusteringSolution(bool deserializing) : base(deserializing) { }
+    protected ClusteringSolution(ClusteringSolution original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public ClusteringSolution(IClusteringModel model, IClusteringProblemData problemData)
+      : base(model, problemData) {
+    }
+
+    #region IClusteringSolution Members
+
+    public new IClusteringModel Model {
+      get { return (IClusteringModel)base.Model; }
+    }
+
+    public new IClusteringProblemData ProblemData {
+      get { return (IClusteringProblemData)base.ProblemData; }
+    }
+
+    public virtual IEnumerable<int> ClusterValues {
+      get {
+        return GetClusterValues(Enumerable.Range(0, ProblemData.Dataset.Rows));
+      }
+    }
+
+    public virtual IEnumerable<int> TrainingClusterValues {
+      get {
+        return GetClusterValues(ProblemData.TrainingIndizes);
+      }
+    }
+
+    public virtual IEnumerable<int> TestClusterValues {
+      get {
+        return GetClusterValues(ProblemData.TestIndizes);
+      }
+    }
+
+    public virtual IEnumerable<int> GetClusterValues(IEnumerable<int> rows) {
+      return Model.GetClusterValues(ProblemData.Dataset, rows);
+    }
+    #endregion
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisModel.cs	(revision 5649)
@@ -0,0 +1,60 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Optimization;
+using System;
+using System.Drawing;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Abstract base class for data analysis models
+  /// </summary>
+  [StorableClass]
+  public abstract class DataAnalysisModel : NamedItem, IDataAnalysisModel {
+    private const string ModelResultName = "Model";
+    private const string ProblemDataResultName = "ProblemData";
+
+    public override Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
+    }
+
+    [StorableConstructor]
+    protected DataAnalysisModel(bool deserializing) : base(deserializing) { }
+    protected DataAnalysisModel(DataAnalysisModel original, Cloner cloner)
+      : base(original, cloner) {
+      name = original.Name;
+      description = original.Description;
+    }
+    public DataAnalysisModel()
+      : base() {
+      name = ItemName;
+      description = ItemDescription;
+    }
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblemData.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblemData.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisProblemData.cs	(revision 5649)
@@ -44,6 +44,6 @@
       get { return (IFixedValueParameter<Dataset>)Parameters[DatasetParameterName]; }
     }
-    public IFixedValueParameter<ICheckedItemCollection<StringValue>> InputVariablesParameter {
-      get { return (IFixedValueParameter<ICheckedItemCollection<StringValue>>)Parameters[InputVariablesParameterName]; }
+    public IFixedValueParameter<ICheckedItemList<StringValue>> InputVariablesParameter {
+      get { return (IFixedValueParameter<ICheckedItemList<StringValue>>)Parameters[InputVariablesParameterName]; }
     }
     public IFixedValueParameter<IntValue> TrainingPartitionStartParameter {
@@ -65,9 +65,9 @@
       get { return DatasetParameter.Value; }
     }
-    public ICheckedItemCollection<StringValue> InputVariables {
+    public ICheckedItemList<StringValue> InputVariables {
       get { return InputVariablesParameter.Value; }
     }
     public IEnumerable<string> AllowedInputVariables {
-      get { return InputVariables.CheckedItems.Select(x => x.Value); }
+      get { return InputVariables.CheckedItems.Select(x => x.Value.Value); }
     }
 
@@ -110,5 +110,5 @@
         throw new ArgumentException("All allowed input variables must be present in the dataset.");
 
-      var inputVariables = new CheckedItemCollection<StringValue>(dataset.VariableNames.Select(x => new StringValue(x)));
+      var inputVariables = new CheckedItemList<StringValue>(dataset.VariableNames.Select(x => new StringValue(x)));
       foreach (StringValue x in inputVariables)
         inputVariables.SetItemCheckedState(x, allowedInputVariables.Contains(x.Value));
@@ -120,5 +120,5 @@
 
       Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", dataset));
-      Parameters.Add(new FixedValueParameter<ICheckedItemCollection<StringValue>>(InputVariablesParameterName, "", inputVariables.AsReadOnly()));
+      Parameters.Add(new FixedValueParameter<ICheckedItemList<StringValue>>(InputVariablesParameterName, "", inputVariables.AsReadOnly()));
       Parameters.Add(new FixedValueParameter<IntValue>(TrainingPartitionStartParameterName, "", new IntValue(trainingPartitionStart)));
       Parameters.Add(new FixedValueParameter<IntValue>(TrainingPartitionEndParameterName, "", new IntValue(trainingPartitionEnd)));
@@ -132,5 +132,5 @@
     private void RegisterEventHandlers() {
       DatasetParameter.ValueChanged += new EventHandler(Parameter_ValueChanged);
-      InputVariables.CheckedItemsChanged += new CollectionItemsChangedEventHandler<StringValue>(InputVariables_CheckedItemsChanged);
+      InputVariables.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IndexedItem<StringValue>>(InputVariables_CheckedItemsChanged);
       TrainingPartitionStart.ValueChanged += new EventHandler(Parameter_ValueChanged);
       TrainingPartitionEnd.ValueChanged += new EventHandler(Parameter_ValueChanged);
@@ -139,7 +139,8 @@
     }
 
-    private void InputVariables_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<StringValue> e) {
+    private void InputVariables_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IndexedItem<StringValue>> e) {
       OnChanged();
     }
+
     private void Parameter_ValueChanged(object sender, EventArgs e) {
       OnChanged();
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisSolution.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisSolution.cs	(revision 5649)
@@ -82,6 +82,6 @@
     public DataAnalysisSolution(IDataAnalysisModel model, IDataAnalysisProblemData problemData)
       : base() {
-      name = string.Empty;
-      description = string.Empty;
+      name = ItemName;
+      description = ItemDescription;
       Add(new Result(ModelResultName, "The symbolic data analysis model.", model));
       Add(new Result(ProblemDataResultName, "The symbolic data analysis problem data.", problemData));
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DiscriminantFunctionClassificationModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DiscriminantFunctionClassificationModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DiscriminantFunctionClassificationModel.cs	(revision 5649)
@@ -0,0 +1,99 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Optimization;
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents discriminant function classification data analysis models.
+  /// </summary>
+  [StorableClass]
+  [Item("DiscriminantFunctionClassificationModel", "Represents a classification model that uses a discriminant function and classification thresholds.")]
+  public class DiscriminantFunctionClassificationModel : NamedItem, IDiscriminantFunctionClassificationModel {
+    [Storable]
+    private IRegressionModel model;
+    [Storable]
+    private double[] classValues;
+
+    [StorableConstructor]
+    protected DiscriminantFunctionClassificationModel() : base() { }
+    protected DiscriminantFunctionClassificationModel(DiscriminantFunctionClassificationModel original, Cloner cloner)
+      : base(original, cloner) {
+      model = cloner.Clone(original.model);
+      classValues = (double[])original.classValues.Clone();
+    }
+    public DiscriminantFunctionClassificationModel(IRegressionModel model, IEnumerable<double> classValues)
+      : base() {
+      this.name = ItemName;
+      this.description = ItemDescription;
+      this.model = model;
+      this.classValues = classValues.ToArray();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DiscriminantFunctionClassificationModel(this, cloner);
+    }
+
+    #region IDiscriminantFunctionClassificationModel Members
+
+    private double[] thresholds;
+    public IEnumerable<double> Thresholds {
+      get { return (IEnumerable<double>)thresholds.Clone(); }
+      set {
+        thresholds = value.ToArray();
+        OnThresholdsChanged(EventArgs.Empty);
+      }
+    }
+
+    public event EventHandler ThresholdsChanged;
+    protected virtual void OnThresholdsChanged(EventArgs e) {
+      var listener = ThresholdsChanged;
+      if (listener != null) listener(this, e);
+    }
+
+    public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) {
+      return model.GetEstimatedValues(dataset, rows);
+    }
+
+    public IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows) {
+      foreach (var x in GetEstimatedValues(dataset, rows)) {
+        int classIndex = 0;
+        // find first threshold value which is smaller than x => class index = threshold index + 1
+        for (int i = 0; i < thresholds.Length; i++) {
+          if (x > thresholds[i]) classIndex++;
+          else break;
+        }
+        yield return classValues.ElementAt(classIndex);
+      }
+    }
+
+    #endregion
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DiscriminantFunctionClassificationSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DiscriminantFunctionClassificationSolution.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DiscriminantFunctionClassificationSolution.cs	(revision 5649)
@@ -0,0 +1,91 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Optimization;
+using System;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents a classification solution that uses a discriminant function and classification thresholds.
+  /// </summary>
+  [StorableClass]
+  [Item("DiscriminantFunctionClassificationSolution", "Represents a classification solution that uses a discriminant function and classification thresholds.")]
+  public class DiscriminantFunctionClassificationSolution : ClassificationSolution, IDiscriminantFunctionClassificationSolution {
+    [StorableConstructor]
+    protected DiscriminantFunctionClassificationSolution(bool deserializing) : base(deserializing) { }
+    protected DiscriminantFunctionClassificationSolution(DiscriminantFunctionClassificationSolution original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public DiscriminantFunctionClassificationSolution(IRegressionModel model, IClassificationProblemData problemData)
+      : this(new DiscriminantFunctionClassificationModel(model, problemData.ClassValues), problemData) {
+    }
+    public DiscriminantFunctionClassificationSolution(IDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData)
+      : base(model, problemData) {
+      Model.ThresholdsChanged += new EventHandler(Model_ThresholdsChanged);
+    }
+
+    #region IDiscriminantFunctionClassificationSolution Members
+
+    public new IDiscriminantFunctionClassificationModel Model {
+      get { return (IDiscriminantFunctionClassificationModel)base.Model; }
+    }
+
+    public IEnumerable<double> EstimatedValues {
+      get { return GetEstimatedValues(Enumerable.Range(0, ProblemData.Dataset.Rows)); }
+    }
+
+    public IEnumerable<double> EstimatedTrainingValues {
+      get { return GetEstimatedValues(ProblemData.TrainingIndizes); }
+    }
+
+    public IEnumerable<double> EstimatedTestValues {
+      get { return GetEstimatedValues(ProblemData.TestIndizes); }
+    }
+
+    public IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) {
+      return Model.GetEstimatedValues(ProblemData.Dataset, rows);
+    }
+
+    public IEnumerable<double> Thresholds {
+      get { return Model.Thresholds; }
+    }
+
+    public event EventHandler ThresholdsChanged;
+
+    private void Model_ThresholdsChanged(object sender, EventArgs e) {
+      OnThresholdsChanged(e);
+    }
+
+    protected virtual void OnThresholdsChanged(EventArgs e) {
+      var listener = ThresholdsChanged;
+      if (listener != null) listener(this, e);
+    }
+    #endregion
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 5649)
@@ -111,5 +111,17 @@
     <Compile Include="ClassificationProblem.cs" />
     <Compile Include="ClassificationSolution.cs" />
+    <Compile Include="ClusteringProblem.cs" />
+    <Compile Include="ClusteringProblemData.cs" />
+    <Compile Include="ClusteringSolution.cs" />
+    <Compile Include="DiscriminantFunctionClassificationModel.cs" />
+    <Compile Include="DiscriminantFunctionClassificationSolution.cs" />
     <Compile Include="DataAnalysisSolution.cs" />
+    <Compile Include="Interfaces\Classification\IDiscriminantFunctionClassificationModel.cs" />
+    <Compile Include="Interfaces\Classification\IDiscriminantFunctionClassificationSolution.cs" />
+    <Compile Include="Interfaces\Clustering\IClusteringModel.cs" />
+    <Compile Include="Interfaces\Clustering\IClusteringProblem.cs" />
+    <Compile Include="Interfaces\Clustering\IClusteringProblemData.cs" />
+    <Compile Include="Interfaces\Clustering\IClusteringSolution.cs" />
+    <Compile Include="OnlineEvaluators\OnlineAccuracyEvaluator.cs" />
     <Compile Include="RegressionProblemData.cs" />
     <Compile Include="DataAnalysisProblemData.cs" />
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationModel.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationModel.cs	(revision 5649)
@@ -23,6 +23,5 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IClassificationModel : IDataAnalysisModel {
-    IEnumerable<double> GetEstimatedValues(IClassificationProblemData problemData, IEnumerable<int> rows);
-    IEnumerable<double> GetEstimatedClassValues(IClassificationProblemData problemData, IEnumerable<int> rows);
+    IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows);
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationSolution.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationSolution.cs	(revision 5649)
@@ -27,16 +27,8 @@
     new IClassificationProblemData ProblemData { get; }
 
-    IEnumerable<double> EstimatedValues { get; }
-    IEnumerable<double> EstimatedTrainingValues { get; }
-    IEnumerable<double> EstimatedTestValues { get; }
-    IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows);
-
-    IEnumerable<double> Thresholds { get; }
     IEnumerable<double> EstimatedClassValues { get; }
     IEnumerable<double> EstimatedTrainingClassValues { get; }
     IEnumerable<double> EstimatedTestClassValues { get; }
     IEnumerable<double> GetEstimatedClassValues(IEnumerable<int> rows);
-
-    event EventHandler ThresholdsChanged;
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationModel.cs	(revision 5649)
@@ -0,0 +1,30 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+using System;
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDiscriminantFunctionClassificationModel : IClassificationModel {
+    IEnumerable<double> Thresholds { get; }
+    event EventHandler ThresholdsChanged;
+    IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows);
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationSolution.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationSolution.cs	(revision 5649)
@@ -0,0 +1,37 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 System.Collections.Generic;
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDiscriminantFunctionClassificationSolution : IClassificationSolution {
+    new IDiscriminantFunctionClassificationModel Model { get; }
+
+    IEnumerable<double> EstimatedValues { get; }
+    IEnumerable<double> EstimatedTrainingValues { get; }
+    IEnumerable<double> EstimatedTestValues { get; }
+    IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows);
+
+    IEnumerable<double> Thresholds { get; }
+
+    event EventHandler ThresholdsChanged;
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringModel.cs	(revision 5649)
@@ -0,0 +1,27 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IClusteringModel : IDataAnalysisModel {
+    IEnumerable<int> GetClusterValues(Dataset dataset, IEnumerable<int> rows);
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringProblem.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringProblem.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringProblem.cs	(revision 5649)
@@ -0,0 +1,25 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IClusteringProblem : IDataAnalysisProblem<IClusteringProblemData> {
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringProblemData.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringProblemData.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringProblemData.cs	(revision 5649)
@@ -0,0 +1,25 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IClusteringProblemData : IDataAnalysisProblemData {
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringSolution.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringSolution.cs	(revision 5649)
@@ -0,0 +1,33 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Collections.Generic;
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IClusteringSolution : IDataAnalysisSolution {
+    new IClusteringModel Model { get; }
+    new IClusteringProblemData ProblemData { get; }
+
+    IEnumerable<int> ClusterValues { get; }
+    IEnumerable<int> TrainingClusterValues { get; }
+    IEnumerable<int> TestClusterValues { get; }
+    IEnumerable<int> GetClusterValues(IEnumerable<int> rows);
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs	(revision 5649)
@@ -28,5 +28,5 @@
   public interface IDataAnalysisProblemData : IParameterizedNamedItem {
     Dataset Dataset { get; }
-    ICheckedItemCollection<StringValue> InputVariables { get; }
+    ICheckedItemList<StringValue> InputVariables { get; }
     IEnumerable<string> AllowedInputVariables { get; }
 
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs	(revision 5649)
@@ -23,5 +23,5 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   public interface IRegressionModel : IDataAnalysisModel {
-    IEnumerable<double> GetEstimatedValues(IRegressionProblemData problemData, IEnumerable<int> rows);
+    IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows);
   }
 }
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineAccuracyEvaluator.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineAccuracyEvaluator.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/OnlineEvaluators/OnlineAccuracyEvaluator.cs	(revision 5649)
@@ -0,0 +1,84 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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.Common;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class OnlineAccuracyEvaluator : IOnlineEvaluator {
+
+    private int correctlyClassified;
+    private int n;
+    public double Accuracy {
+      get {
+        if (n < 1)
+          throw new InvalidOperationException("No elements");
+        else
+          return correctlyClassified / n;
+      }
+    }
+
+    public OnlineAccuracyEvaluator() {
+      Reset();
+    }
+
+    #region IOnlineEvaluator Members
+    public double Value {
+      get { return Accuracy; }
+    }
+    public void Reset() {
+      n = 0;
+      correctlyClassified = 0;
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original)) {
+        throw new ArgumentException("Accuracy is not defined for NaN or infinity elements");
+      } else {
+        if (original.IsAlmost(estimated)) correctlyClassified++;
+        n++;
+      }
+    }
+    #endregion
+
+    public static double Calculate(IEnumerable<double> first, IEnumerable<double> second) {
+      IEnumerator<double> firstEnumerator = first.GetEnumerator();
+      IEnumerator<double> secondEnumerator = second.GetEnumerator();
+      OnlineAccuracyEvaluator accuracyEvaluator = new OnlineAccuracyEvaluator();
+
+      // always move forward both enumerators (do not use short-circuit evaluation!)
+      while (firstEnumerator.MoveNext() & secondEnumerator.MoveNext()) {
+        double estimated = secondEnumerator.Current;
+        double original = firstEnumerator.Current;
+        accuracyEvaluator.Add(original, estimated);
+      }
+
+      // check if both enumerators are at the end to make sure both enumerations have the same length
+      if (secondEnumerator.MoveNext() || firstEnumerator.MoveNext()) {
+        throw new ArgumentException("Number of elements in first and second enumeration doesn't match.");
+      } else {
+        return accuracyEvaluator.Accuracy;
+      }
+    }
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionModel.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionModel.cs	(revision 5649)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionModel.cs	(revision 5649)
@@ -0,0 +1,51 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 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 System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+using System.Drawing;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents a general regression model.
+  /// </summary>
+  [StorableClass]
+  [Item("RegressionModel", "Represents a general regression model.")]
+  public abstract class RegressionModel : DataAnalysisModel, IRegressionModel {
+    [StorableConstructor]
+    protected RegressionModel(bool deserializing) : base(deserializing) { }
+    protected RegressionModel(RegressionModel original, Cloner cloner)
+      : base(original, cloner) {
+    }
+    public RegressionModel()
+      : base() {
+    }
+
+    public abstract IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows);
+  }
+}
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionProblem.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionProblem.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionProblem.cs	(revision 5649)
@@ -26,5 +26,5 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   [StorableClass]
-  [Item("RegressionProblem", "")]
+  [Item("RegressionProblem", "A general regression problem")]
   [Creatable("Problems")]
   public class RegressionProblem : DataAnalysisProblem<IRegressionProblemData>, IRegressionProblem {
Index: /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionSolution.cs
===================================================================
--- /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionSolution.cs	(revision 5648)
+++ /branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionSolution.cs	(revision 5649)
@@ -37,4 +37,11 @@
   [StorableClass]
   public abstract class RegressionSolution : DataAnalysisSolution, IRegressionSolution {
+    private const string TrainingMeanSquaredErrorResultName = "Mean squared error (training)";
+    private const string TestMeanSquaredErrorResultName = "Mean squared error (test)";
+    private const string TrainingSquaredCorrelationResultName = "Pearson's R² (training)";
+    private const string TestSquaredCorrelationResultName = "Pearson's R² (test)";
+    private const string TrainingRelativeErrorResultName = "Average relative error (training)";
+    private const string TestRelativeErrorResultName = "Average relative error (test)";
+
     [StorableConstructor]
     protected RegressionSolution(bool deserializing) : base(deserializing) { }
@@ -44,6 +51,32 @@
     public RegressionSolution(IRegressionModel model, IRegressionProblemData problemData)
       : base(model, problemData) {
+      double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values
+      IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
+      double[] estimatedTestValues = EstimatedTestValues.ToArray(); // cache values
+      IEnumerable<double> originalTestValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
+
+      double trainingMSE = OnlineMeanSquaredErrorEvaluator.Calculate(estimatedTrainingValues, originalTrainingValues);
+      double testMSE = OnlineMeanSquaredErrorEvaluator.Calculate(estimatedTestValues, originalTestValues);
+      double trainingR2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedTrainingValues, originalTrainingValues);
+      double testR2 = OnlinePearsonsRSquaredEvaluator.Calculate(estimatedTestValues, originalTestValues);
+      double trainingRelError = OnlineMeanAbsolutePercentageErrorEvaluator.Calculate(estimatedTrainingValues, originalTrainingValues);
+      double testRelError = OnlineMeanAbsolutePercentageErrorEvaluator.Calculate(estimatedTestValues, originalTestValues);
+
+      Add(new Result(TrainingMeanSquaredErrorResultName, "Mean of squared errors of the model on the training partition", new DoubleValue(trainingMSE)));
+      Add(new Result(TestMeanSquaredErrorResultName, "Mean of squared errors of the model on the test partition", new DoubleValue(testMSE)));
+      Add(new Result(TrainingSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the training partition", new DoubleValue(trainingR2)));
+      Add(new Result(TestSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the test partition", new DoubleValue(testR2)));
+      Add(new Result(TrainingRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the training partition", new PercentValue(trainingRelError)));
+      Add(new Result(TestRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the test partition", new PercentValue(testRelError)));
     }
 
+    protected override void OnProblemDataChanged(EventArgs e) {
+      base.OnProblemDataChanged(e);
+      throw new NotImplementedException(); // need to recalculate results
+    }
+    protected override void OnModelChanged(EventArgs e) {
+      base.OnModelChanged(e);
+      throw new NotImplementedException(); // need to recalculate results
+    }
     #region IRegressionSolution Members
 
@@ -75,7 +108,6 @@
 
     public virtual IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) {
-      return Model.GetEstimatedValues(ProblemData, rows);
+      return Model.GetEstimatedValues(ProblemData.Dataset, rows);
     }
-
     #endregion
   }
