Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.Designer.cs	(revision 14863)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.Designer.cs	(revision 14864)
@@ -46,4 +46,5 @@
     /// </summary>
     private void InitializeComponent() {
+      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CrossValidationView));
       this.startButton = new System.Windows.Forms.Button();
       this.pauseButton = new System.Windows.Forms.Button();
@@ -79,4 +80,5 @@
       this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
       this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.shuffleSamplesCheckBox = new System.Windows.Forms.CheckBox();
       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
       ((System.ComponentModel.ISupportInitialize)(this.foldsNumericUpDown)).BeginInit();
@@ -109,5 +111,5 @@
       // 
       this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-      this.startButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play;
+      this.startButton.Image = ((System.Drawing.Image)(resources.GetObject("startButton.Image")));
       this.startButton.Location = new System.Drawing.Point(0, 514);
       this.startButton.Name = "startButton";
@@ -120,5 +122,5 @@
       // 
       this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-      this.pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause;
+      this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image")));
       this.pauseButton.Location = new System.Drawing.Point(30, 514);
       this.pauseButton.Name = "pauseButton";
@@ -131,5 +133,5 @@
       // 
       this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-      this.stopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop;
+      this.stopButton.Image = ((System.Drawing.Image)(resources.GetObject("stopButton.Image")));
       this.stopButton.Location = new System.Drawing.Point(60, 514);
       this.stopButton.Name = "stopButton";
@@ -142,5 +144,5 @@
       // 
       this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
-      this.resetButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart;
+      this.resetButton.Image = ((System.Drawing.Image)(resources.GetObject("resetButton.Image")));
       this.resetButton.Location = new System.Drawing.Point(90, 514);
       this.resetButton.Name = "resetButton";
@@ -171,6 +173,6 @@
       // foldsNumericUpDown
       // 
-      this.foldsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.foldsNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.foldsNumericUpDown.Location = new System.Drawing.Point(55, 26);
       this.foldsNumericUpDown.Maximum = new decimal(new int[] {
@@ -185,5 +187,5 @@
             0});
       this.foldsNumericUpDown.Name = "foldsNumericUpDown";
-      this.foldsNumericUpDown.Size = new System.Drawing.Size(248, 20);
+      this.foldsNumericUpDown.Size = new System.Drawing.Size(154, 20);
       this.foldsNumericUpDown.TabIndex = 3;
       this.foldsNumericUpDown.ThousandsSeparator = true;
@@ -207,6 +209,6 @@
       // workersNumericUpDown
       // 
