Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorRegressionParameterAdjustmentEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorRegressionParameterAdjustmentEvaluator.cs	(revision 3877)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorRegressionParameterAdjustmentEvaluator.cs	(revision 3877)
@@ -0,0 +1,147 @@
+#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 3877)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/ParameterAdjustmentProblem/SupportVectorRegressionParameterAdjustmentProblem.cs	(revision 3877)
@@ -0,0 +1,269 @@
+﻿#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 3877)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineCrossValidationEvaluator.cs	(revision 3877)
@@ -0,0 +1,183 @@
+﻿#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;
+using HeuristicLab.Data;
+using System.Threading;
+using HeuristicLab.LibSVM;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using SVM;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Optimization;
+
+namespace HeuristicLab.Problems.DataAnalysis.SupportVectorMachine {
+  /// <summary>
+  /// Represents an operator that performs SVM cross validation with the given parameters.
+  /// </summary>
+  [StorableClass]
+  [Item("SupportVectorMachineCrossValidationEvaluator", "Represents an operator that performs SVM cross validation with the given parameters.")]
+  public class SupportVectorMachineCrossValidationEvaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {
+    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 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 DataAnalysisProblemData DataAnalysisProblemData {
+      get { return DataAnalysisProblemDataParameter.ActualValue; }
+    }
+    public StringValue SvmType {
+      get { return SvmTypeParameter.ActualValue; }
+    }
+    public StringValue KernelType {
+      get { return KernelTypeParameter.ActualValue; }
+    }
+    public DoubleValue Nu {
+      get { return NuParameter.ActualValue; }
+    }
+    public DoubleValue Cost {
+      get { return CostParameter.ActualValue; }
+    }
+    public DoubleValue Gamma {
+      get { return GammaParameter.ActualValue; }
+    }
+    public DoubleValue Epsilon {
+      get { return EpsilonParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
+    public IntValue NumberOfFolds {
+      get { return NumberOfFoldsParameter.ActualValue; }
+    }
+    #endregion
+
+    public SupportVectorMachineCrossValidationEvaluator()
+      : base() {
+      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."));
+      Parameters.Add(new ValueLookupParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM."));
+      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 for 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."));
+    }
+
+    public override IOperation Apply() {
+      double quality = PerformCrossValidation(DataAnalysisProblemData,
+                             SamplesStart.Value, SamplesEnd.Value,
+                             SvmType.Value, KernelType.Value,
+                             Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value, NumberOfFolds.Value);
+
+      QualityParameter.ActualValue = new DoubleValue(quality);
+      return base.Apply();
+    }
+
+    private static double PerformCrossValidation(
+      DataAnalysisProblemData problemData,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon,
+      int nFolds) {
+      return PerformCrossValidation(problemData, problemData.TrainingSamplesStart.Value, problemData.TrainingSamplesEnd.Value, svmType, kernelType, cost, nu, gamma, epsilon, nFolds);
+    }
+
+    public static double PerformCrossValidation(
+      DataAnalysisProblemData problemData,
+      int start, int end,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon,
+      int nFolds) {
+      int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
+
+      //extract SVM parameters from scope and set them
+      SVM.Parameter parameter = new SVM.Parameter();
+      parameter.SvmType = (SVM.SvmType)Enum.Parse(typeof(SVM.SvmType), svmType, true);
+      parameter.KernelType = (SVM.KernelType)Enum.Parse(typeof(SVM.KernelType), kernelType, true);
+      parameter.C = cost;
+      parameter.Nu = nu;
+      parameter.Gamma = gamma;
+      parameter.P = epsilon;
+      parameter.CacheSize = 500;
+      parameter.Probability = false;
+
+
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, start, end);
+      SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
+      SVM.Problem scaledProblem = Scaling.Scale(rangeTransform, problem);
+
+      return SVM.Training.PerformCrossValidation(scaledProblem, parameter, nFolds);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs	(revision 3855)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/SupportVectorMachine/SupportVectorMachineModelCreator.cs	(revision 3877)
@@ -46,4 +46,7 @@
     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 ModelParameterName = "SupportVectorMachineModel";
 
@@ -52,9 +55,9 @@
       get { return (IValueLookupParameter<DataAnalysisProblemData>)Parameters[DataAnalysisProblemDataParameterName]; }
     }
-    public IValueParameter<StringValue> SvmTypeParameter {
-      get { return (IValueParameter<StringValue>)Parameters[SvmTypeParameterName]; }
+    public IValueLookupParameter<StringValue> SvmTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[SvmTypeParameterName]; }
     }
-    public IValueParameter<StringValue> KernelTypeParameter {
-      get { return (IValueParameter<StringValue>)Parameters[KernelTypeParameterName]; }
+    public IValueLookupParameter<StringValue> KernelTypeParameter {
+      get { return (IValueLookupParameter<StringValue>)Parameters[KernelTypeParameterName]; }
     }
     public IValueLookupParameter<DoubleValue> NuParameter {
@@ -66,4 +69,13 @@
     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 ILookupParameter<SupportVectorMachineModel> SupportVectorMachineModelParameter {
@@ -90,44 +102,36 @@
       get { return GammaParameter.ActualValue; }
     }
+    public DoubleValue Epsilon {
+      get { return EpsilonParameter.ActualValue; }
+    }
+    public IntValue SamplesStart {
+      get { return SamplesStartParameter.ActualValue; }
+    }
+    public IntValue SamplesEnd {
+      get { return SamplesEndParameter.ActualValue; }
+    }
     #endregion
 
     public SupportVectorMachineModelCreator()
       : base() {
-      #region svm types
-      StringValue cSvcType = new StringValue("C_SVC").AsReadOnly();
-      StringValue nuSvcType = new StringValue("NU_SVC").AsReadOnly();
-      StringValue eSvrType = new StringValue("EPSILON_SVR").AsReadOnly();
       StringValue nuSvrType = new StringValue("NU_SVR").AsReadOnly();
-      ItemSet<StringValue> allowedSvmTypes = new ItemSet<StringValue>();
-      allowedSvmTypes.Add(cSvcType);
-      allowedSvmTypes.Add(nuSvcType);
-      allowedSvmTypes.Add(eSvrType);
-      allowedSvmTypes.Add(nuSvrType);
-      #endregion
-      #region kernel types
       StringValue rbfKernelType = new StringValue("RBF").AsReadOnly();
-      StringValue linearKernelType = new StringValue("LINEAR").AsReadOnly();
-      StringValue polynomialKernelType = new StringValue("POLY").AsReadOnly();
-      StringValue sigmoidKernelType = new StringValue("SIGMOID").AsReadOnly();
-      ItemSet<StringValue> allowedKernelTypes = new ItemSet<StringValue>();
-      allowedKernelTypes.Add(rbfKernelType);
-      allowedKernelTypes.Add(linearKernelType);
-      allowedKernelTypes.Add(polynomialKernelType);
-      allowedKernelTypes.Add(sigmoidKernelType);
-      #endregion
       Parameters.Add(new ValueLookupParameter<DataAnalysisProblemData>(DataAnalysisProblemDataParameterName, "The data analysis problem data to use for training."));
-      Parameters.Add(new ConstrainedValueParameter<StringValue>(SvmTypeParameterName, "The type of SVM to use.", allowedSvmTypes, nuSvrType));
-      Parameters.Add(new ConstrainedValueParameter<StringValue>(KernelTypeParameterName, "The kernel type to use for the SVM.", allowedKernelTypes, rbfKernelType));
+      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 for 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 LookupParameter<SupportVectorMachineModel>(ModelParameterName, "The result model generated by the SVM."));
     }
 
     public override IOperation Apply() {
-
       SupportVectorMachineModel model = TrainModel(DataAnalysisProblemData,
+                             SamplesStart.Value, SamplesEnd.Value,
                              SvmType.Value, KernelType.Value,
-                             Cost.Value, Nu.Value, Gamma.Value);
+                             Cost.Value, Nu.Value, Gamma.Value, Epsilon.Value);
       SupportVectorMachineModelParameter.ActualValue = model;
 
@@ -135,8 +139,16 @@
     }
 
+    private static SupportVectorMachineModel TrainModel(
+      DataAnalysisProblemData problemData,
+      string svmType, string kernelType,
+      double cost, double nu, double gamma, double epsilon) {
+      return TrainModel(problemData, problemData.TrainingSamplesStart.Value, problemData.TrainingSamplesEnd.Value, svmType, kernelType, cost, nu, gamma, epsilon);
+    }
+
     public static SupportVectorMachineModel TrainModel(
       DataAnalysisProblemData problemData,
+      int start, int end,
       string svmType, string kernelType,
-      double cost, double nu, double gamma) {
+      double cost, double nu, double gamma, double epsilon) {
       int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
 
@@ -148,13 +160,13 @@
       parameter.Nu = nu;
       parameter.Gamma = gamma;
+      parameter.P = epsilon;
       parameter.CacheSize = 500;
       parameter.Probability = false;
 
 
-      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, problemData.TrainingSamplesStart.Value, problemData.TrainingSamplesEnd.Value);
+      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(problemData, start, end);
       SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
       SVM.Problem scaledProblem = Scaling.Scale(rangeTransform, problem);
       var model = new SupportVectorMachineModel();
-
       model.Model = SVM.Training.Train(scaledProblem, parameter);
       model.RangeTransform = rangeTransform;
