Index: /branches/DataPreprocessing/HeuristicLab 3.3.sln
===================================================================
--- /branches/DataPreprocessing/HeuristicLab 3.3.sln	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab 3.3.sln	(revision 10978)
@@ -1,7 +1,5 @@
 ﻿
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.30501.0
-MinimumVisualStudioVersion = 10.0.40219.1
+# Visual Studio 2012
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{96396439-A764-4022-A8D2-BE021449B8D1}"
 	ProjectSection(SolutionItems) = preProject
@@ -1926,3 +1924,6 @@
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(Performance) = preSolution
+		HasPerformanceSessions = true
+	EndGlobalSection
 EndGlobal
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.Designer.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.Designer.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.Designer.cs	(revision 10978)
@@ -47,199 +47,9 @@
     /// </summary>
     private void InitializeComponent() {
-      this.components = new System.ComponentModel.Container();
-      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AbstractFeatureCorrelationView));
-      this.progressBar = new System.Windows.Forms.ProgressBar();
-      this.partitionComboBox = new System.Windows.Forms.ComboBox();
-      this.correlationCalcLabel = new System.Windows.Forms.Label();
-      this.correlationCalcComboBox = new System.Windows.Forms.ComboBox();
-      this.partitionLabel = new System.Windows.Forms.Label();
-      this.minimumLabel = new System.Windows.Forms.Label();
-      this.maximumLabel = new System.Windows.Forms.Label();
-      this.pictureBox = new System.Windows.Forms.PictureBox();
-      this.splitContainer = new System.Windows.Forms.SplitContainer();
-      this.progressPanel = new System.Windows.Forms.Panel();
-      this.progressLabel = new System.Windows.Forms.Label();
-      this.dataView = new HeuristicLab.Data.Views.EnhancedStringConvertibleMatrixView();
-      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
-      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
-      this.splitContainer.Panel1.SuspendLayout();
-      this.splitContainer.Panel2.SuspendLayout();
-      this.splitContainer.SuspendLayout();
-      this.progressPanel.SuspendLayout();
-      this.SuspendLayout();
-      // 
-      // HeatMapProgressBar
-      // 
-      this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
-      this.progressBar.Location = new System.Drawing.Point(25, 46);
-      this.progressBar.Name = "HeatMapProgressBar";
-      this.progressBar.RightToLeft = System.Windows.Forms.RightToLeft.No;
-      this.progressBar.Size = new System.Drawing.Size(154, 21);
-      this.progressBar.TabIndex = 9;
-      // 
-      // PartitionComboBox
-      // 
-      this.partitionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-      this.partitionComboBox.FormattingEnabled = true;
-      this.partitionComboBox.Location = new System.Drawing.Point(333, 3);
-      this.partitionComboBox.Name = "PartitionComboBox";
-      this.partitionComboBox.Size = new System.Drawing.Size(142, 21);
-      this.partitionComboBox.TabIndex = 8;
-      this.partitionComboBox.SelectionChangeCommitted += new System.EventHandler(this.PartitionComboBox_SelectedChangeCommitted);
-      // 
-      // CorrelationCalcLabel
-      // 
-      this.correlationCalcLabel.AutoSize = true;
-      this.correlationCalcLabel.Location = new System.Drawing.Point(0, 6);
-      this.correlationCalcLabel.Name = "CorrelationCalcLabel";
-      this.correlationCalcLabel.Size = new System.Drawing.Size(104, 13);
-      this.correlationCalcLabel.TabIndex = 7;
-      this.correlationCalcLabel.Text = "Correlation Measure:";
-      // 
-      // CorrelationCalcComboBox
-      // 
-      this.correlationCalcComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-      this.correlationCalcComboBox.FormattingEnabled = true;
-      this.correlationCalcComboBox.Location = new System.Drawing.Point(110, 3);
-      this.correlationCalcComboBox.Name = "CorrelationCalcComboBox";
-      this.correlationCalcComboBox.Size = new System.Drawing.Size(163, 21);
-      this.correlationCalcComboBox.TabIndex = 6;
-      this.correlationCalcComboBox.SelectionChangeCommitted += new System.EventHandler(this.CorrelationMeasureComboBox_SelectedChangeCommitted);
-      // 
-      // PartitionLabel
-      // 
-      this.partitionLabel.AutoSize = true;
-      this.partitionLabel.Location = new System.Drawing.Point(279, 6);
-      this.partitionLabel.Name = "PartitionLabel";
-      this.partitionLabel.Size = new System.Drawing.Size(48, 13);
-      this.partitionLabel.TabIndex = 10;
-      this.partitionLabel.Text = "Partition:";
-      // 
-      // minimumLabel
-      // 
-      this.minimumLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
-      this.minimumLabel.BackColor = System.Drawing.Color.Transparent;
-      this.minimumLabel.Location = new System.Drawing.Point(487, 314);
-      this.minimumLabel.Name = "minimumLabel";
-      this.minimumLabel.Size = new System.Drawing.Size(73, 19);
-      this.minimumLabel.TabIndex = 13;
-      this.minimumLabel.Text = "0.0";
-      this.minimumLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter;
-      // 
-      // maximumLabel
-      // 
-      this.maximumLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-      this.maximumLabel.BackColor = System.Drawing.Color.Transparent;
-      this.maximumLabel.Location = new System.Drawing.Point(487, 2);
-      this.maximumLabel.Name = "maximumLabel";
-      this.maximumLabel.Size = new System.Drawing.Size(73, 25);
-      this.maximumLabel.TabIndex = 12;
-      this.maximumLabel.Text = "1.0";
-      this.maximumLabel.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
-      // 
-      // PictureBox
-      // 
-      this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Right)));
-      this.pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-      this.pictureBox.Image = ((System.Drawing.Image)(resources.GetObject("PictureBox.Image")));
-      this.pictureBox.Location = new System.Drawing.Point(507, 30);
-      this.pictureBox.Name = "PictureBox";
-      this.pictureBox.Size = new System.Drawing.Size(35, 281);
-      this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
-      this.pictureBox.TabIndex = 15;
-      this.pictureBox.TabStop = false;
-      // 
-      // SplitContainer
-      // 
-      this.splitContainer.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.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
-      this.splitContainer.IsSplitterFixed = true;
-      this.splitContainer.Location = new System.Drawing.Point(3, 3);
-      this.splitContainer.Name = "SplitContainer";
-      this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
-      // 
-      // SplitContainer.Panel1
-      // 
-      this.splitContainer.Panel1.Controls.Add(this.correlationCalcLabel);
-      this.splitContainer.Panel1.Controls.Add(this.correlationCalcComboBox);
-      this.splitContainer.Panel1.Controls.Add(this.partitionComboBox);
-      this.splitContainer.Panel1.Controls.Add(this.partitionLabel);
-      // 
-      // SplitContainer.Panel2
-      // 
-      this.splitContainer.Panel2.Controls.Add(this.progressPanel);
-      this.splitContainer.Panel2.Controls.Add(this.dataView);
-      this.splitContainer.Size = new System.Drawing.Size(475, 330);
-      this.splitContainer.SplitterDistance = 25;
-      this.splitContainer.TabIndex = 16;
-      // 
-      // CalculatingPanel
-      // 
-      this.progressPanel.Anchor = System.Windows.Forms.AnchorStyles.None;
-      this.progressPanel.Controls.Add(this.progressLabel);
-      this.progressPanel.Controls.Add(this.progressBar);
-      this.progressPanel.Location = new System.Drawing.Point(138, 95);
-      this.progressPanel.Name = "CalculatingPanel";
-      this.progressPanel.Size = new System.Drawing.Size(200, 81);
-      this.progressPanel.TabIndex = 10;
-      // 
-      // CalculatingLabel
-      // 
-      this.progressLabel.AutoSize = true;
-      this.progressLabel.Location = new System.Drawing.Point(42, 19);
-      this.progressLabel.Name = "CalculatingLabel";
-      this.progressLabel.Size = new System.Drawing.Size(120, 13);
-      this.progressLabel.TabIndex = 10;
-      this.progressLabel.Text = "Calculating correlation...";
-      // 
-      // DataGridView
-      // 
-      this.dataView.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.dataView.Location = new System.Drawing.Point(0, 0);
-      this.dataView.Name = "DataView";
-      this.dataView.ReadOnly = true;
-      this.dataView.Size = new System.Drawing.Size(475, 301);
-      this.dataView.TabIndex = 0;
-      // 
-      // AbstractFeatureCorrelationView
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.splitContainer);
-      this.Controls.Add(this.minimumLabel);
-      this.Controls.Add(this.pictureBox);
-      this.Controls.Add(this.maximumLabel);
-      this.Name = "AbstractFeatureCorrelationView";
-      this.Size = new System.Drawing.Size(569, 336);
-      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
-      this.splitContainer.Panel1.ResumeLayout(false);
-      this.splitContainer.Panel1.PerformLayout();
-      this.splitContainer.Panel2.ResumeLayout(false);
-      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
-      this.splitContainer.ResumeLayout(false);
-      this.progressPanel.ResumeLayout(false);
-      this.progressPanel.PerformLayout();
+      this.components = new System.ComponentModel.Container();     
       this.ResumeLayout(false);
