Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Analyzers/RegressionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Analyzers/RegressionSolutionAnalyzer.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Analyzers/RegressionSolutionAnalyzer.cs	(revision 4468)
@@ -121,15 +121,10 @@
       var solution = bestSolution;
       #region update R2,MSE, Rel Error
-      IEnumerable<double> trainingValues = problemData.Dataset.GetEnumeratedVariableValues(
-        problemData.TargetVariable.Value,
-        problemData.TrainingSamplesStart.Value,
-        problemData.TrainingSamplesEnd.Value);
-      IEnumerable<double> testValues = problemData.Dataset.GetEnumeratedVariableValues(
-        problemData.TargetVariable.Value,
-        problemData.TestSamplesStart.Value,
-        problemData.TestSamplesEnd.Value);
+      IEnumerable<double> trainingValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable.Value, problemData.TrainingIndizes);
+      IEnumerable<double> testValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable.Value, problemData.TestIndizes);
       OnlineMeanSquaredErrorEvaluator mseEvaluator = new OnlineMeanSquaredErrorEvaluator();
       OnlineMeanAbsolutePercentageErrorEvaluator relErrorEvaluator = new OnlineMeanAbsolutePercentageErrorEvaluator();
       OnlinePearsonsRSquaredEvaluator r2Evaluator = new OnlinePearsonsRSquaredEvaluator();
+
       #region training
       var originalEnumerator = trainingValues.GetEnumerator();
@@ -144,7 +139,9 @@
       double trainingRelError = relErrorEvaluator.MeanAbsolutePercentageError;
       #endregion
+
       mseEvaluator.Reset();
       relErrorEvaluator.Reset();
       r2Evaluator.Reset();
+
       #region test
       originalEnumerator = testValues.GetEnumerator();
@@ -159,4 +156,5 @@
       double testRelError = relErrorEvaluator.MeanAbsolutePercentageError;
       #endregion
+
       if (results.ContainsKey(BestSolutionResultName)) {
         results[BestSolutionResultName].Value = solution;
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs	(revision 4468)
@@ -91,10 +91,11 @@
         var model = new SymbolicRegressionModel((ISymbolicExpressionTreeInterpreter)SymbolicExpressionTreeInterpreter.Clone(),
           SymbolicExpressionTree[i]);
-        var solution = new SymbolicRegressionSolution(ProblemData, model, lowerEstimationLimit, upperEstimationLimit);
+        DataAnalysisProblemData problemDataClone = (DataAnalysisProblemData)ProblemData.Clone();
+        var solution = new SymbolicRegressionSolution(problemDataClone, model, lowerEstimationLimit, upperEstimationLimit);
         solution.Name = BestSolutionParameterName;
         solution.Description = "Best solution on validation partition found over the whole run.";
         BestSolutionParameter.ActualValue = solution;
         BestSolutionQualityParameter.ActualValue = Quality[i];
-        BestSymbolicRegressionSolutionAnalyzer.UpdateSymbolicRegressionBestSolutionResults(solution, ProblemData, Results, VariableFrequencies);
+        BestSymbolicRegressionSolutionAnalyzer.UpdateSymbolicRegressionBestSolutionResults(solution, problemDataClone, Results, VariableFrequencies);
       }
       return BestSolutionParameter.ActualValue;
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/FixedValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 4468)
@@ -212,5 +212,6 @@
       int count = (int)((validationEnd - validationStart) * RelativeNumberOfEvaluatedSamples.Value);
       if (count == 0) count = 1;
-      IEnumerable<int> rows = RandomEnumerable.SampleRandomNumbers(seed, validationStart, validationEnd, count);
+      IEnumerable<int> rows = RandomEnumerable.SampleRandomNumbers(seed, validationStart, validationEnd, count)
+        .Where(row => row < ProblemData.TestSamplesStart.Value || ProblemData.TestSamplesEnd.Value <= row);
 
       double upperEstimationLimit = UpperEstimationLimit != null ? UpperEstimationLimit.Value : double.PositiveInfinity;
@@ -241,11 +242,8 @@
         // calculate scaling parameters and only for the best tree using the full training set
         double alpha, beta;
