Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.cs	(revision 10908)
@@ -26,4 +26,6 @@
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
+using HeuristicLab.DataPreprocessing;
+using HeuristicLab.Problems.DataAnalysis;
 
 namespace HeuristicLab.DataPreprocessing.Views {
@@ -50,5 +52,8 @@
         var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic, dataGridLogic);
         var chartLogic = new ChartLogic(data);
+        var correlationMatrixLogic = new ChartLogic(data);
         var filterLogic = new FilterLogic(data);
+        var creator = new ProblemDataCreator(Content);
+        var problemData = (DataAnalysisProblemData)creator.CreateProblemData();
         var dataCompletenessLogic = new ChartLogic(data);
 
@@ -61,7 +66,6 @@
           new LineChartContent(chartLogic),
           new HistogramContent(chartLogic),
-          new ScatterPlotContent(chartLogic)
-          //,
-          //new DataCompletenessChartContent(dataCompletenessLogic)
+          new ScatterPlotContent(chartLogic),
+          new CorrelationMatrixContent(problemData)
         };
 
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj	(revision 10908)
@@ -64,4 +64,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="PreprocessingFeatureCorrelationView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="PreprocessingFeatureCorrelationView.Designer.cs">
+      <DependentUpon>PreprocessingFeatureCorrelationView.cs</DependentUpon>
+    </Compile>
     <Compile Include="CheckedFilterCollectionView.cs">
       <SubType>UserControl</SubType>
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.Designer.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.Designer.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.Designer.cs	(revision 10908)
@@ -54,5 +54,5 @@
       // 
       this.classifierComboBox.FormattingEnabled = true;