-
     }
 
     #endregion
-
-    protected System.Windows.Forms.ProgressBar progressBar;
-    protected System.Windows.Forms.ComboBox partitionComboBox;
-    protected System.Windows.Forms.Label correlationCalcLabel;
-    protected System.Windows.Forms.ComboBox correlationCalcComboBox;
-    protected System.Windows.Forms.Label partitionLabel;
-    protected System.Windows.Forms.Label minimumLabel;
-    protected System.Windows.Forms.Label maximumLabel;
-    protected System.Windows.Forms.PictureBox pictureBox;
-    protected System.Windows.Forms.SplitContainer splitContainer;
-    protected System.Windows.Forms.Panel progressPanel;
-    protected System.Windows.Forms.Label progressLabel;
-    protected HeuristicLab.Data.Views.EnhancedStringConvertibleMatrixView dataView;
-
   }
 }
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/PreprocessingFeatureCorrelationView.cs	(revision 10978)
@@ -30,4 +30,5 @@
 using System;
 using HeuristicLab.DataPreprocessing;
+using HeuristicLab.Problems.DataAnalysis.Views;
 
 namespace HeuristicLab.Problems.DataAnalysis.Views {
@@ -35,11 +36,4 @@
   [Content(typeof(CorrelationMatrixContent), false)]
   public partial class PreprocessingFeatureCorrelationView : AsynchronousContentView {
-    public const string ALLSAMPLES = "All Samples";
-    public const string TRAININGSAMPLES = "Training Samples";
-    public const string TESTSAMPLES = "Test Samples";
-
-    public static readonly IList<string> Partitions = new List<string>() { ALLSAMPLES, TRAININGSAMPLES, TESTSAMPLES };
-
-    protected FeatureCorrelationCalculator fcc;
 
     public new CorrelationMatrixContent Content
@@ -49,19 +43,11 @@
     }
 
-    private FeatureCorrelationCache correlationCache;
+    FeatureCorrelationView correlationView;
 
     public PreprocessingFeatureCorrelationView() {
-
-      correlationCache = new FeatureCorrelationCache();
       InitializeComponent();
-      fcc = new FeatureCorrelationCalculator();
-      var calculators = ApplicationManager.Manager.GetInstances<IDependencyCalculator>();
-      var calcList = calculators.OrderBy(c => c.Name).Select(c => new { Name = c.Name, Calculator = c }).ToList();
-      correlationCalcComboBox.ValueMember = "Calculator";
-      correlationCalcComboBox.DisplayMember = "Name";
-      correlationCalcComboBox.DataSource = calcList;
-      correlationCalcComboBox.SelectedItem = calcList.First(c => c.Calculator.GetType().Equals(typeof(PearsonsRDependenceCalculator)));
-      partitionComboBox.DataSource = Partitions;
-      partitionComboBox.SelectedItem = TRAININGSAMPLES;
+      correlationView = new FeatureCorrelationView();
+      correlationView.Dock = DockStyle.Fill;
+      this.Controls.Add(correlationView);
     }
 
@@ -69,13 +55,9 @@
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
-      Content.PreprocessingData.Changed += Data_Changed;
-      fcc.ProgressCalculation += new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);
-      fcc.CorrelationCalculationFinished += new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);
+      Content.Changed += Data_Changed;      
     }
 
     protected override void DeregisterContentEvents() {
-      Content.PreprocessingData.Changed -= Data_Changed;
-      fcc.CorrelationCalculationFinished -= new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);
-      fcc.ProgressCalculation -= new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);
+      Content.Changed -= Data_Changed;      
       base.DeregisterContentEvents();
     }