-        int trainingStart = ProblemData.TrainingSamplesStart.Value;
-        int trainingEnd = ProblemData.TrainingSamplesEnd.Value;
-        IEnumerable<int> trainingRows = Enumerable.Range(trainingStart, trainingEnd - trainingStart);
         SymbolicRegressionScaledMeanSquaredErrorEvaluator.Calculate(SymbolicExpressionTreeInterpreter, bestTree,
           lowerEstimationLimit, upperEstimationLimit,
           ProblemData.Dataset, targetVariable,
-          trainingRows, out beta, out alpha);
+          ProblemData.TrainingIndizes, out beta, out alpha);
 
         // scale tree for solution
@@ -253,5 +251,5 @@
         var model = new SymbolicRegressionModel((ISymbolicExpressionTreeInterpreter)SymbolicExpressionTreeInterpreter.Clone(),
           scaledTree);
-        var solution = new SymbolicRegressionSolution(ProblemData, model, lowerEstimationLimit, upperEstimationLimit);
+        var solution = new SymbolicRegressionSolution((DataAnalysisProblemData)ProblemData.Clone(), model, lowerEstimationLimit, upperEstimationLimit);
         solution.Name = BestSolutionParameterName;
         solution.Description = "Best solution on validation partition found over the whole run.";
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityAnalyzer.cs	(revision 4468)
@@ -137,6 +137,4 @@
       Analyze(SymbolicExpressionTreeParameter.ActualValue, SymbolicExpressionTreeInterpreterParameter.ActualValue,
         UpperEstimationLimit.Value, LowerEstimationLimit.Value, ProblemDataParameter.ActualValue,
-        ProblemDataParameter.ActualValue.TrainingSamplesStart.Value, ProblemDataParameter.ActualValue.TrainingSamplesEnd.Value,
-        ProblemDataParameter.ActualValue.TestSamplesStart.Value, ProblemDataParameter.ActualValue.TestSamplesEnd.Value,
         ResultsParameter.ActualValue);
       return base.Apply();
@@ -145,8 +143,8 @@
     public static void Analyze(IEnumerable<SymbolicExpressionTree> trees, ISymbolicExpressionTreeInterpreter interpreter,
       double upperEstimationLimit, double lowerEstimationLimit,
-      DataAnalysisProblemData problemData, int trainingStart, int trainingEnd, int testStart, int testEnd, ResultCollection results) {
+      DataAnalysisProblemData problemData, ResultCollection results) {
       int targetVariableIndex = problemData.Dataset.GetVariableIndex(problemData.TargetVariable.Value);
-      IEnumerable<double> originalTrainingValues = problemData.Dataset.GetEnumeratedVariableValues(targetVariableIndex, trainingStart, trainingEnd);
-      IEnumerable<double> originalTestValues = problemData.Dataset.GetEnumeratedVariableValues(targetVariableIndex, testStart, testEnd);
+      IEnumerable<double> originalTrainingValues = problemData.Dataset.GetEnumeratedVariableValues(targetVariableIndex, problemData.TrainingIndizes);
+      IEnumerable<double> originalTestValues = problemData.Dataset.GetEnumeratedVariableValues(targetVariableIndex, problemData.TestIndizes);
       List<double> trainingMse = new List<double>();
       List<double> trainingR2 = new List<double>();
@@ -162,5 +160,5 @@
       foreach (var tree in trees) {
         #region training
-        var estimatedTrainingValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, Enumerable.Range(trainingStart, trainingEnd - trainingStart));
+        var estimatedTrainingValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TrainingIndizes);
         mseEvaluator.Reset();
         r2Evaluator.Reset();
@@ -184,5 +182,5 @@
         #endregion
         #region test
-        var estimatedTestValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, Enumerable.Range(testStart, testEnd - testStart));
+        var estimatedTestValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TestIndizes);
 
         mseEvaluator.Reset();
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityCalculator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityCalculator.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionModelQualityCalculator.cs	(revision 4468)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
@@ -35,4 +36,5 @@
   [Item("SymbolicRegressionModelQualityCalculator", "An operator to calculate the quality values of a symbolic regression solution symbolic expression tree encoding.")]
   [StorableClass]
