Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.3/SupportVectorMachine.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.3/SupportVectorMachine.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.3/SupportVectorMachine.cs	(revision 3884)
@@ -168,4 +168,10 @@
     }
 
+    protected override void Problem_Reset(object sender, EventArgs e) {
+      TrainingSamplesStartParameter.ActualValue = Problem.DataAnalysisProblemData.TrainingSamplesStart;
+      TrainingSamplesEndParameter.ActualValue = Problem.DataAnalysisProblemData.TrainingSamplesEnd;
+      base.Problem_Reset(sender, e);
+    }
+
     #region Events
     protected override void OnProblemChanged() {
@@ -175,4 +181,5 @@
       TrainingSamplesStartParameter.ActualValue = Problem.DataAnalysisProblemData.TrainingSamplesStart;
       TrainingSamplesEndParameter.ActualValue = Problem.DataAnalysisProblemData.TrainingSamplesEnd;
+      Problem.Reset += new EventHandler(Problem_Reset);
       base.OnProblemChanged();
     }
@@ -210,4 +217,5 @@
         evaluator.DataAnalysisProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
         analyzer.ProblemDataParameter.ActualName = Problem.DataAnalysisProblemDataParameter.Name;
+        Problem.Reset += new EventHandler(Problem_Reset);
       }
     }
Index: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Model.cs
===================================================================
--- trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Model.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Model.cs	(revision 3884)
@@ -217,4 +217,5 @@
       model.ClassLabels = null;
       model.NumberOfSVPerClass = null;
+      model.SupportVectorIndizes = new int[0];
 
       bool headerFinished = false;
Index: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/ParameterSelection.cs
===================================================================
--- trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/ParameterSelection.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/ParameterSelection.cs	(revision 3884)
@@ -150,5 +150,5 @@
                     parameters.C = CValues[i];
                     parameters.Gamma = GammaValues[j];
-                    double test = Training.PerformCrossValidation(problem, parameters, nrfold);
+                    double test = Training.PerformCrossValidation(problem, parameters, nrfold, true);
                     Console.Write("{0} {1} {2}", parameters.C, parameters.Gamma, test);
                     if(output != null)
Index: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Solver.cs
===================================================================
--- trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Solver.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Solver.cs	(revision 3884)
@@ -1555,5 +1555,5 @@
             Parameter newparam = (Parameter)param.Clone();
             newparam.Probability = false;