-      this.classifierComboBox.Location = new System.Drawing.Point(6, 52);
+      this.classifierComboBox.Location = new System.Drawing.Point(9, 52);
       this.classifierComboBox.Name = "classifierComboBox";
       this.classifierComboBox.Size = new System.Drawing.Size(121, 21);
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HistogramView.cs	(revision 10908)
@@ -9,5 +9,4 @@
   [Content(typeof(HistogramContent), true)]
   public partial class HistogramView : PreprocessingChartView {
-
     private const string HISTOGRAM_CHART_TITLE = "Histogram";
 
@@ -26,14 +25,12 @@
     
         classifierComboBox.Items.Clear();
-
         classifierComboBox.Items.Add("None");
 
-        foreach(string var in logic.GetVariableNames()){
+        foreach(string var in logic.GetVariableNamesForHistogramClassification()){
           classifierComboBox.Items.Add(var);
         }
 
+     
         if (classifierComboBox.SelectedItem == null) {
-         // classifierComboBox.SelectedIndex = 0;
-
           classifierComboBox.SelectedIndex = Content.ClassifierVariableIndex;
         }
@@ -46,16 +43,12 @@
     }
 
-    private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e)
-    {
+    private void classifierComboBox_SelectedIndexChanged(object sender, EventArgs e) {
       if (classifierComboBox.SelectedItem == null)
         return;
 
-
-      if (classifierComboBox.SelectedIndex != 0)
-      {
-        classification = logic.GetVariableValues(classifierComboBox.SelectedItem.ToString());
-      }
-      else {
-        classification = null;
+      if (classifierComboBox.SelectedIndex != 0) {
+        Classification = logic.GetVariableValues(classifierComboBox.SelectedItem.ToString());
+      } else {
+        Classification = null;
       }
 
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs	(revision 10908)
@@ -49,5 +49,5 @@
     private const string DEFAULT_CHART_TITLE = "Chart";
 
-    public List<double> classification { get; set; }
+    public IEnumerable<double> Classification { get; set; }
 
     public PreprocessingChartView() {
@@ -82,6 +82,5 @@
       }
 
-      //if (!Content.AllInOneMode)
-        if (Content != null && !Content.AllInOneMode)
+      if (Content != null && !Content.AllInOneMode)
         GenerateChart();
 
@@ -336,5 +335,5 @@
 
           PreprocessingDataTableView dataView = new PreprocessingDataTableView();
-          dataView.classification = classification;
+          dataView.Classification = Classification;
           enumerator.MoveNext();
           PreprocessingDataTable d = enumerator.Current;
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingDataTableView.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingDataTableView.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingDataTableView.cs	(revision 10908)
@@ -48,5 +48,5 @@
     }
 
-    public List<double> classification { get; set; }
+    public IEnumerable<double> Classification { get; set; }
 
     public PreprocessingDataTableView()
@@ -115,6 +115,5 @@
     #endregion
 
-    protected override void OnContentChanged()
-    {
+    protected override void OnContentChanged() {
       base.OnContentChanged();
       invisibleSeries.Clear();
@@ -126,8 +125,6 @@
       {
 
-        if (classification != null)
-        {
+        if (Classification != null)
           chart.Titles[0].Text = Content.Name;
-        }
 
         AddDataRows(Content.Rows);
@@ -166,8 +163,6 @@
         FillSeriesWithRowValues(series, row);
 
-        if (classification == null)
-        {
-        chart.Series.Add(series);
-      }
+        if (Classification == null)
+          chart.Series.Add(series);
       }
 
@@ -202,7 +197,7 @@
           FillSeriesWithRowValues(series, row);
 
-          if (classification == null) {
-          chart.Series.Add(series);
-        }
+          if (Classification == null) 
+            chart.Series.Add(series);
+        
       }
     }
@@ -735,14 +730,15 @@
     }
 
-    protected virtual void CalculateHistogram(Series series, DataRow row)
-    {
-      if (classification != null)
-      {
-
-        var qry = row.Values.Select((i, index) => new { i, j = classification[index] })
-                           .GroupBy((x) => x.j).ToDictionary(x => x.Key, x => x.Select(v => v.i).ToList());
+    protected virtual void CalculateHistogram(Series series, DataRow row) {
+      if (Classification != null) {
+
+        var valuesPerClass = row.Values.Select((i, index) => new { i, j = Classification.ToList()[index] })
+                                       .GroupBy((x) => x.j)
+                                       .ToDictionary(x => x.Key, x => x.Select(v => v.i)
+                                       .ToList());
+
         chart.Titles.Add(row.Name);
-        foreach (KeyValuePair<double, List<double>> entry in qry)
-        {
+
+        foreach (KeyValuePair<double, List<double>> entry in valuesPerClass) {
           var s = new Series(row.Name + entry.Key);
 
@@ -754,8 +750,6 @@
           chart.Series.Add(s);
         }
-      }
-      else
-      {
-      series.Points.Clear();
+      } else {
+        series.Points.Clear();
         ConfigureSeries(series, row);
         AddPointsToHistogramSeries(series, row, null);
@@ -763,7 +757,5 @@
     }
 
-    private void AddPointsToHistogramSeries(Series series, DataRow row, List<double> values)
-    {
-
+    private void AddPointsToHistogramSeries(Series series, DataRow row, List<double> values) {
       if (!row.Values.Any()) return;
       int bins = row.VisualProperties.Bins;
@@ -819,5 +811,5 @@
 
       //  shift the chart to the left so the bars are placed on the intervals
-      if (classification != null || valueFrequencies.First().Item1 < doubleRange.First()) {
+      if (Classification != null || valueFrequencies.First().Item1 < doubleRange.First()) {
         series.Points.Add(new DataPoint(min - intervalWidth, 0));
         series.Points.Add(new DataPoint(max + intervalWidth, 0));
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingFeatureCorrelationView.Designer.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingFeatureCorrelationView.Designer.cs	(revision 10908)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingFeatureCorrelationView.Designer.cs	(revision 10908)
@@ -0,0 +1,245 @@
+﻿#region License Information
+
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#endregion
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class PreprocessingFeatureCorrelationView {
+    /// <summary> 
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary> 
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Component Designer generated code
+
+    /// <summary> 
+    /// Required method for Designer support - do not modify 
+    /// the contents of this method with the code editor.
+    /// </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.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.3/PreprocessingFeatureCorrelationView.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingFeatureCorrelationView.cs	(revision 10908)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingFeatureCorrelationView.cs	(revision 10908)
@@ -0,0 +1,189 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Windows.Forms;
+using HeuristicLab.Data;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.PluginInfrastructure;
+using System;
+using HeuristicLab.DataPreprocessing;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Preprocessing Feature Correlation View")]
+  [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
+    {
+      get { return (CorrelationMatrixContent) base.Content; }
+      set { base.Content = value; }
+    }
+
+    private FeatureCorrelationCache correlationCache;
+
+    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;
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      fcc.ProgressCalculation += new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);
+      fcc.CorrelationCalculationFinished += new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);
+    }
+
+    protected override void DeregisterContentEvents() {
+      fcc.CorrelationCalculationFinished -= new FeatureCorrelationCalculator.CorrelationCalculationFinishedHandler(Content_CorrelationCalculationFinished);
+      fcc.ProgressCalculation -= new FeatureCorrelationCalculator.ProgressCalculationHandler(Content_ProgressCalculation);
+      base.DeregisterContentEvents();
+    }
+
+    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);
+        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);
+    }
+
+    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.3/HeuristicLab.DataPreprocessing-3.3.csproj
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj	(revision 10908)
@@ -81,4 +81,5 @@
     <Compile Include="Implementations\PreprocessingDataTable.cs" />
     <Compile Include="Interfaces\IFilteredPreprocessingData.cs" />
+    <Compile Include="Implementations\CorrelationMatrixContent.cs" />
     <Compile Include="PreprocessingTransformator.cs" />
     <Compile Include="Utils\DataPreprocessingChangedEvent.cs" />
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs	(revision 10908)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -32,5 +32,5 @@
 
   public class ChartLogic : IChartLogic {
- 
+    private const int MAX_DISTINCT_VALUES_FOR_CLASSIFCATION = 20;
     private ITransactionalPreprocessingData preprocessingData;
 
@@ -63,6 +63,6 @@
     }
 
-    public List<double> GetVariableValues(string variableName) {
-      return preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableName)).ToList();
+    public IEnumerable<double> GetVariableValues(string variableName) {
+      return preprocessingData.GetValues<double>(preprocessingData.GetColumnIndex(variableName));
     }
 
@@ -74,4 +74,22 @@
         if (preprocessingData.IsType<double>(preprocessingData.GetColumnIndex(variableName)))
           doubleVariableNames.Add(variableName);
+      }
+
+      return doubleVariableNames;
+    }
+
+    public IEnumerable<string> GetVariableNamesForHistogramClassification() {
+      List<string> doubleVariableNames = new List<string>();
+
+      //only return variable names from type double
+      foreach (string variableName in preprocessingData.VariableNames)
+      {
+        int columnIndex           = preprocessingData.GetColumnIndex(variableName);
+        bool isDouble             = preprocessingData.IsType<double>(columnIndex);
+        double distinctValueCount = preprocessingData.GetValues<double>(columnIndex).GroupBy(x => x).Count();
+        bool distinctValuesOk     = distinctValueCount <= MAX_DISTINCT_VALUES_FOR_CLASSIFCATION;
+
+        if (isDouble && distinctValuesOk)
+              doubleVariableNames.Add(variableName);
       }
 
@@ -146,6 +164,6 @@
       
 
-      List<double> xValues = GetVariableValues(variableNameX);
-      List<double> yValues = GetVariableValues(variableNameY);
+      List<double> xValues = GetVariableValues(variableNameX).ToList();
+      List<double> yValues = GetVariableValues(variableNameY).ToList();
 
       List<Point2D<double>> points = new List<Point2D<double>>();
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/CorrelationMatrixContent.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/CorrelationMatrixContent.cs	(revision 10908)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/CorrelationMatrixContent.cs	(revision 10908)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Drawing;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.DataPreprocessing {
+
+  [Item("Feature Correlation Matrix", "Represents the feature correlation matrix.")]
+  public class CorrelationMatrixContent : Item, IViewShortcut
+  {
+    public DataAnalysisProblemData ProblemData { get; set; }
+
+    public CorrelationMatrixContent(DataAnalysisProblemData data) {
+      ProblemData = data;
+    }
+
+    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.3/Implementations/FilterLogic.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilterLogic.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilterLogic.cs	(revision 10908)
@@ -27,5 +27,4 @@
 namespace HeuristicLab.DataPreprocessing {
   public class FilterLogic : IFilterLogic {
-
     private IFilteredPreprocessingData preprocessingData;
 
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/HistogramContent.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/HistogramContent.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/HistogramContent.cs	(revision 10908)
@@ -36,5 +36,4 @@
     public HistogramContent(HistogramContent content, Cloner cloner)
       : base(content, cloner) {
-
     }
 
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs	(revision 10908)
@@ -50,5 +50,7 @@
 
     IEnumerable<string> GetVariableNames();
-    List<double> GetVariableValues(string variableName);
+    IEnumerable<string> GetVariableNamesForHistogramClassification();
+
+    IEnumerable<double> GetVariableValues(string variableName);
   }
 }
Index: /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/ProblemDataCreator.cs
===================================================================
--- /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/ProblemDataCreator.cs	(revision 10907)
+++ /branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/ProblemDataCreator.cs	(revision 10908)
@@ -26,5 +26,5 @@
 
 namespace HeuristicLab.DataPreprocessing {
-  internal class ProblemDataCreator {
+  public class ProblemDataCreator {
 
     private readonly IPreprocessingContext context;