@@ -87,110 +69,11 @@
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      fcc.TryCancelCalculation();
-      if (Content != null) {
-        fcc.ProblemData = Content.ProblemData;
-        CalculateCorrelation();
-      } else {
-        dataView.Maximum = 0;
-        dataView.Minimum = 0;
-        dataView.Content = null;
-        dataView.ResetVisibility();
-      }
-    }
-
-    protected virtual bool[] SetInitialVariableVisibility() {
-      bool[] initialVisibility = new bool[Content.ProblemData.Dataset.DoubleVariables.Count()];
-      int i = 0;
-      foreach (var variable in Content.ProblemData.Dataset.DoubleVariables) {
-        initialVisibility[i] = Content.ProblemData.AllowedInputVariables.Contains(variable);
-        i++;
-      }
-      return initialVisibility;
-    }
-
-    protected void CorrelationMeasureComboBox_SelectedChangeCommitted(object sender, System.EventArgs e) {
-      CalculateCorrelation();
-    }
-    protected void PartitionComboBox_SelectedChangeCommitted(object sender, System.EventArgs e) {
-      CalculateCorrelation();
-    }
-
-     protected void CalculateCorrelation() {
-      if (correlationCalcComboBox.SelectedItem == null) return;
-      if (partitionComboBox.SelectedItem == null) return;
-
-      IDependencyCalculator calc = (IDependencyCalculator)correlationCalcComboBox.SelectedValue;
-      string partition = (string)partitionComboBox.SelectedValue;
-      dataView.Enabled = false;
-      double[,] corr = correlationCache.GetCorrelation(calc, partition);
-      if (corr == null) {
-        fcc.CalculateElements(calc, partition);
-      } else {
-        fcc.TryCancelCalculation();
-        var correlation = new DoubleMatrix(corr, Content.ProblemData.Dataset.DoubleVariables, Content.ProblemData.Dataset.DoubleVariables);
-        UpdateDataView(correlation);
-      }
-    }
-
-    protected void Content_CorrelationCalculationFinished(object sender, FeatureCorrelationCalculator.CorrelationCalculationFinishedArgs e) {
-      if (InvokeRequired) {
-        Invoke(new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished), sender, e);
+      if (Content == null) {
+        correlationView.Content = null;
         return;
       }
-      correlationCache.SetCorrelation(e.Calculcator, e.Partition, e.Correlation);
-      var correlation = new DoubleMatrix(e.Correlation, Content.ProblemData.Dataset.DoubleVariables, Content.ProblemData.Dataset.DoubleVariables);
-      UpdateDataView(correlation);
+
+      correlationView.Content = Content.ProblemData;
     }