-            svm_cross_validation(prob, newparam, nr_fold, ymv);
+            svm_cross_validation(prob, newparam, nr_fold, ymv, true);
             for (i = 0; i < prob.Count; i++)
             {
@@ -1872,5 +1872,5 @@
 
         // Stratified cross validation
-        public static void svm_cross_validation(Problem prob, Parameter param, int nr_fold, double[] target)
+        public static void svm_cross_validation(Problem prob, Parameter param, int nr_fold, double[] target, bool shuffleTraining)
         {
             Random rand = new Random();
@@ -1936,8 +1936,9 @@
             {
                 for (i = 0; i < l; i++) perm[i] = i;
-                for (i = 0; i < l; i++)
-                {
+                if (shuffleTraining) {
+                  for (i = 0; i < l; i++) {
                     int j = i + (int)(rand.NextDouble() * (l - i));
                     do { int _ = perm[i]; perm[i] = perm[j]; perm[j] = _; } while (false);
+                  }
                 }
                 for (i = 0; i <= nr_fold; i++)
Index: trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Training.cs
===================================================================
--- trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Training.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.LibSVM/1.6.3/LibSVM-1.6.3/Training.cs	(revision 3884)
@@ -43,9 +43,9 @@
         }
 
-        private static double doCrossValidation(Problem problem, Parameter parameters, int nr_fold)
+        private static double doCrossValidation(Problem problem, Parameter parameters, int nr_fold, bool shuffleTraining)
         {
             int i;
             double[] target = new double[problem.Count];
-            Procedures.svm_cross_validation(problem, parameters, nr_fold, target);
+            Procedures.svm_cross_validation(problem, parameters, nr_fold, target, shuffleTraining);
             int total_correct = 0;
             double total_error = 0;
@@ -87,5 +87,5 @@
             parseCommandLine(args, out parameters, out problem, out crossValidation, out nrfold, out modelFilename);
             if (crossValidation)
-                PerformCrossValidation(problem, parameters, nrfold);
+                PerformCrossValidation(problem, parameters, nrfold, true);
             else Model.Write(modelFilename, Train(problem, parameters));
         }
@@ -98,9 +98,9 @@
         /// <param name="nrfold">The number of cross validations to use</param>
         /// <returns>The cross validation score</returns>
-        public static double PerformCrossValidation(Problem problem, Parameter parameters, int nrfold)
+        public static double PerformCrossValidation(Problem problem, Parameter parameters, int nrfold, bool shuffleTraining)
         {
             string error = Procedures.svm_check_parameter(problem, parameters);
             if (error == null)
-                return doCrossValidation(problem, parameters, nrfold);
+                return doCrossValidation(problem, parameters, nrfold, shuffleTraining);
             else throw new Exception(error);
         }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/BestSupportVectorRegressionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/BestSupportVectorRegressionSolutionAnalyzer.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/BestSupportVectorRegressionSolutionAnalyzer.cs	(revision 3884)
@@ -169,9 +169,4 @@
       return base.Apply();
     }
-
-    private IEnumerable<string> GetInputVariables(SymbolicExpressionTree tree) {
-      return (from varNode in tree.IterateNodesPrefix().OfType<VariableTreeNode>()
-              select varNode.VariableName).Distinct();
-    }
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/SupportVectorRegression/SupportVectorRegressionSolution.cs	(revision 3884)
@@ -39,12 +39,17 @@
   [StorableClass]
   public sealed class SupportVectorRegressionSolution : DataAnalysisSolution {
+    public SupportVectorRegressionSolution() : base() { }
+    public SupportVectorRegressionSolution(DataAnalysisProblemData problemData, SupportVectorMachineModel model, IEnumerable<string> inputVariables, double lowerEstimationLimit, double upperEstimationLimit)
+      : base(problemData, lowerEstimationLimit, upperEstimationLimit) {
+      this.Model = model;
+    }
+
     public override Image ItemImage {
       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; }
     }
 
-    [Storable]
-    private SupportVectorMachineModel model;
-    public SupportVectorMachineModel Model {
-      get { return model; }
+    public new SupportVectorMachineModel Model {
+      get { return (SupportVectorMachineModel)base.Model; }
+      set { base.Model = value; }
     }
 
@@ -53,36 +58,30 @@
     }
 
-    public SupportVectorRegressionSolution() : base() { }
-    public SupportVectorRegressionSolution(DataAnalysisProblemData problemData, SupportVectorMachineModel model, IEnumerable<string> inputVariables, double lowerEstimationLimit, double upperEstimationLimit)
-      : base(problemData, lowerEstimationLimit, upperEstimationLimit) {
-      this.model = model;
-    }
-
-    protected override void OnProblemDataChanged(EventArgs e) {
-      RecalculateEstimatedValues();
-      model.Model.SupportVectorIndizes = new int[0];
+    protected override void OnProblemDataChanged() {
+      Model.Model.SupportVectorIndizes = new int[0];
+      base.OnProblemDataChanged();
     }
 
     private Dataset CalculateSupportVectors() {
-      if (model.Model.SupportVectorIndizes.Length == 0)
+      if (Model.Model.SupportVectorIndizes.Length == 0)
         return new Dataset();
 
-      Dataset dataset = new Dataset(ProblemData.Dataset.VariableNames, new double[model.Model.SupportVectorCount, ProblemData.Dataset.Columns]);
-      for (int i = 0; i < model.Model.SupportVectorIndizes.Length; i++) {
+      Dataset dataset = new Dataset(ProblemData.Dataset.VariableNames, new double[Model.Model.SupportVectorCount, ProblemData.Dataset.Columns]);
+      for (int i = 0; i < Model.Model.SupportVectorIndizes.Length; i++) {
         for (int column = 0; column < ProblemData.Dataset.Columns; column++)
-          dataset[i, column] = ProblemData.Dataset[model.Model.SupportVectorIndizes[i], column];
+          dataset[i, column] = ProblemData.Dataset[Model.Model.SupportVectorIndizes[i], column];
       }
       return dataset;
     }
 
-    private void RecalculateEstimatedValues() {
+    protected override void RecalculateEstimatedValues() {
       SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(ProblemData, 0, ProblemData.Dataset.Rows);
-      SVM.Problem scaledProblem = Scaling.Scale(model.RangeTransform, problem);
+      SVM.Problem scaledProblem = Scaling.Scale(Model.RangeTransform, problem);
 
       estimatedValues = (from row in Enumerable.Range(0, scaledProblem.Count)
-                         let prediction = SVM.Prediction.Predict(model.Model, scaledProblem.X[row])
+                         let prediction = SVM.Prediction.Predict(Model.Model, scaledProblem.X[row])
                          let boundedX = Math.Min(UpperEstimationLimit, Math.Max(LowerEstimationLimit, prediction))
                          select double.IsNaN(boundedX) ? UpperEstimationLimit : boundedX).ToList();
-      OnEstimatedValuesChanged(EventArgs.Empty);
+      OnEstimatedValuesChanged();
     }
 
@@ -112,10 +111,4 @@
       }
     }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      SupportVectorRegressionSolution clone = (SupportVectorRegressionSolution)base.Clone(cloner);
-      clone.model = (SupportVectorMachineModel)cloner.Clone(model);
-      return clone;
-    }
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs	(revision 3884)
@@ -39,5 +39,17 @@
   [StorableClass]
   [Item("SymbolicRegressionModel", "A symbolic regression model represents an entity that provides estimated values based on input values.")]
-  public class SymbolicRegressionModel : Item {
+  public class SymbolicRegressionModel : NamedItem, IDataAnalysisModel {
+    private SymbolicRegressionModel() : base() { } // for cloning
+    [StorableConstructor]
+    protected SymbolicRegressionModel(bool deserializing)
+      : base(deserializing) {
+    }
+    public SymbolicRegressionModel(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree, IEnumerable<string> inputVariables)
+      : base() {
+      this.tree = tree;
+      this.interpreter = interpreter;
+      this.inputVariables = inputVariables.ToList();
+    }
+
     [Storable]
     private SymbolicExpressionTree tree;
@@ -50,6 +62,6 @@
       get { return interpreter; }
     }
+    [Storable]
     private List<string> inputVariables;
-    [Storable]
     public IEnumerable<string> InputVariables {
       get { return inputVariables.AsEnumerable(); }
@@ -59,15 +71,7 @@
       }
     }
-    public SymbolicRegressionModel() : base() { } // for cloning
 
-    public SymbolicRegressionModel(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree, IEnumerable<string> inputVariables)
-      : base() {
-      this.tree = tree;
-      this.interpreter = interpreter;
-      this.inputVariables = inputVariables.ToList();
-    }
-
-    public IEnumerable<double> GetEstimatedValues(Dataset dataset, int start, int end) {
-      return interpreter.GetSymbolicExpressionTreeValues(tree, dataset, Enumerable.Range(start, end - start));
+    public IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end) {
+      return interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, Enumerable.Range(start, end - start));
     }
 
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs	(revision 3884)
@@ -37,43 +37,24 @@
   [StorableClass]
   public sealed class SymbolicRegressionSolution : DataAnalysisSolution {
+    public SymbolicRegressionSolution() : base() { }
+    public SymbolicRegressionSolution(DataAnalysisProblemData problemData, SymbolicRegressionModel model, double lowerEstimationLimit, double upperEstimationLimit)
+      : base(problemData, lowerEstimationLimit, upperEstimationLimit) {
+      this.Model = model;
+    }
+
     public override Image ItemImage {
       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Function; }
     }
-    [Storable]
-    private SymbolicRegressionModel model;
-    public SymbolicRegressionModel Model {
-      get { return model; }
-      set {
-        if (model != value) {
-          if (value == null) throw new ArgumentNullException();
-          model = value;
-          OnModelChanged(EventArgs.Empty);
-        }
-      }
+
+    public new SymbolicRegressionModel Model {
+      get { return (SymbolicRegressionModel)base.Model; }
+      set { base.Model = value; }
     }
 
-    public SymbolicRegressionSolution() : base() { }
-    public SymbolicRegressionSolution(DataAnalysisProblemData problemData, SymbolicRegressionModel model, double lowerEstimationLimit, double upperEstimationLimit)
-      : base(problemData, lowerEstimationLimit, upperEstimationLimit) {
-      this.model = model;
-    }
-
-    public event EventHandler ModelChanged;
-    private void OnModelChanged(EventArgs e) {
-      RecalculateEstimatedValues();
-      var listeners = ModelChanged;
-      if (listeners != null)
-        listeners(this, e);
-    }
-
-    protected override void OnProblemDataChanged(EventArgs e) {
-      RecalculateEstimatedValues();
-    }
-
-    private void RecalculateEstimatedValues() {
-      estimatedValues = (from x in model.GetEstimatedValues(ProblemData.Dataset, 0, ProblemData.Dataset.Rows)
+    protected override void RecalculateEstimatedValues() {
+      estimatedValues = (from x in Model.GetEstimatedValues(ProblemData, 0, ProblemData.Dataset.Rows)
                          let boundedX = Math.Min(UpperEstimationLimit, Math.Max(LowerEstimationLimit, x))
                          select double.IsNaN(boundedX) ? UpperEstimationLimit : boundedX).ToList();
-      OnEstimatedValuesChanged(EventArgs.Empty);
+      OnEstimatedValuesChanged();
     }
 
@@ -103,10 +84,4 @@
       }
     }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      SymbolicRegressionSolution clone = (SymbolicRegressionSolution)base.Clone(cloner);
-      clone.model = (SymbolicRegressionModel)cloner.Clone(model);
-      return clone;
-    }
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs	(revision 3884)
@@ -39,7 +39,5 @@
     public new DataAnalysisProblemData Content {
       get { return (DataAnalysisProblemData)base.Content; }
-      set {
-        base.Content = value;
-      }
+      set { base.Content = value; }
     }
 
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.Designer.cs	(revision 3884)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.Designer.cs	(revision 3884)
@@ -0,0 +1,154 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Views {
+  partial class DataAnalysisSolutionView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.dataTabPage = new System.Windows.Forms.TabPage();
+      this.modelTabPage = new System.Windows.Forms.TabPage();
+      this.tabControl = new System.Windows.Forms.TabControl();
+      this.modelViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.viewHost1 = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.dataViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.dataTabPage.SuspendLayout();
+      this.modelTabPage.SuspendLayout();
+      this.tabControl.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // dataTabPage
+      // 
+      this.dataTabPage.Controls.Add(this.dataViewHost);
+      this.dataTabPage.Location = new System.Drawing.Point(4, 22);
+      this.dataTabPage.Name = "dataTabPage";
+      this.dataTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.dataTabPage.Size = new System.Drawing.Size(372, 236);
+      this.dataTabPage.TabIndex = 1;
+      this.dataTabPage.Text = "Data";
+      this.dataTabPage.UseVisualStyleBackColor = true;
+      // 
+      // modelTabPage
+      // 
+      this.modelTabPage.Controls.Add(this.modelViewHost);
+      this.modelTabPage.Location = new System.Drawing.Point(4, 22);
+      this.modelTabPage.Name = "modelTabPage";
+      this.modelTabPage.Padding = new System.Windows.Forms.Padding(3);
+      this.modelTabPage.Size = new System.Drawing.Size(372, 236);
+      this.modelTabPage.TabIndex = 0;
+      this.modelTabPage.Text = "Model";
+      this.modelTabPage.UseVisualStyleBackColor = true;
+      // 
+      // tabControl
+      // 
+      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.tabControl.Controls.Add(this.modelTabPage);
+      this.tabControl.Controls.Add(this.dataTabPage);
+      this.tabControl.Location = new System.Drawing.Point(3, 3);
+      this.tabControl.Name = "tabControl";
+      this.tabControl.SelectedIndex = 0;
+      this.tabControl.Size = new System.Drawing.Size(380, 262);
+      this.tabControl.TabIndex = 1;
+      // 
+      // modelViewHost
+      // 
+      this.modelViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.modelViewHost.Caption = "DataAnalysisSolution Model View";
+      this.modelViewHost.Content = null;
+      this.modelViewHost.Location = new System.Drawing.Point(6, 6);
+      this.modelViewHost.Name = "modelViewHost";
+      this.modelViewHost.ReadOnly = false;
+      this.modelViewHost.Size = new System.Drawing.Size(360, 224);
+      this.modelViewHost.TabIndex = 1;
+      this.modelViewHost.ViewType = null;
+      // 
+      // viewHost1
+      // 
+      this.viewHost1.Caption = "View";
+      this.viewHost1.Content = null;
+      this.viewHost1.Location = new System.Drawing.Point(6, 6);
+      this.viewHost1.Name = "viewHost1";
+      this.viewHost1.ReadOnly = false;
+      this.viewHost1.Size = new System.Drawing.Size(360, 224);
+      this.viewHost1.TabIndex = 1;
+      this.viewHost1.ViewType = null;
+      // 
+      // dataViewHost
+      // 
+      this.dataViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+                  | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.dataViewHost.Caption = "DataAnalysisSolution Data View";
+      this.dataViewHost.Content = null;
+      this.dataViewHost.Location = new System.Drawing.Point(6, 6);
+      this.dataViewHost.Name = "dataViewHost";
+      this.dataViewHost.ReadOnly = false;
+      this.dataViewHost.Size = new System.Drawing.Size(360, 224);
+      this.dataViewHost.TabIndex = 2;
+      this.dataViewHost.ViewType = null;
+      // 
+      // DataAnalysisSolutionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.tabControl);
+      this.Name = "DataAnalysisSolutionView";
+      this.Size = new System.Drawing.Size(386, 268);
+      this.dataTabPage.ResumeLayout(false);
+      this.modelTabPage.ResumeLayout(false);
+      this.tabControl.ResumeLayout(false);
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    protected System.Windows.Forms.TabControl tabControl;
+    protected System.Windows.Forms.TabPage dataTabPage;
+    protected System.Windows.Forms.TabPage modelTabPage;
+    protected HeuristicLab.MainForm.WindowsForms.ViewHost dataViewHost;
+    private HeuristicLab.MainForm.WindowsForms.ViewHost viewHost1;
+    protected HeuristicLab.MainForm.WindowsForms.ViewHost modelViewHost;
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.cs	(revision 3884)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.cs	(revision 3884)
@@ -0,0 +1,78 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Data Analysis Solution View")]
+  [Content(typeof(DataAnalysisSolution))]
+  public partial class DataAnalysisSolutionView : AsynchronousContentView {
+    public DataAnalysisSolutionView() {
+      InitializeComponent();
+    }
+
+    public new DataAnalysisSolution Content {
+      get { return (DataAnalysisSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        modelViewHost.Content = Content.Model;
+        dataViewHost.Content = Content.ProblemData;
+      } else {
+        modelViewHost.Content = null;
+        dataViewHost.Content = null;
+      }
+      SetEnabledStateOfControls();
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      dataViewHost.Content = Content.ProblemData;
+    }
+
+    protected override void OnReadOnlyChanged() {
+      base.OnReadOnlyChanged();
+    }
+    protected override void OnLockedChanged() {
+      base.OnLockedChanged();
+    }
+    private void SetEnabledStateOfControls() {
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj	(revision 3884)
@@ -86,4 +86,10 @@
     <None Include="HeuristicLabProblemsDataAnalysisViewsPlugin.cs.frame" />
     <None Include="Properties\AssemblyInfo.frame" />
+    <Compile Include="DataAnalysisSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="DataAnalysisSolutionView.Designer.cs">
+      <DependentUpon>DataAnalysisSolutionView.cs</DependentUpon>
+    </Compile>
     <Compile Include="SupportVectorRegressionSolutionView.cs">
       <SubType>UserControl</SubType>
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.Designer.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.Designer.cs	(revision 3884)
@@ -44,80 +44,8 @@
     /// </summary>
     private void InitializeComponent() {
-      this.modelTabControl = new System.Windows.Forms.TabControl();
-      this.modelTabPage = new System.Windows.Forms.TabPage();
-      this.modelPanel = new HeuristicLab.MainForm.WindowsForms.ViewHost();
-      this.dataTabPage = new System.Windows.Forms.TabPage();
-      this.dataPanel = new HeuristicLab.MainForm.WindowsForms.ViewHost();
       this.supportVectorTabControl = new System.Windows.Forms.TabPage();
       this.supportVectorViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
-      this.modelTabControl.SuspendLayout();
-      this.modelTabPage.SuspendLayout();
-      this.dataTabPage.SuspendLayout();
       this.supportVectorTabControl.SuspendLayout();
       this.SuspendLayout();
-      // 
-      // modelTabControl
-      // 
-      this.modelTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.modelTabControl.Controls.Add(this.modelTabPage);
-      this.modelTabControl.Controls.Add(this.dataTabPage);
-      this.modelTabControl.Controls.Add(this.supportVectorTabControl);
-      this.modelTabControl.Location = new System.Drawing.Point(3, 3);
-      this.modelTabControl.Name = "modelTabControl";
-      this.modelTabControl.SelectedIndex = 0;
-      this.modelTabControl.Size = new System.Drawing.Size(247, 245);
-      this.modelTabControl.TabIndex = 0;
-      // 
-      // modelTabPage
-      // 
-      this.modelTabPage.Controls.Add(this.modelPanel);
-      this.modelTabPage.Location = new System.Drawing.Point(4, 22);
-      this.modelTabPage.Name = "modelTabPage";
-      this.modelTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.modelTabPage.Size = new System.Drawing.Size(239, 219);
-      this.modelTabPage.TabIndex = 0;
-      this.modelTabPage.Text = "Model";
-      this.modelTabPage.UseVisualStyleBackColor = true;
-      // 
-      // modelPanel
-      // 
-      this.modelPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.modelPanel.Caption = "View";
-      this.modelPanel.Content = null;
-      this.modelPanel.Location = new System.Drawing.Point(6, 6);
-      this.modelPanel.Name = "modelPanel";
-      this.modelPanel.ReadOnly = false;
-      this.modelPanel.Size = new System.Drawing.Size(227, 207);
-      this.modelPanel.TabIndex = 0;
-      this.modelPanel.ViewType = null;
-      // 
-      // dataTabPage
-      // 
-      this.dataTabPage.Controls.Add(this.dataPanel);
-      this.dataTabPage.Location = new System.Drawing.Point(4, 22);
-      this.dataTabPage.Name = "dataTabPage";
-      this.dataTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.dataTabPage.Size = new System.Drawing.Size(239, 219);
-      this.dataTabPage.TabIndex = 1;
-      this.dataTabPage.Text = "Data";
-      this.dataTabPage.UseVisualStyleBackColor = true;
-      // 
-      // dataPanel
-      // 
-      this.dataPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.dataPanel.Caption = "View";
-      this.dataPanel.Content = null;
-      this.dataPanel.Location = new System.Drawing.Point(6, 6);
-      this.dataPanel.Name = "dataPanel";
-      this.dataPanel.ReadOnly = false;
-      this.dataPanel.Size = new System.Drawing.Size(227, 207);
-      this.dataPanel.TabIndex = 0;
-      this.dataPanel.ViewType = null;
       // 
       // supportVectorTabControl
@@ -151,10 +79,6 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.modelTabControl);
       this.Name = "SupportVectorRegressionSolutionView";
-      this.Size = new System.Drawing.Size(253, 251);
-      this.modelTabControl.ResumeLayout(false);
-      this.modelTabPage.ResumeLayout(false);
-      this.dataTabPage.ResumeLayout(false);
+      this.tabControl.TabPages.Add(supportVectorTabControl);
       this.supportVectorTabControl.ResumeLayout(false);
       this.ResumeLayout(false);
@@ -164,13 +88,6 @@
     #endregion
 
-    private System.Windows.Forms.TabControl modelTabControl;
-    private System.Windows.Forms.TabPage modelTabPage;
-    private HeuristicLab.MainForm.WindowsForms.ViewHost modelPanel;
-    private System.Windows.Forms.TabPage dataTabPage;
-    private HeuristicLab.MainForm.WindowsForms.ViewHost dataPanel;
     private System.Windows.Forms.TabPage supportVectorTabControl;
     private HeuristicLab.MainForm.WindowsForms.ViewHost supportVectorViewHost;
-
-
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/SupportVectorRegressionSolutionView.cs	(revision 3884)
@@ -40,11 +40,9 @@
   [View("Support Vector Regression Solution View")]
   [Content(typeof(SupportVectorRegressionSolution))]
-  public partial class SupportVectorRegressionSolutionView : AsynchronousContentView {
+  public partial class SupportVectorRegressionSolutionView : DataAnalysisSolutionView {
 
     public new SupportVectorRegressionSolution Content {
       get { return (SupportVectorRegressionSolution)base.Content; }
-      set {
-        base.Content = value;
-      }
+      set { base.Content = value; }
     }
 
@@ -57,25 +55,9 @@
       base.OnContentChanged();
       if (Content != null) {
-        dataPanel.Content = Content.ProblemData;
-        modelPanel.Content = Content.Model;
         supportVectorViewHost.Content = Content.SupportVectors;
       } else {
-        dataPanel.Content = null;
-        modelPanel.Content = null;
         supportVectorViewHost.Content = null;
       }
     }
-    protected override void RegisterContentEvents() {
-      base.RegisterContentEvents();
-      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
-    }
-
-    protected override void DeregisterContentEvents() {
-      base.DeregisterContentEvents();
-    }
-
-    private void Content_ProblemDataChanged(object sender, EventArgs e) {
-      dataPanel.Content = Content.ProblemData;
-    }
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.cs	(revision 3884)
@@ -39,12 +39,6 @@
 namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
   [View("Simplified Symbolic Expression Model View")]
-  [Content(typeof(SymbolicRegressionSolution))]
+  [Content(typeof(SymbolicRegressionModel))]
   public partial class SimplifiedSymbolicExpressionModelView : AsynchronousContentView {
-    public new SymbolicRegressionSolution Content {
-      get { return (SymbolicRegressionSolution)base.Content; }
-      set { base.Content = value; }
-    }
-
-
     public SimplifiedSymbolicExpressionModelView()
       : base() {
@@ -52,26 +46,20 @@
     }
 
-    protected override void RegisterContentEvents() {
-      base.RegisterContentEvents();
-      Content.ModelChanged += new EventHandler(Content_ModelChanged);
-    }
-
-    protected override void DeregisterContentEvents() {
-      base.DeregisterContentEvents();
-      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
-    }
-
-    void Content_ModelChanged(object sender, EventArgs e) {
-      UpdateTreeChart();
+    public new SymbolicRegressionModel Content {
+      get { return (SymbolicRegressionModel)base.Content; }
+      set { base.Content = value; }
     }
 
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      UpdateTreeChart();
+      if (Content != null)
+        UpdateTreeChart();
+      else
+        viewHost.Content = null;
     }
 
     private void UpdateTreeChart() {
       var simplifier = new SymbolicSimplifier();
-      var simplifiedTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree);
+      var simplifiedTree = simplifier.Simplify(Content.SymbolicExpressionTree);
       viewHost.Content = simplifiedTree;
     }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.cs	(revision 3884)
@@ -39,11 +39,6 @@
 namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
   [View("Symbolic Expression Model View")]
-  [Content(typeof(SymbolicRegressionSolution))]
+  [Content(typeof(SymbolicRegressionModel),true)]
   public partial class SymbolicExpressionModelView : AsynchronousContentView {
-    public new SymbolicRegressionSolution Content {
-      get { return (SymbolicRegressionSolution)base.Content; }
-      set { base.Content = value; }
-    }
-
     public SymbolicExpressionModelView()
       : base() {
@@ -51,25 +46,19 @@
     }
 
-    protected override void RegisterContentEvents() {
-      base.RegisterContentEvents();
-      Content.ModelChanged += new EventHandler(Content_ModelChanged);
-    }
-
-    protected override void DeregisterContentEvents() {
-      base.DeregisterContentEvents();
-      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
-    }
-
-    void Content_ModelChanged(object sender, EventArgs e) {
-      UpdateTreeChart();
+    public new SymbolicRegressionModel Content {
+      get { return (SymbolicRegressionModel)base.Content; }
+      set { base.Content = value; }
     }
 
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      UpdateTreeChart();
+      if (Content != null)
+        UpdateTreeChart();
+      else
+        viewHost.Content = null;
     }
 
     private void UpdateTreeChart() {
-      viewHost.Content = Content.Model.SymbolicExpressionTree;
+      viewHost.Content = Content.SymbolicExpressionTree;
     }
   }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblem.cs	(revision 3884)
@@ -71,5 +71,7 @@
 
     #region events
-    protected virtual void OnDataAnalysisProblemChanged(EventArgs e) { }
+    protected virtual void OnDataAnalysisProblemChanged(EventArgs e) {
+      RaiseReset(e);
+    }
 
     private void RegisterParameterEvents() {
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs	(revision 3884)
@@ -36,4 +36,22 @@
   [StorableClass]
   public abstract class DataAnalysisSolution : NamedItem {
+    protected DataAnalysisSolution()
+      : base() { }
+    protected DataAnalysisSolution(DataAnalysisProblemData problemData) : this(problemData, double.NegativeInfinity, double.PositiveInfinity) { }
+    protected DataAnalysisSolution(DataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit)
+      : this() {
+      this.problemData = problemData;
+      this.lowerEstimationLimit = lowerEstimationLimit;
+      this.upperEstimationLimit = upperEstimationLimit;
+      Initialize();
+    }
+
+    [StorableConstructor]
+    private DataAnalysisSolution(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() {
+      if (problemData != null) RegisterProblemDataEvents();
+    }
+
     [Storable]
     private DataAnalysisProblemData problemData;
@@ -43,11 +61,29 @@
         if (problemData != value) {
           if (value == null) throw new ArgumentNullException();
+          if (model != null && problemData != null && !problemData.InputVariables.Select(c => c.Value).SequenceEqual(
+            value.InputVariables.Select(c => c.Value)))
+            throw new ArgumentException("Could not set new problem data with different structure");
+
           if (problemData != null) DeregisterProblemDataEvents();
           problemData = value;
           RegisterProblemDataEvents();
-          OnProblemDataChanged(EventArgs.Empty);
+          OnProblemDataChanged();
         }
       }
     }
+
+    [Storable]
+    private IDataAnalysisModel model;
+    public IDataAnalysisModel Model {
+      get { return model; }
+      set {
+        if (model != value) {
+          if (value == null) throw new ArgumentNullException();
+          model = value;
+          OnModelChanged();
+        }
+      }
+    }
+
     [Storable]
     private double lowerEstimationLimit;
@@ -57,5 +93,5 @@
         if (lowerEstimationLimit != value) {
           lowerEstimationLimit = value;
-          OnEstimatedValuesChanged(EventArgs.Empty);
+          RecalculateEstimatedValues();
         }
       }
@@ -69,5 +105,5 @@
         if (upperEstimationLimit != value) {
           upperEstimationLimit = value;
-          OnEstimatedValuesChanged(EventArgs.Empty);
+          RecalculateEstimatedValues();
         }
       }
@@ -77,35 +113,5 @@
     public abstract IEnumerable<double> EstimatedTrainingValues { get; }
     public abstract IEnumerable<double> EstimatedTestValues { get; }
-
-    protected DataAnalysisSolution() : base() {
-      Name = ItemName;
-      Description = ItemDescription;
-    }
-    protected DataAnalysisSolution(DataAnalysisProblemData problemData) : this(problemData, double.NegativeInfinity, double.PositiveInfinity) { }
-    protected DataAnalysisSolution(DataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit)
-      : this() {
-      this.problemData = problemData;
-      this.lowerEstimationLimit = lowerEstimationLimit;
-      this.upperEstimationLimit = upperEstimationLimit;
-      Initialize();
-    }
-
-    [StorableConstructor]
-    private DataAnalysisSolution(bool deserializing) : base(deserializing) { }
-
-    [StorableHook(HookType.AfterDeserialization)]
-    private void Initialize() {
-      if (problemData != null) RegisterProblemDataEvents();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      DataAnalysisSolution clone = (DataAnalysisSolution)base.Clone(cloner);
-      // don't clone the problem data!
-      clone.problemData = problemData;
-      clone.lowerEstimationLimit = lowerEstimationLimit;
-      clone.upperEstimationLimit = upperEstimationLimit;
-      clone.Initialize();
-      return clone;
-    }
+    protected abstract void RecalculateEstimatedValues();
 
     #region Events
@@ -116,23 +122,42 @@
       ProblemData.ProblemDataChanged += new EventHandler(ProblemData_Changed);
     }
-
     private void ProblemData_Changed(object sender, EventArgs e) {
-      OnProblemDataChanged(EventArgs.Empty);
+      OnProblemDataChanged();
     }
 
     public event EventHandler ProblemDataChanged;
-    protected virtual void OnProblemDataChanged(EventArgs e) {
+    protected virtual void OnProblemDataChanged() {
+      RecalculateEstimatedValues();
       var listeners = ProblemDataChanged;
       if (listeners != null)
-        listeners(this, e);
+        listeners(this, EventArgs.Empty);
+    }
+
+    public event EventHandler ModelChanged;
+    protected virtual void OnModelChanged() {
+      RecalculateEstimatedValues();
+      EventHandler handler = ModelChanged;
+      if (handler != null)
+        handler(this, EventArgs.Empty);
     }
 
     public event EventHandler EstimatedValuesChanged;
-    protected virtual void OnEstimatedValuesChanged(EventArgs e) {
+    protected virtual void OnEstimatedValuesChanged() {
       var listeners = EstimatedValuesChanged;
       if (listeners != null)
-        listeners(this, e);
+        listeners(this, EventArgs.Empty);
     }
     #endregion
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      DataAnalysisSolution clone = (DataAnalysisSolution)base.Clone(cloner);
+      // don't clone the problem data!
+      clone.problemData = problemData;
+      clone.Model = (IDataAnalysisModel)cloner.Clone(model);
+      clone.lowerEstimationLimit = lowerEstimationLimit;
+      clone.upperEstimationLimit = upperEstimationLimit;
+      clone.Initialize();
+      return clone;
+    }
   }
 }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj	(revision 3884)
@@ -98,7 +98,9 @@
     <Compile Include="Evaluators\SimpleVarianceAccountedForEvaluator.cs" />
     <Compile Include="HeuristicLabProblemsDataAnalysisPlugin.cs" />
+    <Compile Include="Interfaces\IDataAnalysisModel.cs" />
     <Compile Include="Interfaces\IDataAnalysisProblem.cs" />
     <Compile Include="MatrixExtensions.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SupportVectorMachine\ParameterAdjustmentProblem\SupportVectorRegressionParameterAdjustmentBestSolutionAnalyzer.cs" />
     <Compile Include="SupportVectorMachine\ParameterAdjustmentProblem\SupportVectorRegressionParameterAdjustmentEvaluator.cs" />
     <Compile Include="SupportVectorMachine\ParameterAdjustmentProblem\SupportVectorRegressionParameterAdjustmentProblem.cs" />
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs	(revision 3884)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Interfaces/IDataAnalysisModel.cs	(revision 3884)
@@ -0,0 +1,32 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public interface IDataAnalysisModel : INamedItem {
+    IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end);
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer.cs	(revision 3884)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer.cs	(revision 3884)
@@ -0,0 +1,190 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Optimization;
+using HeuristicLab.Operators;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine.ParameterAdjustmentProblem {
+  [Item("SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer", "Collects the parameters and the quality on training and test of the best solution for the SVM parameter adjustment problem.")]
+  [StorableClass]
+  public class SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
+    private const string ParameterVectorParameterName = "ParameterVector";
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string SvmTypeParameterName = "SvmType";
+    private const string KernelTypeParameterName = "KernelType";
+    private const string QualityParameterName = "Quality";
+    private const string BestSolutionParameterName = "BestSolution";
+    private const string BestSolutionQualityParameterName = "BestSolutionQuality";
+    private const string ResultsParameterName = "Results";
+    private const string BestSolutionResultName = "Best solution (cross-validation)";
+    private const string BestSolutionTrainingMse = "Best solution mean squared error (training)";
+    private const string BestSolutionTestMse = "Best solution mean squared error (test)";
+    private const string BestSolutionNu = "Best nu (cross-validation)";
+    private const string BestSolutionCost = "Best cost (cross-validation)";
+    private const string BestSolutionGamma = "Best gamma (cross-validation)";
+
+
+    #region parameter properties
+    public ILookupParameter<ItemArray<RealVector>> ParameterVectorParameter {
+      get { return (ILookupParameter<ItemArray<RealVector>>)Parameters["ParameterVector"]; }
+    }
+    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> SvmTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[SvmTypeParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> KernelTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[KernelTypeParameterName]; }
+    }
+    public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {
+      get { return (ILookupParameter<ItemArray<DoubleValue>>)Parameters[QualityParameterName]; }
+    }
+    #endregion
+    #region properties
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public StringValue SvmType {
+      get { return SvmTypeParameter.Value; }
+    }
+    public StringValue KernelType {
+      get { return KernelTypeParameter.Value; }
+    }
+    public ILookupParameter<SupportVectorMachineModel> BestSolutionParameter {
+      get { return (ILookupParameter<SupportVectorMachineModel>)Parameters[BestSolutionParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> BestSolutionQualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[BestSolutionQualityParameterName]; }
+    }
+    public ILookupParameter<ResultCollection> ResultsParameter {
+      get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; }
+    }
+
+    #endregion
+
+    public SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer()
+      : base() {
+      StringValue nuSvrType = new StringValue("NU_SVR").AsReadOnly();
+      StringValue rbfKernelType = new StringValue("RBF").AsReadOnly();
+      Parameters.Add(new ScopeTreeLookupParameter<RealVector>(ParameterVectorParameterName, "The parameters for the SVM encoded as a real vector."));
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", nuSvrType));
+      Parameters.Add(new ValueLookupParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", rbfKernelType));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(QualityParameterName, "The cross validation quality reached with the given parameters."));
+      Parameters.Add(new LookupParameter<SupportVectorMachineModel>(BestSolutionParameterName, "The best support vector solution."));
+      Parameters.Add(new LookupParameter<DoubleValue>(BestSolutionQualityParameterName, "The quality of the best support vector model."));
+      Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName, "The result collection where the best support vector solution should be stored."));
+    }
+
+    public override IOperation Apply() {
+      var points = ParameterVectorParameter.ActualValue;
+      var qualities = QualityParameter.ActualValue;
+      var bestPoint = points[0];
+      var bestQuality = qualities[0].Value;
+      for (int i = 1; i < points.Length; i++) {
+        if (bestQuality > qualities[i].Value) {
+          bestQuality = qualities[i].Value;
+          bestPoint = points[i];
+        }
+      }
+      ResultCollection results = ResultsParameter.ActualValue;
+      double nu = bestPoint[0];
+      double cost = Math.Pow(2, bestPoint[1]);
+      double gamma = Math.Pow(2, bestPoint[2]);
+      DataAnalysisProblemData problemData = DataAnalysisProblemData;
+
+      SupportVectorMachineModel bestModel = BestSolutionParameter.ActualValue;
+      if (bestModel == null) {
+        bestModel = SupportVectorMachineModelCreator.TrainModel(DataAnalysisProblemData,
+          DataAnalysisProblemData.TrainingSamplesStart.Value, DataAnalysisProblemData.TrainingSamplesEnd.Value,
+          SvmType.Value, KernelType.Value, cost, nu, gamma, 0.0);
+        BestSolutionParameter.ActualValue = bestModel;
+        BestSolutionQualityParameter.ActualValue = new DoubleValue(bestQuality);
+        results.Add(new Result(BestSolutionResultName, bestModel));
+        #region calculate R2,MSE,Rel Error
+        double[] trainingValues = problemData.Dataset.GetVariableValues(
+          problemData.TargetVariable.Value,
+          problemData.TrainingSamplesStart.Value,
+          problemData.TrainingSamplesEnd.Value);
+        double[] testValues = problemData.Dataset.GetVariableValues(
+          problemData.TargetVariable.Value,
+          problemData.TestSamplesStart.Value,
+          problemData.TestSamplesEnd.Value);
+        double[] estimatedTrainingValues = bestModel.GetEstimatedValues(problemData, problemData.TrainingSamplesStart.Value, problemData.TrainingSamplesEnd.Value)
+          .ToArray();
+        double[] estimatedTestValues = bestModel.GetEstimatedValues(problemData, problemData.TestSamplesStart.Value, problemData.TestSamplesEnd.Value)
+          .ToArray();
+        double trainingMse = SimpleMSEEvaluator.Calculate(trainingValues, estimatedTrainingValues);
+        double testMse = SimpleMSEEvaluator.Calculate(testValues, estimatedTestValues);
+        results.Add(new Result(BestSolutionTrainingMse, new DoubleValue(trainingMse)));
+        results.Add(new Result(BestSolutionTestMse, new DoubleValue(testMse)));
+        results.Add(new Result(BestSolutionNu, new DoubleValue(nu)));
+        results.Add(new Result(BestSolutionCost, new DoubleValue(cost)));
+        results.Add(new Result(BestSolutionGamma, new DoubleValue(gamma)));
+        #endregion
+      } else {
+        if (BestSolutionQualityParameter.ActualValue.Value > bestQuality) {
+          bestModel = SupportVectorMachineModelCreator.TrainModel(DataAnalysisProblemData,
+            DataAnalysisProblemData.TrainingSamplesStart.Value, DataAnalysisProblemData.TrainingSamplesEnd.Value,
+            SvmType.Value, KernelType.Value, cost, nu, gamma, 0.0);
+          BestSolutionParameter.ActualValue = bestModel;
+          BestSolutionQualityParameter.ActualValue = new DoubleValue(bestQuality);
+          results[BestSolutionResultName].Value = bestModel;
+          #region calculate R2,MSE,Rel Error
+          double[] trainingValues = problemData.Dataset.GetVariableValues(
+            problemData.TargetVariable.Value,
+            problemData.TrainingSamplesStart.Value,
+            problemData.TrainingSamplesEnd.Value);
+          double[] testValues = problemData.Dataset.GetVariableValues(
+            problemData.TargetVariable.Value,
+            problemData.TestSamplesStart.Value,
+            problemData.TestSamplesEnd.Value);
+          double[] estimatedTrainingValues = bestModel.GetEstimatedValues(problemData, problemData.TrainingSamplesStart.Value, problemData.TrainingSamplesEnd.Value)
+            .ToArray();
+          double[] estimatedTestValues = bestModel.GetEstimatedValues(problemData, problemData.TestSamplesStart.Value, problemData.TestSamplesEnd.Value)
+            .ToArray();
+          double trainingMse = SimpleMSEEvaluator.Calculate(trainingValues, estimatedTrainingValues);
+          double testMse = SimpleMSEEvaluator.Calculate(testValues, estimatedTestValues);
+          results[BestSolutionTrainingMse].Value = new DoubleValue(trainingMse);
+          results[BestSolutionTestMse].Value = new DoubleValue(testMse);
+          results[BestSolutionNu].Value = new DoubleValue(nu);
+          results[BestSolutionCost].Value = new DoubleValue(cost);
+          results[BestSolutionGamma].Value = new DoubleValue(gamma);
+          #endregion
+        }
+      }
+
+      return base.Apply();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentEvaluator.cs	(revision 3884)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentEvaluator.cs	(revision 3884)
@@ -0,0 +1,146 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Evaluators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Optimization;
+using HeuristicLab.Operators;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine.ParameterAdjustmentProblem {
+  [Item("SupportVectorMachineParameterAdjustmentEvaluator", "")]
+  [StorableClass]
+  public class SupportVectorMachineParameterAdjustmentEvaluator : AlgorithmOperator, ISingleObjectiveEvaluator {
+    private const string ParameterVectorParameterName = "ParameterVector";
+    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
+    private const string SvmTypeParameterName = "SvmType";
+    private const string KernelTypeParameterName = "KernelType";
+    private const string CostParameterName = "Cost";
+    private const string NuParameterName = "Nu";
+    private const string GammaParameterName = "Gamma";
+    private const string EpsilonParameterName = "Epsilon";
+    private const string SamplesStartParameterName = "SamplesStart";
+    private const string SamplesEndParameterName = "SamplesEnd";
+    private const string NumberOfFoldsParameterName = "NumberOfFolds";
+    private const string QualityParameterName = "Quality";
+
+    #region parameter properties
+    public ILookupParameter<RealVector> ParameterVectorParameter {
+      get { return (ILookupParameter<RealVector>)Parameters["ParameterVector"]; }
+    }
+    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
+      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> SvmTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[SvmTypeParameterName]; }
+    }
+    public IValueLookupParameter<StringValue> KernelTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[KernelTypeParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> NuParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[NuParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> CostParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[CostParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> GammaParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[GammaParameterName]; }
+    }
+    public IValueLookupParameter<DoubleValue> EpsilonParameter {
+      get { return (IValueLookupParameter<DoubleValue>)Parameters[EpsilonParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesStartParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> SamplesEndParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<IntValue> NumberOfFoldsParameter {
+      get { return (IValueLookupParameter<IntValue>)Parameters[NumberOfFoldsParameterName]; }
+    }
+    public ILookupParameter<DoubleValue> QualityParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
+    }
+    #endregion
+    #region properties
+    public RealVector ParameterVector {
+      get { return ParameterVectorParameter.ActualValue; }
+    }
+    public DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public StringValue SvmType {
+      get { return SvmTypeParameter.Value; }
+    }
+    public StringValue KernelType {
+      get { return KernelTypeParameter.Value; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    public IntValue NumberOfFolds {
+      get { return NumberOfFoldsParameter.ActualValue; }
+    }
+    #endregion
+
+    public SupportVectorMachineParameterAdjustmentEvaluator()
+      : base() {
+      StringValue nuSvrType = new StringValue("NU_SVR").AsReadOnly();
+      StringValue rbfKernelType = new StringValue("RBF").AsReadOnly();
+      Parameters.Add(new LookupParameter<RealVector>(ParameterVectorParameterName, "The parameters for the SVM encoded as a real vector."));
+      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", nuSvrType));
+      Parameters.Add(new ValueLookupParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", rbfKernelType));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(NuParameterName, "The value of the nu parameter nu-SVC, one-class SVM and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(CostParameterName, "The value of the C (cost) parameter of C-SVC, epsilon-SVR and nu-SVR."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(GammaParameterName, "The value of the gamma parameter in the kernel function."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>(EpsilonParameterName, "The value of the epsilon parameter of epsilon-SVR."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<IntValue>(NumberOfFoldsParameterName, "The number of folds to use for cross-validation."));
+      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The cross validation quality reached with the given parameters."));
+
+
+      SupportVectorMachineCrossValidationEvaluator evaluator = new SupportVectorMachineCrossValidationEvaluator();
+      OperatorGraph.InitialOperator = evaluator;
+      evaluator.Successor = null;
+    }
+
+    public override IOperation Apply() {
+      var point = ParameterVector;
+      NuParameter.Value = new DoubleValue(point[0]);
+      CostParameter.Value = new DoubleValue(Math.Pow(2, point[1]));
+      GammaParameter.Value = new DoubleValue(Math.Pow(2, point[2]));
+      EpsilonParameter.Value = new DoubleValue();
+      return base.Apply();
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentProblem.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentProblem.cs	(revision 3884)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorMachineParameterAdjustmentProblem.cs	(revision 3884)
@@ -0,0 +1,263 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Collections.ObjectModel;
+using System.Drawing;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine.ParameterAdjustmentProblem {
+  [Item("Support Vector Machine Parameter Adjustment Problem", "Represents the problem of finding good parameter settings for support vector machines.")]
+  [StorableClass]
+  [Creatable("Problems")]
+  public sealed class SupportVectorMachineParameterAdjustmentProblem : DataAnalysisProblem, ISingleObjectiveProblem {
+
+    #region Parameter Properties
+    public ValueParameter<BoolValue> MaximizationParameter {
+      get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; }
+    }
+    IParameter ISingleObjectiveProblem.MaximizationParameter {
+      get { return MaximizationParameter; }
+    }
+    public ValueParameter<DoubleMatrix> BoundsParameter {
+      get { return (ValueParameter<DoubleMatrix>)Parameters["Bounds"]; }
+    }
+    public ValueParameter<IntValue> ProblemSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters["ProblemSize"]; }
+    }
+    public new ValueParameter<IRealVectorCreator> SolutionCreatorParameter {
+      get { return (ValueParameter<IRealVectorCreator>)Parameters["SolutionCreator"]; }
+    }
+    IParameter IProblem.SolutionCreatorParameter {
+      get { return SolutionCreatorParameter; }
+    }
+    public new ValueParameter<SupportVectorMachineParameterAdjustmentEvaluator> EvaluatorParameter {
+      get { return (ValueParameter<SupportVectorMachineParameterAdjustmentEvaluator>)Parameters["Evaluator"]; }
+    }
+    IParameter IProblem.EvaluatorParameter {
+      get { return EvaluatorParameter; }
+    }
+    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
+    IParameter ISingleObjectiveProblem.BestKnownQualityParameter {
+      get { return BestKnownQualityParameter; }
+    }
+    public OptionalValueParameter<RealVector> BestKnownSolutionParameter {
+      get { return (OptionalValueParameter<RealVector>)Parameters["BestKnownSolution"]; }
+    }
+    #endregion
+
+    #region Properties
+    public BoolValue Maximization {
+      get { return MaximizationParameter.Value; }
+      set { MaximizationParameter.Value = value; }
+    }
+    public DoubleMatrix Bounds {
+      get { return BoundsParameter.Value; }
+    }
+    public IntValue ProblemSize {
+      get { return ProblemSizeParameter.Value; }
+      set { ProblemSizeParameter.Value = value; }
+    }
+    public new IRealVectorCreator SolutionCreator {
+      get { return SolutionCreatorParameter.Value; }
+      set { SolutionCreatorParameter.Value = value; }
+    }
+    ISolutionCreator IProblem.SolutionCreator {
+      get { return SolutionCreatorParameter.Value; }
+    }
+    public new SupportVectorMachineParameterAdjustmentEvaluator Evaluator {
+      get { return EvaluatorParameter.Value; }
+      set { EvaluatorParameter.Value = value; }
+    }
+    ISingleObjectiveEvaluator ISingleObjectiveProblem.Evaluator {
+      get { return EvaluatorParameter.Value; }
+    }
+    IEvaluator IProblem.Evaluator {
+      get { return EvaluatorParameter.Value; }
+    }
+    public DoubleValue BestKnownQuality {
+      get { return BestKnownQualityParameter.Value; }
+      set { BestKnownQualityParameter.Value = value; }
+    }
+    private List<IOperator> operators;
+    public override IEnumerable<IOperator> Operators {
+      get { return operators; }
+    }
+    #endregion
+
+    public IntValue TrainingSamplesStart {
+      get { return new IntValue(DataAnalysisProblemData.TrainingSamplesStart.Value); }
+    }
+    public IntValue TrainingSamplesEnd {
+      get { return new IntValue(DataAnalysisProblemData.TrainingSamplesEnd.Value); }
+    }
+
+    [Storable]
+    private StdDevStrategyVectorCreator strategyVectorCreator;
+    [Storable]
+    private StdDevStrategyVectorCrossover strategyVectorCrossover;
+    [Storable]
+    private StdDevStrategyVectorManipulator strategyVectorManipulator;
+
+    [StorableConstructor]
+    private SupportVectorMachineParameterAdjustmentProblem(bool deserializing) : base() { }
+    public SupportVectorMachineParameterAdjustmentProblem()
+      : base() {
+      UniformRandomRealVectorCreator creator = new UniformRandomRealVectorCreator();
+      SupportVectorMachineParameterAdjustmentEvaluator evaluator = new SupportVectorMachineParameterAdjustmentEvaluator();
+
+      var bounds = new DoubleMatrix(new double[,] { 
+        { 0.01, 1.0 },
+        { -7, 9},
+        { -7, 9}
+      });
+
+      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as we want to minimize the error.", new BoolValue(false)));
+      Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension.", bounds));
+      Parameters.Add(new ValueParameter<IntValue>("ProblemSize", "The dimension of the problem.", new IntValue(3)));
+      Parameters.Add(new ValueParameter<IRealVectorCreator>("SolutionCreator", "The operator which should be used to create new test function solutions.", creator));
+      Parameters.Add(new ValueParameter<SupportVectorMachineParameterAdjustmentEvaluator>("Evaluator", "The operator which should be used to evaluate test function solutions.", evaluator));
+      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this test function.", new DoubleValue(0)));
+      Parameters.Add(new OptionalValueParameter<RealVector>("BestKnownSolution", "The best known solution for this test function instance."));
+
+      strategyVectorCreator = new StdDevStrategyVectorCreator();
+      strategyVectorCreator.LengthParameter.Value = ProblemSize;
+      strategyVectorCrossover = new StdDevStrategyVectorCrossover();
+      strategyVectorManipulator = new StdDevStrategyVectorManipulator();
+      strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(0.5);
+      strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(0.5);
+
+      creator.RealVectorParameter.ActualName = "ParameterVector";
+      ParameterizeSolutionCreator();
+      ParameterizeEvaluator();
+      ParameterizeAnalyzers();
+
+      Initialize();
+      UpdateStrategyVectorBounds();
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      SupportVectorMachineParameterAdjustmentProblem clone = (SupportVectorMachineParameterAdjustmentProblem)base.Clone(cloner);
+      clone.strategyVectorCreator = (StdDevStrategyVectorCreator)cloner.Clone(strategyVectorCreator);
+      clone.strategyVectorCrossover = (StdDevStrategyVectorCrossover)cloner.Clone(strategyVectorCrossover);
+      clone.strategyVectorManipulator = (StdDevStrategyVectorManipulator)cloner.Clone(strategyVectorManipulator);
+      clone.Initialize();
+      return clone;
+    }
+
+    protected override void OnDataAnalysisProblemChanged(EventArgs e) {
+      ParameterizeEvaluator();
+      base.OnDataAnalysisProblemChanged(e);
+    }
+
+    #region Events
+    private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
+      ParameterizeSolutionCreator();
+      ParameterizeAnalyzers();
+      SolutionCreator_RealVectorParameter_ActualNameChanged(null, EventArgs.Empty);
+    }
+    private void SolutionCreator_RealVectorParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeEvaluator();
+      ParameterizeOperators();
+      ParameterizeAnalyzers();
+    }
+    private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
+      ParameterizeEvaluator();
+      ParameterizeAnalyzers();
+      RaiseReset(EventArgs.Empty);
+    }
+    private void strategyVectorCreator_StrategyParameterParameter_ActualNameChanged(object sender, EventArgs e) {
+      string name = strategyVectorCreator.StrategyParameterParameter.ActualName;
+      strategyVectorCrossover.ParentsParameter.ActualName = name;
+      strategyVectorCrossover.StrategyParameterParameter.ActualName = name;
+      strategyVectorManipulator.StrategyParameterParameter.ActualName = name;
+    }
+    #endregion
+
+    #region Helpers
+    [StorableHook(HookType.AfterDeserialization)]
+    private void Initialize() {
+      InitializeOperators();
+      SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
+      SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged);
+      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
+      strategyVectorCreator.StrategyParameterParameter.ActualNameChanged += new EventHandler(strategyVectorCreator_StrategyParameterParameter_ActualNameChanged);
+    }
+    private void InitializeOperators() {
+      operators = new List<IOperator>();
+      operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>().Cast<IOperator>());
+      operators.Add(new SupportVectorMachineParameterAdjustmentBestSolutionAnalyzer());
+      operators.Add(strategyVectorCreator);
+      operators.Add(strategyVectorCrossover);
+      operators.Add(strategyVectorManipulator);
+      ParameterizeOperators();
+    }
+    private void ParameterizeSolutionCreator() {
+      SolutionCreator.LengthParameter.Value = new IntValue(ProblemSize.Value);
+    }
+    private void ParameterizeEvaluator() {
+      Evaluator.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
+      Evaluator.SamplesStartParameter.Value = TrainingSamplesStart;
+      Evaluator.SamplesEndParameter.Value = TrainingSamplesEnd;
+      Evaluator.NumberOfFoldsParameter.Value = new IntValue(5);
+    }
+    private void ParameterizeOperators() {
+      foreach (IRealVectorCrossover op in Operators.OfType<IRealVectorCrossover>()) {
+        op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
+        op.ChildParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
+        op.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+      foreach (IRealVectorManipulator op in Operators.OfType<IRealVectorManipulator>()) {
+        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
+        op.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+      foreach (IRealVectorMoveOperator op in Operators.OfType<IRealVectorMoveOperator>()) {
+        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
+      }
+      foreach (IRealVectorMoveGenerator op in Operators.OfType<IRealVectorMoveGenerator>()) {
+        op.BoundsParameter.ActualName = BoundsParameter.Name;
+      }
+      foreach (SupportVectorMachineParameterAdjustmentEvaluator op in Operators.OfType<SupportVectorMachineParameterAdjustmentEvaluator>()) {
+        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+        op.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
+      }
+    }
+    private void UpdateStrategyVectorBounds() {
+      DoubleMatrix strategyBounds = (DoubleMatrix)Bounds.Clone();
+      for (int i = 0; i < strategyBounds.Rows; i++)
+        if (strategyBounds[i, 0] < 0) strategyBounds[i, 0] = 0;
+      strategyVectorCreator.BoundsParameter.Value = strategyBounds;
+    }
+    #endregion
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorRegressionParameterAdjustmentEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorRegressionParameterAdjustmentEvaluator.cs	(revision 3883)
+++ 	(revision )
@@ -1,147 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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 HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.RealVectorEncoding;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
-using HeuristicLab.Problems.DataAnalysis;
-using HeuristicLab.Problems.DataAnalysis.Evaluators;
-using HeuristicLab.Parameters;
-using HeuristicLab.Optimization;
-using HeuristicLab.Operators;
-
-namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine.ParameterAdjustmentProblem {
-  [Item("SupportVectorRegressionParameterAdjustmentEvaluator", "")]
-  [StorableClass]
-  public class SupportVectorRegressionParameterAdjustmentEvaluator : AlgorithmOperator, ISingleObjectiveEvaluator {
-    private const string ParameterVectorParameterName = "ParameterVector";
-    private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
-    private const string SvmTypeParameterName = "SvmType";
-    private const string KernelTypeParameterName = "KernelType";
-    private const string CostParameterName = "Cost";
-    private const string NuParameterName = "Nu";
-    private const string GammaParameterName = "Gamma";
-    private const string EpsilonParameterName = "Epsilon";
-    private const string SamplesStartParameterName = "SamplesStart";
-    private const string SamplesEndParameterName = "SamplesEnd";
-    private const string NumberOfFoldsParameterName = "NumberOfFolds";
-    private const string QualityParameterName = "Quality";
-
-    #region parameter properties
-    public ILookupParameter<RealVector> ParameterVectorParameter {
-      get { return (ILookupParameter<RealVector>)Parameters["ParameterVector"]; }
-    }
-    public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
-      get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
-    }
-    public IValueLookupParameter<StringValue> SvmTypeParameter {
-      get { return (IValueLookupParameter<StringValue>)Parameters[SvmTypeParameterName]; }
-    }
-    public IValueLookupParameter<StringValue> KernelTypeParameter {
-      get { return (IValueLookupParameter<StringValue>)Parameters[KernelTypeParameterName]; }
-    }
-    public IValueLookupParameter<DoubleValue> NuParameter {
-      get { return (IValueLookupParameter<DoubleValue>)Parameters[NuParameterName]; }
-    }
-    public IValueLookupParameter<DoubleValue> CostParameter {
-      get { return (IValueLookupParameter<DoubleValue>)Parameters[CostParameterName]; }
-    }
-    public IValueLookupParameter<DoubleValue> GammaParameter {
-      get { return (IValueLookupParameter<DoubleValue>)Parameters[GammaParameterName]; }
-    }
-    public IValueLookupParameter<DoubleValue> EpsilonParameter {
-      get { return (IValueLookupParameter<DoubleValue>)Parameters[EpsilonParameterName]; }
-    }
-    public IValueLookupParameter<IntValue> SamplesStartParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesStartParameterName]; }
-    }
-    public IValueLookupParameter<IntValue> SamplesEndParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
-    }
-    public IValueLookupParameter<IntValue> NumberOfFoldsParameter {
-      get { return (IValueLookupParameter<IntValue>)Parameters[NumberOfFoldsParameterName]; }
-    }
-    public ILookupParameter<DoubleValue> QualityParameter {
-      get { return (ILookupParameter<DoubleValue>)Parameters[QualityParameterName]; }
-    }
-    #endregion
-    #region properties
-    public RealVector ParameterVector {
-      get { return ParameterVectorParameter.ActualValue; }
-    }
-    public DataAnalysisProblemData DataAnalysisProblemData {
-      get { return DataAnalysisProblemDataParameter.ActualValue; }
-    }
-    public StringValue SvmType {
-      get { return SvmTypeParameter.Value; }
-    }
-    public StringValue KernelType {
-      get { return KernelTypeParameter.Value; }
-    }
-    public IntValue SamplesStart {
-      get { return SamplesStartParameter.ActualValue; }
-    }
-    public IntValue SamplesEnd {
-      get { return SamplesEndParameter.ActualValue; }
-    }
-    public IntValue NumberOfFolds {
-      get { return NumberOfFoldsParameter.ActualValue; }
-    }
-    #endregion
-
-    public SupportVectorRegressionParameterAdjustmentEvaluator()
-      : base() {
-      StringValue nuSvrType = new StringValue("NU_SVR").AsReadOnly();
-      StringValue rbfKernelType = new StringValue("RBF").AsReadOnly();
-      Parameters.Add(new LookupParameter<RealVector>(ParameterVectorParameterName, "The parameters for the SVM encoded as a real vector."));
-      Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
-      Parameters.Add(new ValueLookupParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", nuSvrType));
-      Parameters.Add(new ValueLookupParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", rbfKernelType));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>(NuParameterName, "The value of the nu parameter nu-SVC, one-class SVM and nu-SVR."));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>(CostParameterName, "The value of the C (cost) parameter of C-SVC, epsilon-SVR and nu-SVR."));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>(GammaParameterName, "The value of the gamma parameter in the kernel function."));
-      Parameters.Add(new ValueLookupParameter<DoubleValue>(EpsilonParameterName, "The value of the epsilon parameter of epsilon-SVR."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition the support vector machine should use for training."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition the support vector machine should use for training."));
-      Parameters.Add(new ValueLookupParameter<IntValue>(NumberOfFoldsParameterName, "The number of folds to use for cross-validation."));
-      Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The cross validation quality reached with the given parameters."));
-
-
-      SupportVectorMachineCrossValidationEvaluator evaluator = new SupportVectorMachineCrossValidationEvaluator();
-      OperatorGraph.InitialOperator = evaluator;
-      evaluator.Successor = null;
-    }
-
-    public override IOperation Apply() {
-      var point = ParameterVector;
-      NuParameter.Value = new DoubleValue(point[0]);
-      CostParameter.Value = new DoubleValue(Math.Pow(2, point[1]));
-      GammaParameter.Value = new DoubleValue(Math.Pow(2, point[2]));
-      EpsilonParameter.Value = new DoubleValue();
-
-      return base.Apply();
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorRegressionParameterAdjustmentProblem.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorRegressionParameterAdjustmentProblem.cs	(revision 3883)
+++ 	(revision )
@@ -1,269 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Collections.ObjectModel;
-using System.Drawing;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.RealVectorEncoding;
-using HeuristicLab.Optimization;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.PluginInfrastructure;
-using HeuristicLab.Problems.DataAnalysis;
-
-namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine.ParameterAdjustmentProblem {
-  [Item("Support Vector Regression Parameter Adjustment Problem", "Represents the problem of finding good parameter settings for support vector machines.")]
-  [StorableClass]
-  [Creatable("Problems")]
-  public sealed class SupportVectorRegressionParameterAdjustmentProblem : DataAnalysisProblem, ISingleObjectiveProblem {
-
-    #region Parameter Properties
-    public ValueParameter<BoolValue> MaximizationParameter {
-      get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; }
-    }
-    IParameter ISingleObjectiveProblem.MaximizationParameter {
-      get { return MaximizationParameter; }
-    }
-    public ValueParameter<DoubleMatrix> BoundsParameter {
-      get { return (ValueParameter<DoubleMatrix>)Parameters["Bounds"]; }
-    }
-    public ValueParameter<IntValue> ProblemSizeParameter {
-      get { return (ValueParameter<IntValue>)Parameters["ProblemSize"]; }
-    }
-    public new ValueParameter<IRealVectorCreator> SolutionCreatorParameter {
-      get { return (ValueParameter<IRealVectorCreator>)Parameters["SolutionCreator"]; }
-    }
-    IParameter IProblem.SolutionCreatorParameter {
-      get { return SolutionCreatorParameter; }
-    }
-    public new ValueParameter<SupportVectorRegressionParameterAdjustmentEvaluator> EvaluatorParameter {
-      get { return (ValueParameter<SupportVectorRegressionParameterAdjustmentEvaluator>)Parameters["Evaluator"]; }
-    }
-    IParameter IProblem.EvaluatorParameter {
-      get { return EvaluatorParameter; }
-    }
-    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
-      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
-    }
-    IParameter ISingleObjectiveProblem.BestKnownQualityParameter {
-      get { return BestKnownQualityParameter; }
-    }
-    public OptionalValueParameter<RealVector> BestKnownSolutionParameter {
-      get { return (OptionalValueParameter<RealVector>)Parameters["BestKnownSolution"]; }
-    }
-    #endregion
-
-    #region Properties
-    public BoolValue Maximization {
-      get { return MaximizationParameter.Value; }
-      set { MaximizationParameter.Value = value; }
-    }
-    public DoubleMatrix Bounds {
-      get { return BoundsParameter.Value; }
-    }
-    public IntValue ProblemSize {
-      get { return ProblemSizeParameter.Value; }
-      set { ProblemSizeParameter.Value = value; }
-    }
-    public new IRealVectorCreator SolutionCreator {
-      get { return SolutionCreatorParameter.Value; }
-      set { SolutionCreatorParameter.Value = value; }
-    }
-    ISolutionCreator IProblem.SolutionCreator {
-      get { return SolutionCreatorParameter.Value; }
-    }
-    public new SupportVectorRegressionParameterAdjustmentEvaluator Evaluator {
-      get { return EvaluatorParameter.Value; }
-      set { EvaluatorParameter.Value = value; }
-    }
-    ISingleObjectiveEvaluator ISingleObjectiveProblem.Evaluator {
-      get { return EvaluatorParameter.Value; }
-    }
-    IEvaluator IProblem.Evaluator {
-      get { return EvaluatorParameter.Value; }
-    }
-    public DoubleValue BestKnownQuality {
-      get { return BestKnownQualityParameter.Value; }
-      set { BestKnownQualityParameter.Value = value; }
-    }
-    private List<IOperator> operators;
-    public override IEnumerable<IOperator> Operators {
-      get { return operators; }
-    }
-    #endregion
-
-
-    //public int MinimumProblemSize {
-    //  get { return 3; }
-    //}
-    //public int MaximumProblemSize {
-    //  get { return 3; }
-    //}
-
-    public IntValue TrainingSamplesStart {
-      get { return new IntValue(DataAnalysisProblemData.TrainingSamplesStart.Value); }
-    }
-    public IntValue TrainingSamplesEnd {
-      get { return new IntValue(DataAnalysisProblemData.TrainingSamplesEnd.Value); }
-    }
-
-    [Storable]
-    private StdDevStrategyVectorCreator strategyVectorCreator;
-    [Storable]
-    private StdDevStrategyVectorCrossover strategyVectorCrossover;
-    [Storable]
-    private StdDevStrategyVectorManipulator strategyVectorManipulator;
-
-    [StorableConstructor]
-    private SupportVectorRegressionParameterAdjustmentProblem(bool deserializing) : base() { }
-    public SupportVectorRegressionParameterAdjustmentProblem()
-      : base() {
-      UniformRandomRealVectorCreator creator = new UniformRandomRealVectorCreator();
-      SupportVectorRegressionParameterAdjustmentEvaluator evaluator = new SupportVectorRegressionParameterAdjustmentEvaluator();
-
-      var bounds = new DoubleMatrix(new double[,] { 
-        { 0.01, 1.0 },
-        { -7, 9},
-        { -7, 9}
-      });
-
-      Parameters.Add(new ValueParameter<BoolValue>("Maximization", "Set to false as we want to minimize the error.", new BoolValue(false)));
-      Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension.", bounds));
-      Parameters.Add(new ValueParameter<IntValue>("ProblemSize", "The dimension of the problem.", new IntValue(3)));
-      Parameters.Add(new ValueParameter<IRealVectorCreator>("SolutionCreator", "The operator which should be used to create new test function solutions.", creator));
-      Parameters.Add(new ValueParameter<SupportVectorRegressionParameterAdjustmentEvaluator>("Evaluator", "The operator which should be used to evaluate test function solutions.", evaluator));
-      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this test function.", new DoubleValue(0)));
-      Parameters.Add(new OptionalValueParameter<RealVector>("BestKnownSolution", "The best known solution for this test function instance."));
-
-      strategyVectorCreator = new StdDevStrategyVectorCreator();
-      strategyVectorCreator.LengthParameter.Value = ProblemSize;
-      strategyVectorCrossover = new StdDevStrategyVectorCrossover();
-      strategyVectorManipulator = new StdDevStrategyVectorManipulator();
-      strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(0.5);
-      strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(0.5);
-
-      creator.RealVectorParameter.ActualName = "ParameterVector";
-      ParameterizeSolutionCreator();
-      ParameterizeEvaluator();
-
-      Initialize();
-      UpdateStrategyVectorBounds();
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      SupportVectorRegressionParameterAdjustmentProblem clone = (SupportVectorRegressionParameterAdjustmentProblem)base.Clone(cloner);
-      clone.strategyVectorCreator = (StdDevStrategyVectorCreator)cloner.Clone(strategyVectorCreator);
-      clone.strategyVectorCrossover = (StdDevStrategyVectorCrossover)cloner.Clone(strategyVectorCrossover);
-      clone.strategyVectorManipulator = (StdDevStrategyVectorManipulator)cloner.Clone(strategyVectorManipulator);
-      clone.Initialize();
-      return clone;
-    }
-
-    protected override void OnDataAnalysisProblemChanged(EventArgs e) {
-      ParameterizeEvaluator();
-      base.OnDataAnalysisProblemChanged(e);
-    }
-
-    #region Events
-    private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) {
-      ParameterizeSolutionCreator();
-      //ParameterizeAnalyzers();
-      SolutionCreator_RealVectorParameter_ActualNameChanged(null, EventArgs.Empty);
-    }
-    private void SolutionCreator_RealVectorParameter_ActualNameChanged(object sender, EventArgs e) {
-      ParameterizeEvaluator();
-      ParameterizeOperators();
-      //ParameterizeAnalyzers();
-    }
-    private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
-      ParameterizeEvaluator();
-      //ParameterizeAnalyzers();
-      RaiseReset(EventArgs.Empty);
-    }
-    private void strategyVectorCreator_StrategyParameterParameter_ActualNameChanged(object sender, EventArgs e) {
-      string name = strategyVectorCreator.StrategyParameterParameter.ActualName;
-      strategyVectorCrossover.ParentsParameter.ActualName = name;
-      strategyVectorCrossover.StrategyParameterParameter.ActualName = name;
-      strategyVectorManipulator.StrategyParameterParameter.ActualName = name;
-    }
-    #endregion
-
-    #region Helpers
-    [StorableHook(HookType.AfterDeserialization)]
-    private void Initialize() {
-      InitializeOperators();
-      SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged);
-      SolutionCreator.RealVectorParameter.ActualNameChanged += new EventHandler(SolutionCreator_RealVectorParameter_ActualNameChanged);
-      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
-      strategyVectorCreator.StrategyParameterParameter.ActualNameChanged += new EventHandler(strategyVectorCreator_StrategyParameterParameter_ActualNameChanged);
-    }
-    private void InitializeOperators() {
-      operators = new List<IOperator>();
-      operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>().Cast<IOperator>());
-      operators.Add(strategyVectorCreator);
-      operators.Add(strategyVectorCrossover);
-      operators.Add(strategyVectorManipulator);
-      ParameterizeOperators();
-    }
-    private void ParameterizeSolutionCreator() {
-      SolutionCreator.LengthParameter.Value = new IntValue(ProblemSize.Value);
-    }
-    private void ParameterizeEvaluator() {
-      Evaluator.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-      Evaluator.SamplesStartParameter.Value = TrainingSamplesStart;
-      Evaluator.SamplesEndParameter.Value = TrainingSamplesEnd;
-      Evaluator.NumberOfFoldsParameter.Value = new IntValue(5);
-    }
-    private void ParameterizeOperators() {
-      foreach (IRealVectorCrossover op in Operators.OfType<IRealVectorCrossover>()) {
-        op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.ChildParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-      foreach (IRealVectorManipulator op in Operators.OfType<IRealVectorManipulator>()) {
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-        op.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-      foreach (IRealVectorMoveOperator op in Operators.OfType<IRealVectorMoveOperator>()) {
-        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-      }
-      foreach (IRealVectorMoveGenerator op in Operators.OfType<IRealVectorMoveGenerator>()) {
-        op.BoundsParameter.ActualName = BoundsParameter.Name;
-      }
-      foreach (SupportVectorRegressionParameterAdjustmentEvaluator op in Operators.OfType<SupportVectorRegressionParameterAdjustmentEvaluator>()) {
-        op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
-        op.ParameterVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
-      }
-    }
-    private void UpdateStrategyVectorBounds() {
-      DoubleMatrix strategyBounds = (DoubleMatrix)Bounds.Clone();
-      for (int i = 0; i < strategyBounds.Rows; i++)
-        if (strategyBounds[i, 0] < 0) strategyBounds[i, 0] = 0;
-      strategyVectorCreator.BoundsParameter.Value = strategyBounds;
-    }
-    #endregion
-  }
-}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 3884)
@@ -41,4 +41,5 @@
   [Item("SupportVectorMachineCrossValidationEvaluator", "Represents an operator that performs SVM cross validation with the given parameters.")]
   public class SupportVectorMachineCrossValidationEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {
+    private const string RandomParameterName = "Random";
     private const string DataAnalysisProblemDataParameterName = "DataAnalysisProblemData";
     private const string SvmTypeParameterName = "SvmType";
@@ -50,8 +51,12 @@
     private const string SamplesStartParameterName = "SamplesStart";
     private const string SamplesEndParameterName = "SamplesEnd";
+    private const string ActualSamplesParameterName = "ActualSamples";
     private const string NumberOfFoldsParameterName = "NumberOfFolds";
     private const string QualityParameterName = "Quality";
 
     #region parameter properties
+    public ILookupParameter<IRandom> RandomParameter {
+      get { return (ILookupParameter<IRandom>)Parameters[RandomParameterName]; }
+    }
     public IValueLookupParameter<DataAnalysisProblemData> DataAnalysisProblemDataParameter {
       get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
@@ -80,4 +85,7 @@
     public IValueLookupParameter<IntValue> SamplesEndParameter {
       get { return (IValueLookupParameter<IntValue>)Parameters[SamplesEndParameterName]; }
+    }
+    public IValueLookupParameter<PercentValue> ActualSamplesParameter {
+      get { return (IValueLookupParameter<PercentValue>)Parameters[ActualSamplesParameterName]; }
     }
     public IValueLookupParameter<IntValue> NumberOfFoldsParameter {
@@ -123,4 +131,5 @@
     public SupportVectorMachineCrossValidationEvaluator()
       : base() {
+      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
       Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
       Parameters.Add(new ValueLookupParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use."));
@@ -132,4 +141,5 @@
       Parameters.Add(new ValueLookupParameter<IntValue>(SamplesStartParameterName, "The first index of the data set partition the support vector machine should use for training."));
       Parameters.Add(new ValueLookupParameter<IntValue>(SamplesEndParameterName, "The last index of the data set partition the support vector machine should use for training."));
+      Parameters.Add(new ValueLookupParameter<PercentValue>(ActualSamplesParameterName, "The percentage of the training set that should be acutally used for cross-validation (samples are picked randomly from the training set)."));
       Parameters.Add(new ValueLookupParameter<IntValue>(NumberOfFoldsParameterName, "The number of folds to use for cross-validation."));
       Parameters.Add(new LookupParameter<DoubleValue>(QualityParameterName, "The cross validation quality reached with the given parameters."));
@@ -137,6 +147,14 @@
 
     public override IOperation Apply() {
-      double quality = PerformCrossValidation(DataAnalysisProblemData,
-                             SamplesStart.Value, SamplesEnd.Value,
+      double reductionRatio = 1.0;
+      if (ActualSamplesParameter.ActualValue != null)
+        reductionRatio = ActualSamplesParameter.ActualValue.Value;
+
+      int reducedRows = (int)((SamplesEnd.Value - SamplesStart.Value) * reductionRatio);
+      var reducedProblemData = (DataAnalysisProblemData)DataAnalysisProblemData.Clone();
+      ShuffleRows(RandomParameter.ActualValue, reducedProblemData.Dataset, SamplesStart.Value, SamplesEnd.Value);
+
+      double quality = PerformCrossValidation(reducedProblemData,
+                             SamplesStart.Value, SamplesStart.Value + reducedRows,
                              SvmType.Value, KernelType.Value,
                              Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value, NumberOfFolds.Value);
@@ -144,4 +162,15 @@
       QualityParameter.ActualValue = new DoubleValue(quality);
       return base.Apply();
+    }
+
+    private void ShuffleRows(IRandom random, Dataset dataset, int start, int end) {
+      for (int row = end - 1; row > start ; row--) {
+        int otherRow = random.Next(start, row);
+        for (int column = 0; column < dataset.Columns; column++) {
+          double tmp = dataset[otherRow, column];
+          dataset[otherRow, column] = dataset[row, column];
+          dataset[row, column] = tmp;
+        }
+      }
     }
 
@@ -178,5 +207,5 @@
       SVM.Problem scaledProblem = Scaling.Scale(rangeTransform, problem);
 
-      return SVM.Training.PerformCrossValidation(scaledProblem, parameter, nFolds);
+      return SVM.Training.PerformCrossValidation(scaledProblem, parameter, nFolds, false);
     }
   }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs	(revision 3883)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModel.cs	(revision 3884)
@@ -29,4 +29,6 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Common;
+using SVM;
+using System.Linq;
 
 namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
@@ -36,5 +38,9 @@
   [StorableClass]
   [Item("SupportVectorMachineModel", "Represents a support vector machine model.")]
-  public class SupportVectorMachineModel : NamedItem {
+  public class SupportVectorMachineModel : NamedItem, IDataAnalysisModel {
+    public SupportVectorMachineModel()
+      : base() {
+    }
+
     private SVM.Model model;
     /// <summary>
@@ -67,6 +73,10 @@
     }
 
-    public SupportVectorMachineModel()
-      : base() {
+    public IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end) {
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, start, end);
+      SVM.Problem scaledProblem = Scaling.Scale(RangeTransform, problem);
+
+      return (from row in Enumerable.Range(0, scaledProblem.Count)
+              select SVM.Prediction.Predict(Model, scaledProblem.X[row])).ToList();
     }
 
@@ -81,4 +91,10 @@
 
     #region persistence
+    [Storable]
+    private int[] SupportVectorIndizes {
+      get { return this.Model.SupportVectorIndizes; }
+      set { this.Model.SupportVectorIndizes = value; }
+    }
+
     [Storable]
     private string ModelAsString {
@@ -131,5 +147,5 @@
       StreamWriter writer = new StreamWriter(s);
       writer.WriteLine("RangeTransform:");
-      writer.Flush(); 
+      writer.Flush();
       using (MemoryStream memStream = new MemoryStream()) {
         SVM.RangeTransform.Write(memStream, model.RangeTransform);
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ISymbolicRegressionEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/ISymbolicRegressionEvaluator.cs	(revision 3883)
+++ 	(revision )
@@ -1,42 +1,0 @@
-#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2010 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.Linq;
-using System.Drawing;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Optimization;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.PluginInfrastructure;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Problems.DataAnalysis;
-
-namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
-  public interface ISymbolicRegressionEvaluator : ISingleObjectiveEvaluator {
-    ILookupParameter<SymbolicExpressionTree> FunctionTreeParameter { get; }
-    ILookupParameter<RegressionProblemData> RegressionProblemDataParameter { get; }
-    ILookupParameter<DoubleValue> NumberOfEvaluatedNodesParameter { get; }
-  }
-}