+  [Obsolete("This class should not be used anymore because of performance reasons and will therefore not be updated.")]
   public sealed class SymbolicRegressionModelQualityCalculator : AlgorithmOperator {
     private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionTournamentPruning.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionTournamentPruning.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/SymbolicRegressionTournamentPruning.cs	(revision 4468)
@@ -28,7 +28,7 @@
 using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.DataAnalysis.Symbolic;
 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
 namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Analyzers {
@@ -241,5 +241,6 @@
       double lowerEstimationLimit, double upperEstimationLimit,
       double maxPruningRatio, double qualityGainWeight) {
-      IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);
+        IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart)
+          .Where(i => i < problemData.TestSamplesStart.Value || problemData.TestSamplesEnd.Value <= i);
       int originalSize = tree.Size;
       double originalQuality = evaluator.Evaluate(interpreter, tree,
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/ValidationBestScaledSymbolicRegressionSolutionAnalyzer.cs	(revision 4468)
@@ -39,4 +39,5 @@
   [Item("ValidationBestScaledSymbolicRegressionSolutionAnalyzer", "An operator that analyzes the validation best scaled symbolic regression solution.")]
   [StorableClass]
+  [Obsolete("This class should not be used anymore because of performance reasons and will therefore not be updated.")]
   public sealed class ValidationBestScaledSymbolicRegressionSolutionAnalyzer : AlgorithmOperator, ISymbolicRegressionAnalyzer {
     private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionEvaluator.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/MultiObjectiveSymbolicRegressionEvaluator.cs	(revision 4468)
@@ -20,6 +20,6 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
@@ -122,5 +122,6 @@
     public override IOperation Apply() {
       int seed = Random.Next();
-      IEnumerable<int> rows = SingleObjectiveSymbolicRegressionEvaluator.GenerateRowsToEvaluate(seed, RelativeNumberOfEvaluatedSamples.Value, SamplesStart.Value, SamplesEnd.Value);
+      IEnumerable<int> rows = SingleObjectiveSymbolicRegressionEvaluator.GenerateRowsToEvaluate(seed, RelativeNumberOfEvaluatedSamples.Value, SamplesStart.Value, SamplesEnd.Value)
+         .Where(i => i < RegressionProblemData.TestSamplesStart.Value || RegressionProblemData.TestSamplesEnd.Value <= i);
       double[] qualities = Evaluate(SymbolicExpressionTreeInterpreter, SymbolicExpressionTree, RegressionProblemData.Dataset,
         RegressionProblemData.TargetVariable, rows);
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Evaluators/SingleObjectiveSymbolicRegressionEvaluator.cs	(revision 4468)
@@ -22,4 +22,5 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
@@ -140,5 +141,6 @@
     public override IOperation Apply() {
       int seed = Random.Next();
-      IEnumerable<int> rows = GenerateRowsToEvaluate(seed, RelativeNumberOfEvaluatedSamples.Value, SamplesStart.Value, SamplesEnd.Value);
+      IEnumerable<int> rows = GenerateRowsToEvaluate(seed, RelativeNumberOfEvaluatedSamples.Value, SamplesStart.Value, SamplesEnd.Value)
+          .Where(i => i < RegressionProblemData.TestSamplesStart.Value || RegressionProblemData.TestSamplesEnd.Value <= i);
       double quality = Evaluate(SymbolicExpressionTreeInterpreter, SymbolicExpressionTree, LowerEstimationLimit.Value, UpperEstimationLimit.Value,
         RegressionProblemData.Dataset,
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs	(revision 4468)
@@ -68,5 +68,8 @@
 
     public IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, int start, int end) {
-      return interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, Enumerable.Range(start, end - start));
+      return GetEstimatedValues(problemData, Enumerable.Range(start, end - start));
+    }
+    public IEnumerable<double> GetEstimatedValues(DataAnalysisProblemData problemData, IEnumerable<int> rows) {
+      return interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, rows);
     }
 
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs	(revision 4468)
@@ -170,4 +170,5 @@
           fixedBestValidationSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
         }
+
         var bestValidationSolutionAnalyzer = analyzer as ValidationBestScaledSymbolicRegressionSolutionAnalyzer;
         if (bestValidationSolutionAnalyzer != null) {
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs	(revision 4468)
@@ -125,10 +125,10 @@
     }
     public IntValue TrainingSamplesStart {
-      get { return new IntValue(DataAnalysisProblemData.TrainingSamplesStart.Value); }
+      get { return new IntValue(DataAnalysisProblemData.TrainingIndizes.First()); }
     }
     public IntValue TrainingSamplesEnd {
       get {
-        return new IntValue((DataAnalysisProblemData.TrainingSamplesStart.Value +
-          DataAnalysisProblemData.TrainingSamplesEnd.Value) / 2);
+        int endIndex = (int)(DataAnalysisProblemData.TrainingIndizes.Count() * (1.0 - DataAnalysisProblemData.ValidationPercentage.Value));
+        return new IntValue(DataAnalysisProblemData.TrainingIndizes.ElementAt(endIndex));
       }
     }
@@ -137,5 +137,5 @@
     }
     public IntValue ValidationSamplesEnd {
-      get { return new IntValue(DataAnalysisProblemData.TrainingSamplesEnd.Value); }
+      get { return new IntValue(DataAnalysisProblemData.TrainingIndizes.Last() + 1); }
     }
     public IntValue TestSamplesStart {
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs	(revision 4468)
@@ -67,24 +67,20 @@
       get {
         if (estimatedValues == null) RecalculateEstimatedValues();
-        return estimatedValues.AsEnumerable();
+        return estimatedValues;
       }
     }
 
     public override IEnumerable<double> EstimatedTrainingValues {
-      get {
-        if (estimatedValues == null) RecalculateEstimatedValues();
-        int start = ProblemData.TrainingSamplesStart.Value;
-        int n = ProblemData.TrainingSamplesEnd.Value - start;
-        return estimatedValues.Skip(start).Take(n).ToList();
-      }
+      get { return GetEstimatedValues(ProblemData.TrainingIndizes); }
     }
 
     public override IEnumerable<double> EstimatedTestValues {
-      get {
-        if (estimatedValues == null) RecalculateEstimatedValues();
-        int start = ProblemData.TestSamplesStart.Value;
-        int n = ProblemData.TestSamplesEnd.Value - start;
-        return estimatedValues.Skip(start).Take(n).ToList();
-      }
+      get { return GetEstimatedValues(ProblemData.TestIndizes); }
+    }
+
+    public virtual IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) {
+      if (estimatedValues == null) RecalculateEstimatedValues();
+      foreach (int row in rows)
+        yield return estimatedValues[row];
     }
   }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ResultsView.cs	(revision 4468)