-
-    protected void UpdateDataView(DoubleMatrix correlation) {
-      IDependencyCalculator calc = (IDependencyCalculator)correlationCalcComboBox.SelectedValue;
-      maximumLabel.Text = calc.Maximum.ToString();
-      minimumLabel.Text = calc.Minimum.ToString();
-
-      correlation.SortableView = true;
-      dataView.Maximum = calc.Maximum;
-      dataView.Minimum = calc.Minimum;
-      dataView.Content = correlation;
-      dataView.Enabled = true;
-    }
-
-    protected void Content_ProgressCalculation(object sender, ProgressChangedEventArgs e) {
-      if (!progressPanel.Visible && e.ProgressPercentage != progressBar.Maximum) {
-        progressPanel.Show();
-      } else if (e.ProgressPercentage == progressBar.Maximum) {
-        progressPanel.Hide();
-      }
-      progressBar.Value = e.ProgressPercentage;
-    }
-
-      [NonDiscoverableType]
-      private class FeatureCorrelationCache : Object {
-        private Dictionary<Tuple<IDependencyCalculator, string>, double[,]> correlationsCache;
-
-        public FeatureCorrelationCache()
-          : base() {
-          InitializeCaches();
-        }
-
-        private void InitializeCaches() {
-          correlationsCache = new Dictionary<Tuple<IDependencyCalculator, string>, double[,]>();
-        }
-
-        public void Reset() {
-          InitializeCaches();
-        }
-
-        public double[,] GetCorrelation(IDependencyCalculator calc, string partition) {
-          double[,] corr;
-          var key = new Tuple<IDependencyCalculator, string>(calc, partition);
-          correlationsCache.TryGetValue(key, out corr);
-          return corr;
-        }
-
-        public void SetCorrelation(IDependencyCalculator calc, string partition, double[,] correlation) {
-          var key = new Tuple<IDependencyCalculator, string>(calc, partition);
-          correlationsCache[key] = correlation;
-        }
-      }
   }
 }
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/ChartLogic.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/ChartLogic.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/ChartLogic.cs	(revision 10978)
@@ -140,5 +140,5 @@
     public DataRow CreateSelectedDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) {
       
-      IDictionary<int,IList<int>> selection = preprocessingData.GetSelection();
+      IDictionary<int,IList<int>> selection = preprocessingData.Selection;
       int variableIndex = preprocessingData.GetColumnIndex(variableName);
 
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/CorrelationMatrixContent.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/CorrelationMatrixContent.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/CorrelationMatrixContent.cs	(revision 10978)
@@ -26,7 +26,14 @@
 
 namespace HeuristicLab.DataPreprocessing {
-
   [Item("Feature Correlation Matrix", "Represents the feature correlation matrix.")]
   public class CorrelationMatrixContent : Item, IViewChartShortcut {
+    public static new Image StaticItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Gradient; }
+    }
+
+    private IPreprocessingContext Context { get; set; }
+    private ITransactionalPreprocessingData PreprocessingData {
+      get { return Context.Data; }
+    }
 
     public DataAnalysisProblemData ProblemData {
@@ -34,29 +41,14 @@
         var creator = new ProblemDataCreator(Context);
         return (DataAnalysisProblemData)creator.CreateProblemData();
-      } 
+      }
     }
 