-      this.workersNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.workersNumericUpDown.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.workersNumericUpDown.Location = new System.Drawing.Point(55, 0);
       this.workersNumericUpDown.Maximum = new decimal(new int[] {
@@ -261,6 +263,6 @@
       // samplesEndStringConvertibleValueView
       // 
-      this.samplesEndStringConvertibleValueView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.samplesEndStringConvertibleValueView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.samplesEndStringConvertibleValueView.Caption = "StringConvertibleValue View";
       this.samplesEndStringConvertibleValueView.Content = null;
@@ -274,6 +276,6 @@
       // samplesStartStringConvertibleValueView
       // 
-      this.samplesStartStringConvertibleValueView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.samplesStartStringConvertibleValueView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.samplesStartStringConvertibleValueView.Caption = "StringConvertibleValue View";
       this.samplesStartStringConvertibleValueView.Content = null;
@@ -288,14 +290,14 @@
       // 
       this.tabControl.AllowDrop = true;
-      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.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.algorithmTabPage);
       this.tabControl.Controls.Add(this.resultsTabPage);
       this.tabControl.Controls.Add(this.runsTabPage);
-      this.tabControl.Location = new System.Drawing.Point(0, 87);
+      this.tabControl.Location = new System.Drawing.Point(0, 115);
       this.tabControl.Name = "tabControl";
       this.tabControl.SelectedIndex = 0;
-      this.tabControl.Size = new System.Drawing.Size(616, 421);
+      this.tabControl.Size = new System.Drawing.Size(616, 393);
       this.tabControl.TabIndex = 4;
       // 
@@ -310,5 +312,5 @@
       this.algorithmTabPage.Name = "algorithmTabPage";
       this.algorithmTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.algorithmTabPage.Size = new System.Drawing.Size(608, 395);
+      this.algorithmTabPage.Size = new System.Drawing.Size(608, 367);
       this.algorithmTabPage.TabIndex = 0;
       this.algorithmTabPage.Text = "Algorithm";
@@ -320,6 +322,6 @@
       // algorithmNamedItemView
       // 
-      this.algorithmNamedItemView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.algorithmNamedItemView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.algorithmNamedItemView.Caption = "NamedItem View";
       this.algorithmNamedItemView.Content = null;
@@ -333,7 +335,7 @@
       // 
       this.algorithmTabControl.AllowDrop = true;
-      this.algorithmTabControl.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.algorithmTabControl.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.algorithmTabControl.Controls.Add(this.algorithmProblemTabPage);
       this.algorithmTabControl.Controls.Add(this.algorithmParametersTabPage);
@@ -341,5 +343,5 @@
       this.algorithmTabControl.Name = "algorithmTabControl";
       this.algorithmTabControl.SelectedIndex = 0;
-      this.algorithmTabControl.Size = new System.Drawing.Size(594, 324);
+      this.algorithmTabControl.Size = new System.Drawing.Size(594, 296);
       this.algorithmTabControl.TabIndex = 3;
       // 
@@ -353,5 +355,5 @@
       this.algorithmProblemTabPage.Name = "algorithmProblemTabPage";
       this.algorithmProblemTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.algorithmProblemTabPage.Size = new System.Drawing.Size(586, 298);
+      this.algorithmProblemTabPage.Size = new System.Drawing.Size(586, 270);
       this.algorithmProblemTabPage.TabIndex = 0;
       this.algorithmProblemTabPage.Text = "Problem";
@@ -363,5 +365,5 @@
       // openProblemButton
       // 
-      this.openProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
+      this.openProblemButton.Image = ((System.Drawing.Image)(resources.GetObject("openProblemButton.Image")));
       this.openProblemButton.Location = new System.Drawing.Point(36, 6);
       this.openProblemButton.Name = "openProblemButton";
@@ -374,7 +376,7 @@
       // algorithmProblemViewHost
       // 
-      this.algorithmProblemViewHost.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.algorithmProblemViewHost.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.algorithmProblemViewHost.Caption = "View";
       this.algorithmProblemViewHost.Content = null;
@@ -383,5 +385,5 @@
       this.algorithmProblemViewHost.Name = "algorithmProblemViewHost";
       this.algorithmProblemViewHost.ReadOnly = false;
-      this.algorithmProblemViewHost.Size = new System.Drawing.Size(574, 256);
+      this.algorithmProblemViewHost.Size = new System.Drawing.Size(574, 228);
       this.algorithmProblemViewHost.TabIndex = 2;
       this.algorithmProblemViewHost.ViewsLabelVisible = true;
@@ -390,5 +392,5 @@
       // newProblemButton
       // 
-      this.newProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
+      this.newProblemButton.Image = ((System.Drawing.Image)(resources.GetObject("newProblemButton.Image")));
       this.newProblemButton.Location = new System.Drawing.Point(6, 6);
       this.newProblemButton.Name = "newProblemButton";
@@ -405,5 +407,5 @@
       this.algorithmParametersTabPage.Name = "algorithmParametersTabPage";
       this.algorithmParametersTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.algorithmParametersTabPage.Size = new System.Drawing.Size(586, 298);
+      this.algorithmParametersTabPage.Size = new System.Drawing.Size(586, 270);
       this.algorithmParametersTabPage.TabIndex = 1;
       this.algorithmParametersTabPage.Text = "Parameters";
@@ -412,4 +414,5 @@
       // algorithmParameterCollectionView
       // 
+      this.algorithmParameterCollectionView.AllowEditingOfHiddenParameters = true;
       this.algorithmParameterCollectionView.Caption = "ParameterCollection View";
       this.algorithmParameterCollectionView.Content = null;
@@ -418,10 +421,11 @@
       this.algorithmParameterCollectionView.Name = "algorithmParameterCollectionView";
       this.algorithmParameterCollectionView.ReadOnly = false;
-      this.algorithmParameterCollectionView.Size = new System.Drawing.Size(580, 292);
+      this.algorithmParameterCollectionView.ShowDetails = true;
+      this.algorithmParameterCollectionView.Size = new System.Drawing.Size(580, 264);
       this.algorithmParameterCollectionView.TabIndex = 0;
       // 
       // openAlgorithmButton
       // 
-      this.openAlgorithmButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;
+      this.openAlgorithmButton.Image = ((System.Drawing.Image)(resources.GetObject("openAlgorithmButton.Image")));
       this.openAlgorithmButton.Location = new System.Drawing.Point(38, 6);
       this.openAlgorithmButton.Name = "openAlgorithmButton";
@@ -434,5 +438,5 @@
       // newAlgorithmButton
       // 
-      this.newAlgorithmButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;
+      this.newAlgorithmButton.Image = ((System.Drawing.Image)(resources.GetObject("newAlgorithmButton.Image")));
       this.newAlgorithmButton.Location = new System.Drawing.Point(8, 6);
       this.newAlgorithmButton.Name = "newAlgorithmButton";
@@ -449,5 +453,5 @@
       this.resultsTabPage.Name = "resultsTabPage";
       this.resultsTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.resultsTabPage.Size = new System.Drawing.Size(608, 395);
+      this.resultsTabPage.Size = new System.Drawing.Size(608, 367);
       this.resultsTabPage.TabIndex = 1;
       this.resultsTabPage.Text = "Results";
@@ -462,5 +466,6 @@
       this.resultCollectionView.Name = "resultCollectionView";
       this.resultCollectionView.ReadOnly = true;
-      this.resultCollectionView.Size = new System.Drawing.Size(602, 389);
+      this.resultCollectionView.ShowDetails = true;
+      this.resultCollectionView.Size = new System.Drawing.Size(602, 361);
       this.resultCollectionView.TabIndex = 0;
       // 
@@ -472,5 +477,5 @@
       this.runsTabPage.Name = "runsTabPage";
       this.runsTabPage.Padding = new System.Windows.Forms.Padding(3);
-      this.runsTabPage.Size = new System.Drawing.Size(608, 395);
+      this.runsTabPage.Size = new System.Drawing.Size(608, 367);
       this.runsTabPage.TabIndex = 2;
       this.runsTabPage.Text = "Runs";
@@ -501,5 +506,5 @@
       this.runCollectionView.Name = "runCollectionView";
       this.runCollectionView.ReadOnly = false;
-      this.runCollectionView.Size = new System.Drawing.Size(602, 389);
+      this.runCollectionView.Size = new System.Drawing.Size(602, 361);
       this.runCollectionView.TabIndex = 0;
       // 
@@ -513,6 +518,6 @@
       // splitContainer
       // 
-      this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.splitContainer.Location = new System.Drawing.Point(0, 26);
       this.splitContainer.Name = "splitContainer";
@@ -520,4 +525,5 @@
       // splitContainer.Panel1
       // 
+      this.splitContainer.Panel1.Controls.Add(this.shuffleSamplesCheckBox);
       this.splitContainer.Panel1.Controls.Add(this.samplesEndStringConvertibleValueView);
       this.splitContainer.Panel1.Controls.Add(this.samplesStartStringConvertibleValueView);
@@ -531,11 +537,21 @@
       this.splitContainer.Panel2.Controls.Add(this.workersLabel);
       this.splitContainer.Panel2.Controls.Add(this.workersNumericUpDown);
-      this.splitContainer.Size = new System.Drawing.Size(616, 55);
+      this.splitContainer.Size = new System.Drawing.Size(616, 73);
       this.splitContainer.SplitterDistance = 306;
       this.splitContainer.TabIndex = 3;
       // 
+      // shuffleSamplesCheckBox
+      // 
+      this.shuffleSamplesCheckBox.AutoSize = true;
+      this.shuffleSamplesCheckBox.Location = new System.Drawing.Point(6, 52);
+      this.shuffleSamplesCheckBox.Name = "shuffleSamplesCheckBox";
+      this.shuffleSamplesCheckBox.Size = new System.Drawing.Size(102, 17);
+      this.shuffleSamplesCheckBox.TabIndex = 5;
+      this.shuffleSamplesCheckBox.Text = "Shuffle Samples";
+      this.shuffleSamplesCheckBox.UseVisualStyleBackColor = true;
+      this.shuffleSamplesCheckBox.CheckedChanged += new System.EventHandler(this.shuffleSamplesCheckBox_CheckedChanged);
+      // 
       // CrossValidationView
       // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
       this.Controls.Add(this.tabControl);
@@ -617,4 +633,5 @@
     private System.Windows.Forms.SplitContainer splitContainer;
     private Optimization.Views.ResultCollectionView resultCollectionView;
+    private System.Windows.Forms.CheckBox shuffleSamplesCheckBox;
   }
 }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 14863)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/CrossValidationView.cs	(revision 14864)