@@ -77,6 +77,6 @@
         matrix.SortableView = false;
 
-        IEnumerable<double> originalTrainingValues = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value, Content.ProblemData.TrainingSamplesStart.Value, Content.ProblemData.TrainingSamplesEnd.Value);
-        IEnumerable<double> originalTestValues = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value, Content.ProblemData.TestSamplesStart.Value, Content.ProblemData.TestSamplesEnd.Value);
+        IEnumerable<double> originalTrainingValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable.Value, Content.ProblemData.TrainingIndizes);
+        IEnumerable<double> originalTestValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable.Value, Content.ProblemData.TestIndizes);
         matrix[0, 0] = SimpleMSEEvaluator.Calculate(originalTrainingValues, Content.EstimatedTrainingValues);
         matrix[0, 1] = SimpleMSEEvaluator.Calculate(originalTestValues, Content.EstimatedTestValues);
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/ScatterPlotView.cs	(revision 4468)
@@ -127,8 +127,4 @@
         string targetVariableName = Content.ProblemData.TargetVariable.Value;
         Dataset dataset = Content.ProblemData.Dataset;
-        int trainingStart = Content.ProblemData.TrainingSamplesStart.Value;
-        int trainingEnd = Content.ProblemData.TrainingSamplesEnd.Value;
-        int testStart = Content.ProblemData.TestSamplesStart.Value;
-        int testEnd = Content.ProblemData.TestSamplesEnd.Value;
         if (this.chart.Series[ALL_SERIES].Points.Count > 0)
           this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.EstimatedValues.ToArray(), "",
@@ -136,8 +132,8 @@
         if (this.chart.Series[TRAINING_SERIES].Points.Count > 0)
           this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "",
