Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 15001)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 15002)
@@ -137,4 +137,8 @@
           stopButton.Enabled = (Content.ExecutionState == ExecutionState.Started) || (Content.ExecutionState == ExecutionState.Paused);
           resetButton.Enabled = Content.ExecutionState != ExecutionState.Started;
+          shuffleSamplesCheckBox.Checked = Content.ShuffleSamples.Value;
+          // prevent changing the shuffle if the algorithm is not finished
+          shuffleSamplesCheckBox.Enabled = Content.ExecutionState == ExecutionState.Prepared ||
+                                           Content.ExecutionState == ExecutionState.Stopped;
         }
       }
Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs	(revision 15001)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs	(revision 15002)
@@ -40,5 +40,6 @@
   [StorableClass]
   public sealed class CrossValidation : ParameterizedNamedItem, IAlgorithm, IStorableContent {
-    private IDataAnalysisProblemData shuffledProblemData;
+    [Storable]
+    private int seed;
 
     public CrossValidation()
@@ -94,4 +95,6 @@
       samplesEnd = cloner.Clone(original.samplesEnd);
       shuffleSamples = cloner.Clone(original.shuffleSamples);
+      seed = original.seed;
+
       RegisterEvents();
       if (Algorithm != null) RegisterAlgorithmEvents();
@@ -279,4 +282,6 @@
         throw new InvalidOperationException(string.Format("Start not allowed in execution state \"{0}\".", ExecutionState));
 
+      seed = new FastRandom().NextInt();
+
       if (Algorithm != null) {
         //create cloned algorithms
@@ -287,7 +292,8 @@
             var cloner = new Cloner();
             if (ShuffleSamples.Value) {
+              var random = new FastRandom(seed);
               var dataAnalysisProblem = (IDataAnalysisProblem)algorithm.Problem;
               var dataset = (Dataset)dataAnalysisProblem.ProblemData.Dataset;
-              shuffledDataset = shuffledDataset ?? dataset.Shuffle(new FastRandom());
+              shuffledDataset = shuffledDataset ?? dataset.Shuffle(random);
               cloner.RegisterClonedObject(dataset, shuffledDataset);
             }
@@ -316,12 +322,4 @@
             clonedAlgorithm.Prepare();
             clonedAlgorithms.Add(clonedAlgorithm);
-          }
-          // save the shuffled problem data because it is necessary when creating the ensemble solution
-          if (shuffledProblemData == null && shuffledDataset != null) {
-            var dataAnalysisProblem = (IDataAnalysisProblem)algorithm.Problem;
-            var dataset = (Dataset)dataAnalysisProblem.ProblemData.Dataset;
-            var cloner = new Cloner();
-            cloner.RegisterClonedObject(dataset, shuffledDataset);
-            shuffledProblemData = cloner.Clone(dataAnalysisProblem.ProblemData);
           }
         }
@@ -446,7 +444,11 @@
         // clone manually to correctly clone references between cloned root objects 
         Cloner cloner = new Cloner();
-        var problemDataClone = ShuffleSamples.Value
-          ? (IRegressionProblemData)cloner.Clone(shuffledProblemData)
-          : (IRegressionProblemData)cloner.Clone(Problem.ProblemData);
+        if (ShuffleSamples.Value) {
+          var dataset = (Dataset)Problem.ProblemData.Dataset;
+          var random = new FastRandom(seed);
+          var shuffledDataset = dataset.Shuffle(random);
+          cloner.RegisterClonedObject(dataset, shuffledDataset);
+        }
+        var problemDataClone = (IRegressionProblemData)cloner.Clone(Problem.ProblemData);
         // set partitions of problem data clone correctly
         problemDataClone.TrainingPartition.Start = SamplesStart.Value; problemDataClone.TrainingPartition.End = SamplesEnd.Value;
@@ -479,7 +481,10 @@
         // at least one algorithm (GBT with logistic regression loss) produces a classification solution even though the original problem is a regression problem.
         var targetVariable = solutions.Value.First().ProblemData.TargetVariable;
-        var problemDataClone = ShuffleSamples.Value
-          ? new ClassificationProblemData(shuffledProblemData.Dataset, shuffledProblemData.AllowedInputVariables, targetVariable)
-          : new ClassificationProblemData(Problem.ProblemData.Dataset, Problem.ProblemData.AllowedInputVariables, targetVariable);
+        var dataset = (Dataset)Problem.ProblemData.Dataset;
+        if (ShuffleSamples.Value) {
+          var random = new FastRandom(seed);
+          dataset = dataset.Shuffle(random);
+        }
+        var problemDataClone = new ClassificationProblemData(dataset, Problem.ProblemData.AllowedInputVariables, targetVariable);
         // set partitions of problem data clone correctly
         problemDataClone.TrainingPartition.Start = SamplesStart.Value; problemDataClone.TrainingPartition.End = SamplesEnd.Value;
@@ -566,5 +571,4 @@
       if (Problem != null) {
         Problem.Reset += new EventHandler(Problem_Reset);
-        Problem.ProblemDataChanged += Problem_ProblemDataChanged;
       }
     }
@@ -574,5 +578,4 @@
       if (Problem != null) {
         Problem.Reset -= new EventHandler(Problem_Reset);
-        Problem.ProblemDataChanged -= Problem_ProblemDataChanged;
       }
     }
@@ -592,13 +595,4 @@
       if (handler != null) handler(this, EventArgs.Empty);
       ConfigureProblem();
-    }
-    public event EventHandler ProblemDataChanged;
-    private void OnProblemDataChanged() {
-      var handler = ProblemDataChanged;
-      if (handler != null) handler(this, EventArgs.Empty);
-      shuffledProblemData = null;
-    }
-    private void Problem_ProblemDataChanged(object sender, EventArgs e) {
-      OnProblemDataChanged();
     }
     private void Problem_Reset(object sender, EventArgs e) {