-    public ITransactionalPreprocessingData PreprocessingData { 
-      get {
-        return Context.Data;
-      } 
-    }
-
-    private IPreprocessingContext Context { get; set; }
     public CorrelationMatrixContent(IPreprocessingContext context) {
       Context = context;
-
-
     }
 
     public CorrelationMatrixContent(CorrelationMatrixContent original, Cloner cloner)
       : base(original, cloner) {
-
     }
-
-    public static new Image StaticItemImage {
-      get { return HeuristicLab.Common.Resources.VSImageLibrary.Gradient; }
-    }
-
     public override IDeepCloneable Clone(Cloner cloner) {
       return new CorrelationMatrixContent(this, cloner);
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/DataGridLogic.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/DataGridLogic.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/DataGridLogic.cs	(revision 10978)
@@ -144,11 +144,10 @@
 
 
-
     public void SetSelection(IDictionary<int, IList<int>> selection) {
-      preprocessingData.SetSelection(selection);
+      preprocessingData.Selection = selection;
     }
 
     public IDictionary<int, IList<int>> GetSelection() {
-      return preprocessingData.GetSelection();
+      return preprocessingData.Selection;
     }
     public void ClearSelection() {
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/FilteredPreprocessingData.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/FilteredPreprocessingData.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/FilteredPreprocessingData.cs	(revision 10978)
@@ -10,11 +10,16 @@
 namespace HeuristicLab.DataPreprocessing.Implementations {
   public class FilteredPreprocessingData : NamedItem, IFilteredPreprocessingData {
-    protected ITransactionalPreprocessingData originalData;
-    protected ITransactionalPreprocessingData filteredData;
+    private readonly ITransactionalPreprocessingData originalData;
+    private ITransactionalPreprocessingData filteredData;
+
+     public IDictionary<int, IList<int>> Selection {
+      get { return originalData.Selection; }
+      set { originalData.Selection = value; }
+    }
 
     protected FilteredPreprocessingData(FilteredPreprocessingData original, Cloner cloner)
       : base(original, cloner) {
-      originalData = (ITransactionalPreprocessingData)original.originalData;
-      filteredData = (ITransactionalPreprocessingData)original.filteredData;
+      originalData = original.originalData;
+      filteredData = original.filteredData;
     }
 
@@ -34,5 +39,8 @@
 
     public void SetCell<T>(int columnIndex, int rowIndex, T value) {
-      ReadOnlyOnFilterData.SetCell<T>(columnIndex, rowIndex, value);
+      if (IsFiltered)
+        throw new InvalidOperationException("SetCell not possible while data is filtered");
+
+      originalData.SetCell<T>(columnIndex, rowIndex, value);
     }
 
@@ -50,21 +58,35 @@
 
     public void SetValues<T>(int columnIndex, IList<T> values) {
-      ReadOnlyOnFilterData.SetValues<T>(columnIndex, values);
+      if (IsFiltered)
+        throw new InvalidOperationException("SetValues not possible while data is filtered");
+
+      originalData.SetValues<T>(columnIndex, values);
     }
 
     public void InsertRow(int rowIndex) {
-      ReadOnlyOnFilterData.InsertRow(rowIndex);
+      if (IsFiltered)
+        throw new InvalidOperationException("InsertRow not possible while data is filtered");
+
+      originalData.InsertRow(rowIndex);
     }
 
     public void DeleteRow(int rowIndex) {
-      ReadOnlyOnFilterData.DeleteRow(rowIndex);
+      if (IsFiltered)
+        throw new InvalidOperationException("DeleteRow not possible while data is filtered");
+
+      originalData.DeleteRow(rowIndex);
     }
 
     public void InsertColumn<T>(string variableName, int columnIndex) {
-      ReadOnlyOnFilterData.InsertColumn<T>(variableName, columnIndex);
+      if (IsFiltered)
+        throw new InvalidOperationException("InsertColumn not possible while data is filtered");
+
+      originalData.InsertColumn<T>(variableName, columnIndex);
     }
 
     public void DeleteColumn(int columnIndex) {
-      ReadOnlyOnFilterData.DeleteColumn(columnIndex);
+      if (IsFiltered)
+        throw new InvalidOperationException("DeleteColumn not possible while data is filtered");
+      originalData.DeleteColumn(columnIndex);
     }
 
@@ -153,12 +175,9 @@
     }
 
-    public ITransactionalPreprocessingData ReadOnlyOnFilterData {
-      get {
-        if (IsFiltered)
-          throw new InvalidOperationException();
-
-        return originalData;
-      }
-    }
+
+    public bool IsUndoAvailable {
+      get { return IsFiltered ? false : originalData.IsUndoAvailable; }
+    }
+
 
     public bool IsFiltered {
@@ -171,18 +190,22 @@
     }
 
-    public bool IsUndoAvailable {
-      get { return IsFiltered ? false : originalData.IsUndoAvailable; }
-    }
 
     public void Undo() {
-      ReadOnlyOnFilterData.Undo();
+      if (IsFiltered)
+        throw new InvalidOperationException("Undo not possible while data is filtered");
+
+      originalData.Undo();
     }
 
     public void InTransaction(Action action, DataPreprocessingChangedEventType type = DataPreprocessingChangedEventType.Any) {
-      ReadOnlyOnFilterData.InTransaction(action, type);
+      if (IsFiltered)
+        throw new InvalidOperationException("Transaction not possible while data is filtered");
+      originalData.InTransaction(action, type);
     }
 
     public void BeginTransaction(DataPreprocessingChangedEventType type) {
-      ReadOnlyOnFilterData.BeginTransaction(type);
+      if (IsFiltered)
+        throw new InvalidOperationException("Transaction not possible while data is filtered");
+      originalData.BeginTransaction(type);
     }
 
@@ -194,13 +217,4 @@
 
     #region IPreprocessingData Members
-
-
-    public void SetSelection(IDictionary<int, IList<int>> selection) {
-      originalData.SetSelection(selection);
-    }
-
-    public IDictionary<int, IList<int>> GetSelection() {
-      return originalData.GetSelection();
-    }
 
     public void ClearSelection() {
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingContext.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingContext.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingContext.cs	(revision 10978)
@@ -34,17 +34,11 @@
 
     public IFilteredPreprocessingData Data { get; private set; }
-
-    public IDataAnalysisProblemData DataAnalysisProblemData { get; private set; }
-
     public IAlgorithm Algorithm { get; private set; }
-
     public IDataAnalysisProblem Problem { get; private set; }
 
     public PreprocessingContext(IDataAnalysisProblemData dataAnalysisProblemData, IAlgorithm algorithm, IDataAnalysisProblem problem) {
-
       TransactionalPreprocessingData transactionalPreprocessingData = new TransactionalPreprocessingData(dataAnalysisProblemData);
 
       Data = new FilteredPreprocessingData(transactionalPreprocessingData);
-      DataAnalysisProblemData = dataAnalysisProblemData;
       Algorithm = algorithm;
       Problem = problem;
@@ -54,5 +48,4 @@
       : base(original, cloner) {
       Data = cloner.Clone(original.Data);
-      DataAnalysisProblemData = original.DataAnalysisProblemData;
       Algorithm = original.Algorithm;
       Problem = original.Problem;
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingData.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingData.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/PreprocessingData.cs	(revision 10978)
@@ -33,15 +33,42 @@
 
   [Item("PreprocessingData", "Represents data used for preprocessing.")]
-  public class PreprocessingData : NamedItem, IPreprocessingData {
+  public abstract class PreprocessingData : NamedItem, IPreprocessingData {
+
+    protected double trainingToTestRatio;
+    public IntRange TrainingPartition {
+      get { return new IntRange(0, (int)(Rows * trainingToTestRatio)); }
+    }
+    public IntRange TestPartition {
+      get { return new IntRange((int)(Rows * trainingToTestRatio), Rows); }
+    }
+
+    protected IList<ITransformation> transformations;
+    public IList<ITransformation> Transformations {
+      get { return transformations; }
+    }
 
     protected IList<IList> variableValues;
-
     protected IList<string> variableNames;
 
-    protected double trainingToTestRatio;
-
-    protected IList<ITransformation> transformations;
-
-    protected IDictionary<int, IList<int>> currentSelection;
+    public IEnumerable<string> VariableNames {
+      get { return variableNames; }
+    }
+
+    public int Columns {
+      get { return variableNames.Count; }
+    }
+
+    public int Rows {
+      get { return variableValues.Count > 0 ? variableValues[0].Count : 0; }
+    }
+
+    protected IDictionary<int, IList<int>> selection;
+    public IDictionary<int, IList<int>> Selection {
+      get { return selection; }
+      set {
+          selection = value;
+          OnSelectionChanged();
+        }
+      }    
 
     protected PreprocessingData(PreprocessingData original, Cloner cloner)
@@ -53,13 +80,12 @@
     }
 
-    public PreprocessingData(IDataAnalysisProblemData problemData)
+    protected PreprocessingData(IDataAnalysisProblemData problemData)
       : base() {
       Name = "Preprocessing Data";
 
       transformations = new List<ITransformation>();
-      currentSelection = new Dictionary<int, IList<int>>();
+      selection = new Dictionary<int, IList<int>>();
 
       variableNames = new List<string>(problemData.Dataset.VariableNames);
-      // create dictionary from variable name to index
 
       int columnIndex = 0;
@@ -73,5 +99,5 @@
           variableValues.Insert(columnIndex, CreateColumn<DateTime>(problemData.Dataset, columnIndex, x => DateTime.Parse(x)));
         } else {
-          throw new ArgumentException("The datatype of column " + variableName + " must be of type List<double>, List<string> or List<DateTime>");
+          throw new ArgumentException("The datatype of column " + variableName + " must be of type double, string or DateTime");
         }
         ++columnIndex;
@@ -97,11 +123,4 @@
     }
 
-    #region NamedItem abstract Member Implementations
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new PreprocessingData(this, cloner);
-    }
-
-    #endregion
 
     #region IPreprocessingData Members
@@ -111,14 +130,23 @@
     }
 
-
     public virtual void SetCell<T>(int columnIndex, int rowIndex, T value) {
       variableValues[columnIndex][rowIndex] = value;
     }
 
-
     public string GetCellAsString(int columnIndex, int rowIndex) {
       return variableValues[columnIndex][rowIndex].ToString();
     }
 
+    public string GetVariableName(int columnIndex) {
+      return variableNames[columnIndex];
+    }
+
+    public int GetColumnIndex(string variableName) {
+      return variableNames.IndexOf(variableName);
+    }
+
+    public bool IsType<T>(int columnIndex) {
+      return variableValues[columnIndex] is List<T>;
+    }
 
     [Obsolete("use the index based variant, is faster")]
@@ -130,5 +158,5 @@
       if (considerSelection) {
         var list = new List<T>();
-        foreach (var rowIdx in currentSelection[columnIndex]) {
+        foreach (var rowIdx in selection[columnIndex]) {
           list.Add((T)variableValues[columnIndex][rowIdx]);
         }
@@ -170,40 +198,4 @@
     }
 
-    public IntRange TrainingPartition {
-      get { return new IntRange(0, (int)(Rows * trainingToTestRatio)); }
-    }
-
-    public IntRange TestPartition {
-      get { return new IntRange((int)(Rows * trainingToTestRatio), Rows); }
-    }
-
-    public IList<ITransformation> Transformations {
-      get { return transformations; }
-    }
-
-    public string GetVariableName(int columnIndex) {
-      return variableNames[columnIndex];
-    }
-
-    public IEnumerable<string> VariableNames {
-      get { return variableNames; }
-    }
-
-    public int GetColumnIndex(string variableName) {
-      return variableNames.IndexOf(variableName);
-    }
-
-    public bool IsType<T>(int columnIndex) {
-      return variableValues[columnIndex] is List<T>;
-    }
-
-    public int Columns {
-      get { return variableNames.Count; }
-    }
-
-    public int Rows {
-      get { return variableValues.Count > 0 ? variableValues[0].Count : 0; }
-    }
-
     public Dataset ExportToDataset() {
       IList<IList> values = new List<IList>();
@@ -217,21 +209,19 @@
     }
 
-    public void SetSelection(IDictionary<int, IList<int>> selection) {
-      currentSelection = selection;
-      if (SelectionChanged != null) {
-        SelectionChanged(this, new EventArgs());
-      }
-    }
-
-    public IDictionary<int, IList<int>> GetSelection() {
-      return currentSelection;
-    }
-
     public void ClearSelection() {
-      currentSelection = new Dictionary<int, IList<int>>();
+      Selection = new Dictionary<int, IList<int>>();
     }
 
     public event EventHandler SelectionChanged;
-
+    protected virtual void OnSelectionChanged() { 
+       var listeners = SelectionChanged;
+       if (listeners != null) listeners(this, EventArgs.Empty);
+    }
+
+    public event DataPreprocessingChangedEventHandler Changed;
+    protected virtual void OnChanged(DataPreprocessingChangedEventType type, int column, int row) {
+      var listeners = Changed;
+      if (listeners != null) listeners(this, new DataPreprocessingChangedEventArgs(type, column, row));
+    }
     #endregion
   }
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/SearchLogic.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/SearchLogic.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/SearchLogic.cs	(revision 10978)
@@ -114,5 +114,5 @@
     {
       if (considerSelection) {     
-        var selectedRows =  preprocessingData.GetSelection()[columnIndex];
+        var selectedRows =  preprocessingData.Selection[columnIndex];
         
         List<T> values = new List<T>();
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/TransactionalPreprocessingData.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/TransactionalPreprocessingData.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Implementations/TransactionalPreprocessingData.cs	(revision 10978)
@@ -30,30 +30,23 @@
 namespace HeuristicLab.DataPreprocessing {
 
-  internal class Snapshot {
-    public IList<IList> VariableValues { get; set; }
-
-    public IList<string> VariableNames { get; set; }
-
-    public double TrainingToTestRatio { get; set; }
-
-    public IList<ITransformation> Transformations { get; set; }
-
-    public DataPreprocessingChangedEventType ChangedType { get; set; }
-
-    public int ChangedColumn { get; set; }
-
-    public int ChangedRow { get; set; }
-  }
-
   [Item("PreprocessingData", "Represents data used for preprocessing.")]
   public class TransactionalPreprocessingData : PreprocessingData, ITransactionalPreprocessingData {
 
+    private class Snapshot {
+      public IList<IList> VariableValues { get; set; }
+      public IList<string> VariableNames { get; set; }
+
+      public double TrainingToTestRatio { get; set; }
+      public IList<ITransformation> Transformations { get; set; }
+      public DataPreprocessingChangedEventType ChangedType { get; set; }
+
+      public int ChangedColumn { get; set; }
+      public int ChangedRow { get; set; }
+    }
+
     private const int MAX_UNDO_DEPTH = 5;
 
-    private IList<Snapshot> undoHistory;
-
-    private Stack<DataPreprocessingChangedEventType> eventStack = new Stack<DataPreprocessingChangedEventType>();
-
-    private DataPreprocessingChangedEventType lastOccuredChangedType = DataPreprocessingChangedEventType.Any;
+    private readonly IList<Snapshot> undoHistory = new List<Snapshot>();
+    private readonly Stack<DataPreprocessingChangedEventType> eventStack = new Stack<DataPreprocessingChangedEventType>();
 
     public bool IsInTransaction { get { return eventStack.Count > 0; } }
@@ -61,14 +54,12 @@
     public TransactionalPreprocessingData(IDataAnalysisProblemData problemData)
       : base(problemData) {
-      undoHistory = new List<Snapshot>();
     }
 
     private TransactionalPreprocessingData(TransactionalPreprocessingData original, Cloner cloner)
       : base(original, cloner) {
-      undoHistory = new List<Snapshot>();
-    }
+     }
 
     private void SaveSnapshot(DataPreprocessingChangedEventType changedType, int column, int row) {
-      if (eventStack.Count > 0) return;
+      if (IsInTransaction) return;
 
       var currentSnapshot = new Snapshot {
@@ -144,10 +135,4 @@
     #region TransactionalPreprocessingData members
 
-    public event DataPreprocessingChangedEventHandler Changed;
-    protected virtual void OnChanged(DataPreprocessingChangedEventType type, int column, int row) {
-      var listeners = Changed;
-      if (listeners != null) listeners(this, new DataPreprocessingChangedEventArgs(type, column, row));
-    }
-
     public bool IsUndoAvailable {
       get { return undoHistory.Count > 0; }
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Interfaces/IPreprocessingContext.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Interfaces/IPreprocessingContext.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Interfaces/IPreprocessingContext.cs	(revision 10978)
@@ -27,20 +27,12 @@
 
 namespace HeuristicLab.DataPreprocessing {
-  public interface IPreprocessingContext
-    : IItem {
+  public interface IPreprocessingContext : IItem {
 
     IFilteredPreprocessingData Data { get; }
-
-    [Obsolete]
-    IDataAnalysisProblemData DataAnalysisProblemData { get; }
-
     IAlgorithm Algorithm { get; }
-
     IDataAnalysisProblem Problem { get; }
 
     IItem ExportAlgorithmOrProblem();
-
     IAlgorithm ExportAlgorithm();
-
     IProblem ExportProblem();
   }
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Interfaces/IPreprocessingData.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Interfaces/IPreprocessingData.cs	(revision 10977)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.4/Interfaces/IPreprocessingData.cs	(revision 10978)
@@ -65,6 +65,5 @@
     Dataset ExportToDataset();
 
-    void SetSelection(IDictionary<int, IList<int>> selection);
-    IDictionary<int, IList<int>> GetSelection();
+    IDictionary<int, IList<int>> Selection { get; set; }
     void ClearSelection();
 