-            dataset.GetVariableValues(targetVariableName, trainingStart, trainingEnd), "");
+            dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray(), "");
         if (this.chart.Series[TEST_SERIES].Points.Count > 0)
           this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "",
-            dataset.GetVariableValues(targetVariableName, testStart, testEnd), "");
+           dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray(), "");
 
         double max = Math.Max(Content.EstimatedValues.Max(), dataset.GetVariableValues(targetVariableName).Max());
@@ -168,9 +164,4 @@
       } else if (Content != null) {
         string targetVariableName = Content.ProblemData.TargetVariable.Value;
-        Dataset dataset = Content.ProblemData.Dataset;
-        int trainingStart = Content.ProblemData.TrainingSamplesStart.Value;
-        int trainingEnd = Content.ProblemData.TrainingSamplesEnd.Value;
-        int testStart = Content.ProblemData.TestSamplesStart.Value;
-        int testEnd = Content.ProblemData.TestSamplesEnd.Value;
 
         IEnumerable<double> predictedValues = null;
@@ -178,14 +169,14 @@
         switch (series.Name) {
           case ALL_SERIES:
-            predictedValues = Content.EstimatedValues;
-            targetValues = dataset.GetVariableValues(targetVariableName);
+            predictedValues = Content.EstimatedValues.ToArray();
+            targetValues = Content.ProblemData.Dataset.GetVariableValues(targetVariableName);
             break;
           case TRAINING_SERIES:
-            predictedValues = Content.EstimatedTrainingValues;
-            targetValues = dataset.GetVariableValues(targetVariableName, trainingStart, trainingEnd);
+            predictedValues = Content.EstimatedTrainingValues.ToArray();
+            targetValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray();
             break;
           case TEST_SERIES:
-            predictedValues = Content.EstimatedTestValues;
-            targetValues = dataset.GetVariableValues(targetVariableName, testStart, testEnd);
+            predictedValues = Content.EstimatedTestValues.ToArray();
+            targetValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray();
             break;
         }
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs	(revision 4467)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisProblemData.cs	(revision 4468)
@@ -35,4 +35,7 @@
   public class DataAnalysisProblemData : ParameterizedNamedItem, IStorableContent {
     protected bool suppressEvents = false;
+    #region IStorableContent Members
+    public string Filename { get; set; }
+    #endregion
     #region default data
     // y = x^4 + x^3 + x^2 + x
@@ -87,9 +90,12 @@
       get { return (IValueParameter<IntValue>)Parameters["TestSamplesEnd"]; }
     }
+    public IValueParameter<PercentValue> ValidationPercentageParameter {
+      get { return (IValueParameter<PercentValue>)Parameters["ValidationPercentage"]; }
+    }
     #endregion
 
     #region properties
     public Dataset Dataset {
-      get { return (Dataset)DatasetParameter.Value; }
+      get { return DatasetParameter.Value; }
       set {
         if (value != Dataset) {
@@ -100,5 +106,5 @@
     }
     public StringValue TargetVariable {
-      get { return (StringValue)TargetVariableParameter.Value; }
+      get { return TargetVariableParameter.Value; }
       set {
         if (value != TargetVariableParameter.Value) {
@@ -110,5 +116,5 @@
     }
     public ICheckedItemList<StringValue> InputVariables {
-      get { return (ICheckedItemList<StringValue>)InputVariablesParameter.Value; }
+      get { return InputVariablesParameter.Value; }
       set {
         if (value != InputVariables) {
@@ -120,5 +126,5 @@
     }
     public IntValue TrainingSamplesStart {
-      get { return (IntValue)TrainingSamplesStartParameter.Value; }
+      get { return TrainingSamplesStartParameter.Value; }
       set {
         if (value != TrainingSamplesStart) {
@@ -130,5 +136,5 @@
     }
     public IntValue TrainingSamplesEnd {
-      get { return (IntValue)TrainingSamplesEndParameter.Value; }
+      get { return TrainingSamplesEndParameter.Value; }
       set {
         if (value != TrainingSamplesEnd) {
@@ -140,5 +146,5 @@
     }
     public IntValue TestSamplesStart {
-      get { return (IntValue)TestSamplesStartParameter.Value; }
+      get { return TestSamplesStartParameter.Value; }
       set {
         if (value != TestSamplesStart) {
@@ -150,5 +156,5 @@
     }
     public IntValue TestSamplesEnd {
-      get { return (IntValue)TestSamplesEndParameter.Value; }
+      get { return TestSamplesEndParameter.Value; }
       set {
         if (value != TestSamplesEnd) {
@@ -159,9 +165,30 @@
       }
     }
-    #endregion
-
-    #region IStorableContent Members
-    public string Filename { get; set; }
-    #endregion
+    public PercentValue ValidationPercentage {
+      get { return ValidationPercentageParameter.Value; }
+      set {
+        if (value != ValidationPercentage) {
+          if (value == null) throw new ArgumentNullException();
+          if (value.Value < 0 || value.Value > 1) throw new ArgumentException("ValidationPercentage must be between 0 and 1.");
+          if (ValidationPercentage != null) DeregisterValueTypeEventHandlers(ValidationPercentage);
+          ValidationPercentageParameter.Value = value;
+        }
+      }
+    }
+
+    public IEnumerable<int> TrainingIndizes {
+      get {
+        return Enumerable.Range(TrainingSamplesStart.Value, TrainingSamplesEnd.Value - TrainingSamplesStart.Value)
+                         .Where(i => i > 0 && i < Dataset.Rows && (i < TestSamplesStart.Value || TestSamplesEnd.Value <= i));
+      }
+    }
+    public IEnumerable<int> TestIndizes {
+      get {
+        return Enumerable.Range(TestSamplesStart.Value, TestSamplesEnd.Value - TestSamplesStart.Value)
+           .Where(i => i > 0 && i < Dataset.Rows);
+      }
+    }
+    #endregion
+
 
     public DataAnalysisProblemData()
@@ -180,4 +207,5 @@
       Parameters.Add(new ValueParameter<IntValue>("TestSamplesStart", new IntValue(15)));
       Parameters.Add(new ValueParameter<IntValue>("TestSamplesEnd", new IntValue(25)));
+      Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
       RegisterParameterEventHandlers();
       RegisterParameterValueEventHandlers();
@@ -200,4 +228,5 @@
       Parameters.Add(new ValueParameter<IntValue>("TestSamplesStart", new IntValue(testSamplesStart)));
       Parameters.Add(new ValueParameter<IntValue>("TestSamplesEnd", new IntValue(testSamplesEnd)));
+      Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
       RegisterParameterEventHandlers();
       RegisterParameterValueEventHandlers();
@@ -209,4 +238,7 @@
     [StorableHook(HookType.AfterDeserialization)]
     private void AfterDeserializationHook() {
+      if (!Parameters.ContainsKey("ValidationPercentage"))
+        Parameters.Add(new ValueParameter<PercentValue>("ValidationPercentage", "The relative amount of the training samples that should be used as validation set.", new PercentValue(0.5)));
+
       RegisterParameterEventHandlers();
       RegisterParameterValueEventHandlers();
@@ -230,4 +262,5 @@
       TestSamplesStartParameter.ValueChanged += new EventHandler(TestSamplesStartParameter_ValueChanged);
       TestSamplesEndParameter.ValueChanged += new EventHandler(TestSamplesEndParameter_ValueChanged);
+      ValidationPercentageParameter.ValueChanged += new EventHandler(ValidationPercentageParameter_ValueChanged);
     }
 
@@ -239,4 +272,5 @@
       RegisterValueTypeEventHandlers(TestSamplesStart);
       RegisterValueTypeEventHandlers(TestSamplesEnd);
+      RegisterValueTypeEventHandlers(ValidationPercentage);
     }
 
@@ -270,4 +304,8 @@
     private void TestSamplesEndParameter_ValueChanged(object sender, EventArgs e) {
       RegisterValueTypeEventHandlers(TestSamplesEnd);
+      OnProblemDataChanged(EventArgs.Empty);
+    }
+    private void ValidationPercentageParameter_ValueChanged(object sender, EventArgs e) {
+      RegisterValueTypeEventHandlers(ValidationPercentage);
       OnProblemDataChanged(EventArgs.Empty);
     }