@@ -197,4 +197,7 @@
 
     #region GUI events
+    private void shuffleSamplesCheckBox_CheckedChanged(object sender, EventArgs e) {
+      Content.ShuffleSamples.Value = shuffleSamplesCheckBox.Checked;
+    }
     private void foldsNumericUpDown_Validated(object sender, EventArgs e) {
       if (foldsNumericUpDown.Text == string.Empty)
@@ -238,6 +241,5 @@
         try {
           Content.Algorithm = (IAlgorithm)algorithmTypeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
-        }
-        catch (Exception ex) {
+        } catch (Exception ex) {
           ErrorHandling.ShowErrorDialog(this, ex);
         }
@@ -250,5 +252,5 @@
         algorithmTabControl.Enabled = false;
 
-        ContentManager.LoadAsync(openFileDialog.FileName, delegate(IStorableContent content, Exception error) {
+        ContentManager.LoadAsync(openFileDialog.FileName, delegate (IStorableContent content, Exception error) {
           try {
             if (error != null) throw error;
@@ -258,10 +260,8 @@
             else
               Content.Algorithm = algorithm;
-          }
-          catch (Exception ex) {
+          } catch (Exception ex) {
             ErrorHandling.ShowErrorDialog(this, ex);
-          }
-          finally {
-            Invoke(new Action(delegate() {
+          } finally {
+            Invoke(new Action(delegate () {
               algorithmTabControl.Enabled = true;
             }));
@@ -289,5 +289,5 @@
         algorithmProblemViewHost.Enabled = false;
 
-        ContentManager.LoadAsync(openFileDialog.FileName, delegate(IStorableContent content, Exception error) {
+        ContentManager.LoadAsync(openFileDialog.FileName, delegate (IStorableContent content, Exception error) {
           try {
             if (error != null) throw error;
@@ -298,10 +298,8 @@
             else
               Content.Problem = problem;
-          }
-          catch (Exception ex) {
+          } catch (Exception ex) {
             Invoke(new Action(() => ErrorHandling.ShowErrorDialog(this, ex)));
-          }
-          finally {
-            Invoke(new Action(delegate() {
+          } finally {
+            Invoke(new Action(delegate () {
               algorithmProblemViewHost.Enabled = true;
               newProblemButton.Enabled = openProblemButton.Enabled = true;
@@ -357,5 +355,4 @@
     }
     #endregion
-
   }
 }
Index: trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
===================================================================
--- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs	(revision 14863)
+++ trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs	(revision 14864)
@@ -33,4 +33,5 @@
 using HeuristicLab.Problems.DataAnalysis;
 using HeuristicLab.Problems.DataAnalysis.Symbolic;
+using HeuristicLab.Random;
 
 namespace HeuristicLab.Algorithms.DataAnalysis {
@@ -56,4 +57,5 @@
       samplesStart = new IntValue(0);
       samplesEnd = new IntValue(0);
+      shuffleSamples = new BoolValue(false);
       storeAlgorithmInEachRun = false;
 
@@ -89,4 +91,5 @@
       samplesStart = cloner.Clone(original.samplesStart);
       samplesEnd = cloner.Clone(original.samplesEnd);
+      shuffleSamples = cloner.Clone(original.shuffleSamples);
       RegisterEvents();
       if (Algorithm != null) RegisterAlgorithmEvents();
@@ -170,5 +173,9 @@
       get { return results; }
     }
-
+    [Storable]
+    private BoolValue shuffleSamples;
+    public BoolValue ShuffleSamples {
+      get { return shuffleSamples; }
+    }
     [Storable]
     private IntValue folds;
@@ -274,7 +281,14 @@
         if (clonedAlgorithms.Count == 0) {
           int testSamplesCount = (SamplesEnd.Value - SamplesStart.Value) / Folds.Value;
-
+          IDataset shuffledDataset = null;
           for (int i = 0; i < Folds.Value; i++) {
-            IAlgorithm clonedAlgorithm = (IAlgorithm)algorithm.Clone();
+            var cloner = new Cloner();
+            if (ShuffleSamples.Value) {
+              var dataAnalysisProblem = (IDataAnalysisProblem)algorithm.Problem;
+              var dataset = (Dataset)dataAnalysisProblem.ProblemData.Dataset;
+              shuffledDataset = shuffledDataset ?? dataset.Shuffle(new FastRandom());
+              cloner.RegisterClonedObject(dataset, shuffledDataset);
+            }
+            IAlgorithm clonedAlgorithm = cloner.Clone(Algorithm);
             clonedAlgorithm.Name = algorithm.Name + " Fold " + i;
             IDataAnalysisProblem problem = clonedAlgorithm.Problem as IDataAnalysisProblem;
@@ -590,9 +604,11 @@
     private void Algorithm_ExecutionStateChanged(object sender, EventArgs e) {
       switch (Algorithm.ExecutionState) {
-        case ExecutionState.Prepared: OnPrepared();
+        case ExecutionState.Prepared:
+          OnPrepared();
           break;
         case ExecutionState.Started: throw new InvalidOperationException("Algorithm template can not be started.");
         case ExecutionState.Paused: throw new InvalidOperationException("Algorithm template can not be paused.");
-        case ExecutionState.Stopped: OnStopped();
+        case ExecutionState.Stopped:
+          OnStopped();
           break;
       }
@@ -724,4 +740,5 @@
       AggregateResultValues(collectedResults);
       results.AddRange(collectedResults.Select(x => new Result(x.Key, x.Value)).Cast<IResult>().ToArray());
+      clonedAlgorithms.Clear();
       runsCounter++;
       runs.Add(new Run(string.Format("{0} Run {1}", Name, runsCounter), this));
Index: trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 14863)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 14864)
@@ -126,4 +126,13 @@
       return new ModifiableDataset(variableNames, values);
     }
+    /// <summary>
+    /// Shuffle a dataset's rows
+    /// </summary>
+    /// <param name="random">Random number generator used for shuffling.</param>
+    /// <returns>A shuffled copy of the current dataset.</returns>
+    public Dataset Shuffle(IRandom random) {
+      var values = variableNames.Select(x => variableValues[x]).ToList();
+      return new Dataset(variableNames, values.ShuffleLists(random));
+    }
 
     protected Dataset(Dataset dataset) : this(dataset.variableNames, dataset.variableValues.Values) { }
