Index: anches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs	(revision 13823)
+++ 	(revision )
@@ -1,173 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
-  partial class DensityTrackbar {
-    /// <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.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
-      this.radioButton = new System.Windows.Forms.RadioButton();
-      this.trackBar = new System.Windows.Forms.TrackBar();
-      this.doubleLimitView = new HeuristicLab.Problems.DataAnalysis.Views.DoubleLimitView();
-      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
-      this.textBox = new System.Windows.Forms.TextBox();
-      this.groupBox = new System.Windows.Forms.GroupBox();
-      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
-      this.groupBox.SuspendLayout();
-      this.SuspendLayout();
-      // 
-      // radioButton
-      // 
-      this.radioButton.Location = new System.Drawing.Point(6, 11);
-      this.radioButton.Name = "radioButton";
-      this.radioButton.Size = new System.Drawing.Size(132, 17);
-      this.radioButton.TabIndex = 0;
-      this.radioButton.TabStop = true;
-      this.radioButton.Text = "<Name>";
-      this.radioButton.UseVisualStyleBackColor = true;
-      this.radioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
-      // 
-      // trackBar
-      // 
-      this.trackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-      this.trackBar.BackColor = System.Drawing.Color.White;
-      this.trackBar.LargeChange = 100;
-      this.trackBar.Location = new System.Drawing.Point(144, 10);
-      this.trackBar.Maximum = 1000;
-      this.trackBar.Name = "trackBar";
-      this.trackBar.RightToLeft = System.Windows.Forms.RightToLeft.No;
-      this.trackBar.Size = new System.Drawing.Size(193, 45);
-      this.trackBar.TabIndex = 1;
-      this.trackBar.TickFrequency = 100;
-      this.trackBar.Value = 500;
-      this.trackBar.ValueChanged += new System.EventHandler(this.trackBar_ValueChanged);
-      // 
-      // doubleLimitView
-      // 
-      this.doubleLimitView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-      this.doubleLimitView.Caption = "DoubleLimit View";
-      this.doubleLimitView.Content = null;
-      this.doubleLimitView.Location = new System.Drawing.Point(343, 10);
-      this.doubleLimitView.Name = "doubleLimitView";
-      this.doubleLimitView.ReadOnly = false;
-      this.doubleLimitView.Size = new System.Drawing.Size(151, 47);
-      this.doubleLimitView.TabIndex = 2;
-      // 
-      // chart
-      // 
-      this.chart.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.chart.BorderlineColor = System.Drawing.Color.Transparent;
-      chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
-      chartArea1.AxisX.IsMarginVisible = false;
-      chartArea1.AxisY.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
-      chartArea1.AxisY.IsMarginVisible = false;
-      chartArea1.AxisY.MajorTickMark.Enabled = false;
-      chartArea1.AxisY.Minimum = 0D;
-      chartArea1.BackColor = System.Drawing.Color.Transparent;
-      chartArea1.BorderColor = System.Drawing.Color.Transparent;
-      chartArea1.Name = "ChartArea1";
-      chartArea1.Position.Auto = false;
-      chartArea1.Position.Height = 100F;
-      chartArea1.Position.Width = 100F;
-      this.chart.ChartAreas.Add(chartArea1);
-      this.chart.Location = new System.Drawing.Point(157, 35);
-      this.chart.Name = "chart";
-      series1.ChartArea = "ChartArea1";
-      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StepLine;
-      series1.Name = "Default";
-      this.chart.Series.Add(series1);
-      this.chart.Size = new System.Drawing.Size(168, 20);
-      this.chart.TabIndex = 3;
-      this.chart.Text = "Density";
-      // 
-      // textBox
-      // 
-      this.textBox.Location = new System.Drawing.Point(6, 35);
-      this.textBox.Name = "textBox";
-      this.textBox.ReadOnly = true;
-      this.textBox.Size = new System.Drawing.Size(132, 20);
-      this.textBox.TabIndex = 4;
-      // 
-      // groupBox
-      // 
-      this.groupBox.Controls.Add(this.radioButton);
-      this.groupBox.Controls.Add(this.doubleLimitView);
-      this.groupBox.Controls.Add(this.chart);
-      this.groupBox.Controls.Add(this.trackBar);
-      this.groupBox.Controls.Add(this.textBox);
-      this.groupBox.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.groupBox.Location = new System.Drawing.Point(0, 0);
-      this.groupBox.Name = "groupBox";
-      this.groupBox.Size = new System.Drawing.Size(500, 62);
-      this.groupBox.TabIndex = 5;
-      this.groupBox.TabStop = false;
-      // 
-      // DensityTrackbar
-      // 
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
-      this.Controls.Add(this.groupBox);
-      this.Name = "DensityTrackbar";
-      this.Size = new System.Drawing.Size(500, 62);
-      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit();
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
-      this.groupBox.ResumeLayout(false);
-      this.groupBox.PerformLayout();
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-    private System.Windows.Forms.RadioButton radioButton;
-    private System.Windows.Forms.TrackBar trackBar;
-    private Problems.DataAnalysis.Views.DoubleLimitView doubleLimitView;
-    private Visualization.ChartControlsExtensions.EnhancedChart chart;
-    private System.Windows.Forms.TextBox textBox;
-    private System.Windows.Forms.GroupBox groupBox;
-  }
-}
Index: anches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/DensityTrackbar.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/DensityTrackbar.cs	(revision 13823)
+++ 	(revision )
@@ -1,164 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 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;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Windows.Forms;
-using System.Windows.Forms.DataVisualization.Charting;
-using HeuristicLab.Problems.DataAnalysis;
-
-namespace HeuristicLab.Algorithms.DataAnalysis.Views {
-  public partial class DensityTrackbar : UserControl {
-
-    public decimal Value {
-      get { return TickToValue(trackBar.Value); }
-      set { trackBar.Value = ValueToTick(value); }
-    }
-    public event EventHandler ValueChanged;
-
-    public bool Checked {
-      get { return radioButton.Checked; }
-      set { radioButton.Checked = value; }
-    }
-    public event EventHandler CheckedChanged;
-
-    public DoubleLimit Limits {
-      get { return doubleLimitView.Content; }
-    }
-    public event EventHandler LimitsChanged;
-
-    private IList<double> trainingValues;
-
-    internal DensityTrackbar() {
-      InitializeComponent();
-    }
-
-    public DensityTrackbar(string name, DoubleLimit limit, IList<double> trainingValues) {
-      InitializeComponent();
-
-      this.trainingValues = trainingValues;
-
-      doubleLimitView.Content = limit;
-      doubleLimitView.Content.ValueChanged += doubleLimit_ValueChanged;
-
-      textBox.Text = Value.ToString(CultureInfo.InvariantCulture);
-      radioButton.Text = name;
-
-      UpdateDensityChart();
-    }
-
-    public void UpdateTrainingValues(IList<double> trainingValues) {
-      this.trainingValues = trainingValues;
-      UpdateDensityChart();
-    }
-
-    private void UpdateDensityChart() {
-      var series = chart.Series[0];
-      ClearPointsQuick(series.Points);
-
-      int numBuckets = trackBar.Maximum - trackBar.Minimum;
-      var buckets = new double[numBuckets];
-      var bucketSize = (Limits.Upper - Limits.Lower) / buckets.Length;
-      foreach (var value in trainingValues) {
-        if (bucketSize > 0.0) {
-          int bucketIndex = (int)((value - Limits.Lower) / bucketSize);
-          if (bucketIndex == numBuckets) {
-            bucketIndex--;
-          }
-          buckets[bucketIndex] += 1.0;
-        }
-      }
-
-      // set minimum height of all non-zero buckets on 20% of maximum
-      double min = buckets.Max() / 20.0;
-      for (int i = 0; i < buckets.Length; i++) {
-        if (buckets[i] >= 1 && buckets[i] < min)
-          buckets[i] = min;
-      }
-
-      series.Points.DataBindY(buckets);
-    }
-
-    #region Event Handlers
-    private void trackBar_ValueChanged(object sender, EventArgs e) {
-      textBox.Text = Value.ToString(CultureInfo.InvariantCulture);
-      OnValueChanged();
-    }
-    private void doubleLimit_ValueChanged(object sender, EventArgs e) {
-      UpdateDensityChart();
-      OnLimitsChanged();
-      OnValueChanged();
-    }
-    private void radioButton_CheckedChanged(object sender, EventArgs e) {
-      Checked = radioButton.Checked;
-      trackBar.Enabled = !Checked;
-      textBox.Text = Checked ? "Plotted" : Value.ToString(CultureInfo.InvariantCulture);
-      OnCheckedChanged();
-    }
-    protected override void OnTextChanged(EventArgs e) {
-      base.OnTextChanged(e);
-      radioButton.Text = Text;
-    }
-    #endregion
-
-    protected virtual void OnValueChanged() {
-      if (ValueChanged != null)
-        ValueChanged(this, EventArgs.Empty);
-    }
-    protected virtual void OnCheckedChanged() {
-      if (CheckedChanged != null)
-        CheckedChanged(this, EventArgs.Empty);
-    }
-    protected virtual void OnLimitsChanged() {
-      if (LimitsChanged != null)
-        LimitsChanged(this, EventArgs.Empty);
-    }
-
-    #region Hepers
-
-    private decimal TickToValue(int tick) {
-      return TickToValue(tick, trackBar.Maximum - trackBar.Minimum, (decimal)Limits.Lower, (decimal)Limits.Upper);
-    }
-    private int ValueToTick(decimal value) {
-      return ValueToTick(value, trackBar.Maximum - trackBar.Minimum, (decimal)Limits.Lower, (decimal)Limits.Upper);
-    }
-    private static decimal TickToValue(int tick, int numberOfTicks, decimal lower, decimal upper) {
-      return lower + (upper - lower) * tick / numberOfTicks;
-    }
-    private static int ValueToTick(decimal value, int numberOfTicks, decimal lower, decimal upper) {
-      return (int)((value - lower) / ((upper - lower) / numberOfTicks));
-    }
-
-    // workaround as per http://stackoverflow.com/questions/5744930/datapointcollection-clear-performance
-    private static void ClearPointsQuick(DataPointCollection points) {
-      points.SuspendUpdates();
-      while (points.Count > 0)
-        points.RemoveAt(points.Count - 1);
-      points.ResumeUpdates();
-    }
-
-    #endregion
-
-
-  }
-}
Index: anches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.Designer.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.Designer.cs	(revision 13823)
+++ 	(revision )
@@ -1,151 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
-  partial class GaussianProcessRegressionSolutionInteractiveRangeEstimatorView {
-    /// <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.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
-      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
-      this.splitContainer = new System.Windows.Forms.SplitContainer();
-      this.configurationGroupBox = new System.Windows.Forms.GroupBox();
-      this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
-      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
-      this.splitContainer.Panel1.SuspendLayout();
-      this.splitContainer.Panel2.SuspendLayout();
-      this.splitContainer.SuspendLayout();
-      this.configurationGroupBox.SuspendLayout();
-      this.SuspendLayout();
-      // 
-      // chart
-      // 
-      chartArea1.Name = "ChartArea";
-      this.chart.ChartAreas.Add(chartArea1);
-      this.chart.Dock = System.Windows.Forms.DockStyle.Fill;
-      legend1.Alignment = System.Drawing.StringAlignment.Center;
-      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
-      legend1.Name = "Default";
-      this.chart.Legends.Add(legend1);
-      this.chart.Location = new System.Drawing.Point(0, 0);
-      this.chart.Name = "chart";
-      this.chart.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.None;
-      this.chart.PaletteCustomColors = new System.Drawing.Color[] {
-        System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(180)))), ((int)(((byte)(65))))),
-        System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(140)))), ((int)(((byte)(240))))),
-        System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(58)))), ((int)(((byte)(2)))))};
-      this.chart.Size = new System.Drawing.Size(715, 376);
-      this.chart.TabIndex = 0;
-      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
-      this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Chart_MouseDoubleClick);
-      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
-      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
-      // 
-      // splitContainer
-      // 
-      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.splitContainer.Location = new System.Drawing.Point(0, 0);
-      this.splitContainer.Name = "splitContainer";
-      this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
-      // 
-      // splitContainer.Panel1
-      // 
-      this.splitContainer.Panel1.Controls.Add(this.chart);
-      // 
-      // splitContainer.Panel2
-      // 
-      this.splitContainer.Panel2.Controls.Add(this.configurationGroupBox);
-      this.splitContainer.Size = new System.Drawing.Size(715, 591);
-      this.splitContainer.SplitterDistance = 376;
-      this.splitContainer.TabIndex = 1;
-      // 
-      // configurationGroupBox
-      // 
-      this.configurationGroupBox.Controls.Add(this.tableLayoutPanel);
-      this.configurationGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.configurationGroupBox.Location = new System.Drawing.Point(0, 0);
-      this.configurationGroupBox.Name = "configurationGroupBox";
-      this.configurationGroupBox.Size = new System.Drawing.Size(715, 211);
-      this.configurationGroupBox.TabIndex = 1;
-      this.configurationGroupBox.TabStop = false;
-      this.configurationGroupBox.Text = "Configuration";
-      // 
-      // tableLayoutPanel
-      // 
-      this.tableLayoutPanel.AutoScroll = true;
-      this.tableLayoutPanel.ColumnCount = 1;
-      this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
-      this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.tableLayoutPanel.Location = new System.Drawing.Point(3, 16);
-      this.tableLayoutPanel.Name = "tableLayoutPanel";
-      this.tableLayoutPanel.RowCount = 1;
-      this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
-      this.tableLayoutPanel.Size = new System.Drawing.Size(709, 192);
-      this.tableLayoutPanel.TabIndex = 0;
-      // 
-      // GaussianProcessRegressionSolutionInteractiveRangeEstimatorView
-      // 
-      this.AllowDrop = true;
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
-      this.Controls.Add(this.splitContainer);
-      this.Name = "GaussianProcessRegressionSolutionInteractiveRangeEstimatorView";
-      this.Size = new System.Drawing.Size(715, 591);
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
-      this.splitContainer.Panel1.ResumeLayout(false);
-      this.splitContainer.Panel2.ResumeLayout(false);
-      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
-      this.splitContainer.ResumeLayout(false);
-      this.configurationGroupBox.ResumeLayout(false);
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
-    private System.Windows.Forms.SplitContainer splitContainer;
-    private System.Windows.Forms.GroupBox configurationGroupBox;
-    private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
-  }
-}
Index: anches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.cs	(revision 13823)
+++ 	(revision )
@@ -1,322 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2016 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;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-using System.Windows.Forms;
-using System.Windows.Forms.DataVisualization.Charting;
-using HeuristicLab.Collections;
-using HeuristicLab.Data;
-using HeuristicLab.MainForm;
-using HeuristicLab.MainForm.WindowsForms;
-using HeuristicLab.Problems.DataAnalysis;
-using HeuristicLab.Problems.DataAnalysis.Views;
-using HeuristicLab.Visualization.ChartControlsExtensions;
-
-namespace HeuristicLab.Algorithms.DataAnalysis.Views {
-  [View("Interactive Estimator")]
-  [Content(typeof(GaussianProcessRegressionSolution))]
-  public partial class GaussianProcessRegressionSolutionInteractiveRangeEstimatorView
-    : DataAnalysisSolutionEvaluationView {
-
-    private const int DrawingSteps = 1000;
-
-    private const string EstimatedMeanSeriesName = "Estimated Mean";
-    private const string EstimatedVarianceSeriesName = "95% Conficence Interval";
-
-    private readonly List<string> dimensionNames;
-    private readonly ObservableList<DensityTrackbar> dimensionTrackbars;
-
-    private int ActiveDimension {
-      get { return dimensionTrackbars.FindIndex(tb => tb.Checked); }
-    }
-
-    public new GaussianProcessRegressionSolution Content {
-      get { return (GaussianProcessRegressionSolution)base.Content; }
-      set { base.Content = value; }
-    }
-
-    public GaussianProcessRegressionSolutionInteractiveRangeEstimatorView()
-      : base() {
-      dimensionNames = new List<string>();
-
-      dimensionTrackbars = new ObservableList<DensityTrackbar>();
-      dimensionTrackbars.ItemsAdded += (sender, args) => {
-        ForEach(args.Items.Select(i => i.Value), RegisterEvents);
-      };
-      dimensionTrackbars.ItemsRemoved += (sender, args) => {
-        ForEach(args.Items.Select(i => i.Value), DeregisterEvents);
-      };
-      dimensionTrackbars.CollectionReset += (sender, args) => {
-        ForEach(args.OldItems.Select(i => i.Value), DeregisterEvents);
-        ForEach(args.Items.Select(i => i.Value), RegisterEvents);
-      };
-
-
-      InitializeComponent();
-
-      // Avoid additional horizontal scrollbar
-      var vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
-      tableLayoutPanel.Padding = new Padding(0, 0, vertScrollWidth, 0);
-
-      // Configure axis
-      chart.CustomizeAllChartAreas();
-      chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
-      chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
-      chart.ChartAreas[0].CursorX.Interval = 1;
-
-      chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
-      chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
-      chart.ChartAreas[0].CursorY.Interval = 0;
-    }
-
-    private void RedrawChart() {
-      chart.Series.Clear();
-      chart.ChartAreas[0].AxisX.StripLines.Clear();
-      if (Content == null || ActiveDimension < 0) return;
-
-      double minX = dimensionTrackbars[ActiveDimension].Limits.Lower;
-      double maxX = dimensionTrackbars[ActiveDimension].Limits.Upper;
-      decimal stepSize = (decimal)((maxX - minX) / DrawingSteps);
-
-      // Build dataset
-      var activeXs = Enumerable.Range(0, DrawingSteps).Select(i => (decimal)minX + i * stepSize).ToList();
-      var fixedXs = dimensionTrackbars.Select(tb => tb.Value).ToList();
-      var values = new double[DrawingSteps, dimensionNames.Count];
-      for (int r = 0; r < DrawingSteps; r++) {
-        for (int c = 0; c < dimensionNames.Count; c++) {
-          values[r, c] = (double)(c == ActiveDimension ? activeXs[r] : fixedXs[c]);
-        }
-      }
-      var dataset = new Dataset(dimensionNames, values);
-
-      // Estimations
-      var model = Content.Model;
-      var means = model.GetEstimatedValues(dataset, Enumerable.Range(0, DrawingSteps)).ToList();
-      var variances = model.GetEstimatedVariances(dataset, Enumerable.Range(0, DrawingSteps)).ToList();
-
-      // Charting config
-      chart.ChartAreas[0].AxisX.Minimum = minX;
-      chart.ChartAreas[0].AxisX.Maximum = maxX;
-      chart.ChartAreas[0].AxisX.Interval = (maxX - minX) / 10;
-
-      // ToDo only databind and put config in codebehind
-      chart.Series.Add(EstimatedVarianceSeriesName);
-      chart.Series[EstimatedVarianceSeriesName].LegendText = EstimatedVarianceSeriesName;
-      chart.Series[EstimatedVarianceSeriesName].ChartType = SeriesChartType.Range;
-      chart.Series[EstimatedVarianceSeriesName].EmptyPointStyle.Color = chart.Series[EstimatedVarianceSeriesName].Color;
-
-      chart.Series.Add(EstimatedMeanSeriesName);
-      chart.Series[EstimatedMeanSeriesName].LegendText = EstimatedMeanSeriesName;
-      chart.Series[EstimatedMeanSeriesName].ChartType = SeriesChartType.FastLine;
-
-      // Charting databind
-      var lower = means.Zip(variances, GetLowerConfBound).ToList();
-      var upper = means.Zip(variances, GetUpperConfBound).ToList();
-      chart.Series[EstimatedVarianceSeriesName].Points.DataBindXY(activeXs, lower, upper);
-      chart.Series[EstimatedMeanSeriesName].Points.DataBindXY(activeXs, means);
-
-      // Update StripLines
-      var trainingValues = Content.ProblemData.Dataset.GetDoubleValues(dimensionNames[ActiveDimension],
-        Content.ProblemData.TrainingIndices);
-      var trainingRange = new DoubleRange(trainingValues.Min(), trainingValues.Max());
-      if (minX < trainingRange.Start)
-        CreateAndAddStripLine(minX, trainingRange.Start, Color.FromArgb(40, 223, 58, 2), Color.Transparent);
-      if (maxX > trainingRange.End)
-        CreateAndAddStripLine(trainingRange.End, maxX, Color.FromArgb(40, 223, 58, 2), Color.Transparent);
-
-      // Update axis description
-      chart.ChartAreas[0].AxisX.Title = dimensionNames[ActiveDimension];
-    }
-
-    private void CreateAndAddStripLine(double start, double end, Color color, Color secondColor) {
-      StripLine stripLine = new StripLine {
-        BackColor = color,
-        BackSecondaryColor = secondColor,
-        StripWidth = end - start,
-        IntervalOffset = start
-      };
-      chart.ChartAreas[0].AxisX.StripLines.Add(stripLine);
-    }
-
-    private void UpdateConfigurationControls() {
-      tableLayoutPanel.SuspendRepaint();
-      tableLayoutPanel.SuspendLayout();
-
-      tableLayoutPanel.RowCount = 0;
-      tableLayoutPanel.Controls.Clear();
-
-      dimensionNames.Clear();
-      dimensionTrackbars.Clear();
-
-      if (Content == null) {
-        tableLayoutPanel.ResumeLayout(true);
-        tableLayoutPanel.ResumeRepaint(true);
-        return;
-      }
-
-      dimensionNames.AddRange(Content.ProblemData.AllowedInputVariables);
-      var ranges = new List<DoubleLimit>();
-      for (int i = 0; i < dimensionNames.Count; i++) {
-        var values = Content.ProblemData.Dataset.GetDoubleValues(dimensionNames[i], Content.ProblemData.AllIndices);
-        double min, max, interval;
-        ChartUtil.CalculateAxisInterval(values.Min(), values.Max(), 10, out min, out max, out interval);
-        ranges.Add(new DoubleLimit(min, max));
-      }
-
-      tableLayoutPanel.RowCount = dimensionNames.Count;
-      while (tableLayoutPanel.RowStyles.Count < dimensionNames.Count)
-        tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
-
-      for (int i = 0; i < dimensionNames.Count; i++) {
-        var name = dimensionNames[i];
-        var trainingData =
-          Content.ProblemData.Dataset.GetDoubleValues(name, Content.ProblemData.TrainingIndices).ToList();
-
-        var dimensionTrackbar = new DensityTrackbar(name, ranges[i], trainingData);
-
-        // events registered automatically
-        dimensionTrackbars.Add(dimensionTrackbar);
-
-        dimensionTrackbar.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
-        tableLayoutPanel.Controls.Add(dimensionTrackbar, 0, i);
-      }
-
-      if (dimensionTrackbars.Any())
-        dimensionTrackbars.First().Checked = true;
-
-      tableLayoutPanel.ResumeLayout(true);
-      tableLayoutPanel.ResumeRepaint(true);
-    }
-
-    private void RegisterEvents(DensityTrackbar trackbar) {
-      trackbar.CheckedChanged += DimensionTrackbar_CheckedChanged;
-      trackbar.ValueChanged += DimensionTrackbar_ValueChanged;
-      trackbar.LimitsChanged += DimensionTrackbar_LimitsChanged;
-    }
-
-    private void DeregisterEvents(DensityTrackbar trackbar) {
-      trackbar.CheckedChanged -= DimensionTrackbar_CheckedChanged;
-      trackbar.ValueChanged -= DimensionTrackbar_ValueChanged;
-      trackbar.LimitsChanged -= DimensionTrackbar_LimitsChanged;
-    }
-
-    private void DimensionTrackbar_CheckedChanged(object sender, EventArgs e) {
-      var trackBarSender = sender as DensityTrackbar;
-      if (trackBarSender == null || !trackBarSender.Checked) return;
-      // Uncheck all others
-      foreach (var tb in dimensionTrackbars.Except(new[] { trackBarSender }))
-        tb.Checked = false;
-      RedrawChart();
-    }
-
-    private void DimensionTrackbar_LimitsChanged(object sender, EventArgs e) {
-      RedrawChart();
-    }
-
-    private void DimensionTrackbar_ValueChanged(object sender, EventArgs e) {
-      RedrawChart();
-    }
-
-    #region Events
-
-    protected override void RegisterContentEvents() {
-      base.RegisterContentEvents();
-      Content.ModelChanged += Content_ModelChanged;
-      Content.ProblemDataChanged += Content_ProblemDataChanged;
-    }
-
-    protected override void DeregisterContentEvents() {
-      base.DeregisterContentEvents();
-      Content.ModelChanged -= Content_ModelChanged;
-      Content.ProblemDataChanged -= Content_ProblemDataChanged;
-    }
-
-    protected override void OnContentChanged() {
-      base.OnContentChanged();
-      UpdateConfigurationControls();
-      RedrawChart();
-    }
-
-    private void Content_ModelChanged(object sender, EventArgs e) {
-      RedrawChart();
-    }
-
-    private void Content_ProblemDataChanged(object sender, EventArgs e) {
-      UpdateConfigurationControls();
-      RedrawChart();
-    }
-
-    private void Chart_MouseDoubleClick(object sender, MouseEventArgs e) {
-      var result = chart.HitTest(e.X, e.Y);
-      if (true || result.ChartArea != null && (result.ChartElementType == ChartElementType.PlottingArea ||
-                                               result.ChartElementType == ChartElementType.Gridlines) ||
-          result.ChartElementType == ChartElementType.StripLines) {
-        foreach (var axis in result.ChartArea.Axes)
-          axis.ScaleView.ZoomReset(int.MaxValue);
-      }
-    }
-
-    private void chart_MouseMove(object sender, MouseEventArgs e) {
-      //HitTestResult result = chart.HitTest(e.X, e.Y);
-      //if (result.ChartElementType == ChartElementType.LegendItem && result.Series.Name != TARGETVARIABLE_SERIES_NAME)
-      //  Cursor = Cursors.Hand;
-      //else
-      //  Cursor = Cursors.Default;
-    }
-
-    private void chart_MouseDown(object sender, MouseEventArgs e) {
-      //HitTestResult result = chart.HitTest(e.X, e.Y);
-      //if (result.ChartElementType == ChartElementType.LegendItem && result.Series.Name != TARGETVARIABLE_SERIES_NAME) {
-      //  ToggleSeriesData(result.Series);
-      //}
-    }
-
-    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
-      //if (chart.Series.Count != 4) return;
-      //e.LegendItems[0].Cells[1].ForeColor = this.chart.Series[EstimatedMeanSeriesName].Points.Count == 0 ? Color.Gray : Color.Black;
-      //e.LegendItems[1].Cells[1].ForeColor = this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
-      //e.LegendItems[2].Cells[1].ForeColor = this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
-      //e.LegendItems[3].Cells[1].ForeColor = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
-    }
-
-    #endregion
-
-    #region Helper
-
-    private double GetLowerConfBound(double m, double s2) {
-      return m - 1.96 * Math.Sqrt(s2);
-    }
-
-    private double GetUpperConfBound(double m, double s2) {
-      return m + 1.96 * Math.Sqrt(s2);
-    }
-
-    public static void ForEach<T>(IEnumerable<T> source, Action<T> action) {
-      foreach (T item in source)
-        action(item);
-    }
-
-    #endregion
-  }
-}
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj	(revision 13823)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj	(revision 13824)
@@ -195,10 +195,4 @@
       <DependentUpon>GaussianProcessRegressionSolutionEstimatedValuesView.cs</DependentUpon>
     </Compile>
-    <Compile Include="DensityTrackbar.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="DensityTrackbar.Designer.cs">
-      <DependentUpon>DensityTrackbar.cs</DependentUpon>
-    </Compile>
     <Compile Include="MeanProdView.cs">
       <SubType>UserControl</SubType>
@@ -255,10 +249,4 @@
     <Compile Include="GaussianProcessRegressionSolutionLineChartView.Designer.cs">
       <DependentUpon>GaussianProcessRegressionSolutionLineChartView.cs</DependentUpon>
-    </Compile>
-    <Compile Include="GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.Designer.cs">
-      <DependentUpon>GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.cs</DependentUpon>
     </Compile>
     <Compile Include="SupportVectorMachineModelSupportVectorsView.cs">
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs	(revision 13823)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs	(revision 13824)
@@ -20,6 +20,4 @@
 #endregion
 
-using System.Collections.Generic;
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -33,6 +31,5 @@
   [Item("GaussianProcessRegressionSolution", "Represents a Gaussian process solution for a regression problem which can be visualized in the GUI.")]
   [StorableClass]
-  public sealed class GaussianProcessRegressionSolution : RegressionSolution, IGaussianProcessSolution, IConfidenceBoundRegressionSolution {
-    private new readonly Dictionary<int, double> evaluationCache;
+  public sealed class GaussianProcessRegressionSolution : ConfidenceBoundRegressionSolution, IGaussianProcessSolution {
 
     public new IGaussianProcessModel Model {
@@ -44,51 +41,13 @@
     private GaussianProcessRegressionSolution(bool deserializing)
       : base(deserializing) {
-      evaluationCache = new Dictionary<int, double>();
-
     }
     private GaussianProcessRegressionSolution(GaussianProcessRegressionSolution original, Cloner cloner)
-      : base(original, cloner) {
-      evaluationCache = new Dictionary<int, double>(original.evaluationCache);
-    }
+      : base(original, cloner) { }
     public GaussianProcessRegressionSolution(IGaussianProcessModel model, IRegressionProblemData problemData)
-      : base(model, problemData) {
-
-      evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows);
-    }
+      : base(model, problemData) { }
 
     public override IDeepCloneable Clone(Cloner cloner) {
       return new GaussianProcessRegressionSolution(this, cloner);
     }
-
-    public IEnumerable<double> EstimatedVariances {
-      get { return GetEstimatedVariances(Enumerable.Range(0, ProblemData.Dataset.Rows)); }
-    }
-    public IEnumerable<double> EstimatedTrainingVariances {
-      get { return GetEstimatedVariances(ProblemData.TrainingIndices); }
-    }
-    public IEnumerable<double> EstimatedTestVariances {
-      get { return GetEstimatedVariances(ProblemData.TestIndices); }
-    }
-
-    public IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows) {
-      var rowsToEvaluate = rows.Except(evaluationCache.Keys);
-      var rowsEnumerator = rowsToEvaluate.GetEnumerator();
-      var valuesEnumerator = Model.GetEstimatedVariances(ProblemData.Dataset, rowsToEvaluate).GetEnumerator();
-
-      while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) {
-        evaluationCache.Add(rowsEnumerator.Current, valuesEnumerator.Current);
-      }
-
-      return rows.Select(row => evaluationCache[row]);
-    }
-
-    protected override void OnModelChanged() {
-      evaluationCache.Clear();
-      base.OnModelChanged();
-    }
-    protected override void OnProblemDataChanged() {
-      evaluationCache.Clear();
-      base.OnProblemDataChanged();
-    }
   }
 }
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessSolution.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessSolution.cs	(revision 13823)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessSolution.cs	(revision 13824)
@@ -26,5 +26,5 @@
   /// Interface to represent a Gaussian process solution (either regression or classification)
   /// </summary>
-  public interface IGaussianProcessSolution : IDataAnalysisSolution {
+  public interface IGaussianProcessSolution : IConfidenceBoundRegressionSolution {
     new IGaussianProcessModel Model { get; }
   }
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs	(revision 13824)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs	(revision 13824)
@@ -0,0 +1,173 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
+  partial class DensityTrackbar {
+    /// <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.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
+      this.radioButton = new System.Windows.Forms.RadioButton();
+      this.trackBar = new System.Windows.Forms.TrackBar();
+      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
+      this.textBox = new System.Windows.Forms.TextBox();
+      this.groupBox = new System.Windows.Forms.GroupBox();
+      this.doubleLimitView = new HeuristicLab.Problems.DataAnalysis.Views.DoubleLimitView();
+      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
+      this.groupBox.SuspendLayout();
+      this.SuspendLayout();
+      // 
+      // radioButton
+      // 
+      this.radioButton.Location = new System.Drawing.Point(6, 11);
+      this.radioButton.Name = "radioButton";
+      this.radioButton.Size = new System.Drawing.Size(132, 17);
+      this.radioButton.TabIndex = 0;
+      this.radioButton.TabStop = true;
+      this.radioButton.Text = "<Name>";
+      this.radioButton.UseVisualStyleBackColor = true;
+      this.radioButton.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged);
+      // 
+      // trackBar
+      // 
+      this.trackBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.trackBar.BackColor = System.Drawing.Color.White;
+      this.trackBar.LargeChange = 100;
+      this.trackBar.Location = new System.Drawing.Point(144, 10);
+      this.trackBar.Maximum = 1000;
+      this.trackBar.Name = "trackBar";
+      this.trackBar.RightToLeft = System.Windows.Forms.RightToLeft.No;
+      this.trackBar.Size = new System.Drawing.Size(371, 45);
+      this.trackBar.TabIndex = 1;
+      this.trackBar.TickFrequency = 100;
+      this.trackBar.Value = 500;
+      this.trackBar.ValueChanged += new System.EventHandler(this.trackBar_ValueChanged);
+      // 
+      // chart
+      // 
+      this.chart.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.chart.BorderlineColor = System.Drawing.Color.Transparent;
+      chartArea1.AxisX.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
+      chartArea1.AxisX.IsMarginVisible = false;
+      chartArea1.AxisY.Enabled = System.Windows.Forms.DataVisualization.Charting.AxisEnabled.False;
+      chartArea1.AxisY.IsMarginVisible = false;
+      chartArea1.AxisY.MajorTickMark.Enabled = false;
+      chartArea1.AxisY.Minimum = 0D;
+      chartArea1.BackColor = System.Drawing.Color.Transparent;
+      chartArea1.BorderColor = System.Drawing.Color.Transparent;
+      chartArea1.Name = "ChartArea1";
+      chartArea1.Position.Auto = false;
+      chartArea1.Position.Height = 100F;
+      chartArea1.Position.Width = 100F;
+      this.chart.ChartAreas.Add(chartArea1);
+      this.chart.Location = new System.Drawing.Point(156, 35);
+      this.chart.Name = "chart";
+      series1.ChartArea = "ChartArea1";
+      series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StepLine;
+      series1.Name = "Default";
+      this.chart.Series.Add(series1);
+      this.chart.Size = new System.Drawing.Size(345, 20);
+      this.chart.TabIndex = 3;
+      this.chart.Text = "Density";
+      // 
+      // textBox
+      // 
+      this.textBox.Location = new System.Drawing.Point(6, 35);
+      this.textBox.Name = "textBox";
+      this.textBox.ReadOnly = true;
+      this.textBox.Size = new System.Drawing.Size(132, 20);
+      this.textBox.TabIndex = 4;
+      // 
+      // groupBox
+      // 
+      this.groupBox.Controls.Add(this.radioButton);
+      this.groupBox.Controls.Add(this.doubleLimitView);
+      this.groupBox.Controls.Add(this.chart);
+      this.groupBox.Controls.Add(this.trackBar);
+      this.groupBox.Controls.Add(this.textBox);
+      this.groupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.groupBox.Location = new System.Drawing.Point(0, 0);
+      this.groupBox.Name = "groupBox";
+      this.groupBox.Size = new System.Drawing.Size(678, 62);
+      this.groupBox.TabIndex = 5;
+      this.groupBox.TabStop = false;
+      // 
+      // doubleLimitView
+      // 
+      this.doubleLimitView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+      this.doubleLimitView.Caption = "DoubleLimit View";
+      this.doubleLimitView.Content = null;
+      this.doubleLimitView.Location = new System.Drawing.Point(521, 10);
+      this.doubleLimitView.Name = "doubleLimitView";
+      this.doubleLimitView.ReadOnly = false;
+      this.doubleLimitView.Size = new System.Drawing.Size(151, 47);
+      this.doubleLimitView.TabIndex = 2;
+      // 
+      // DensityTrackbar
+      // 
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.groupBox);
+      this.Name = "DensityTrackbar";
+      this.Size = new System.Drawing.Size(678, 62);
+      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit();
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
+      this.groupBox.ResumeLayout(false);
+      this.groupBox.PerformLayout();
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.RadioButton radioButton;
+    private System.Windows.Forms.TrackBar trackBar;
+    private Problems.DataAnalysis.Views.DoubleLimitView doubleLimitView;
+    private Visualization.ChartControlsExtensions.EnhancedChart chart;
+    private System.Windows.Forms.TextBox textBox;
+    private System.Windows.Forms.GroupBox groupBox;
+  }
+}
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.cs	(revision 13824)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.cs	(revision 13824)
@@ -0,0 +1,171 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.Common;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
+  public partial class DensityTrackbar : UserControl {
+
+    public decimal Value {
+      get { return TickToValue(trackBar.Value); }
+      set { trackBar.Value = ValueToTick(value); }
+    }
+    public event EventHandler ValueChanged;
+
+    public bool Checked {
+      get { return radioButton.Checked; }
+      set { radioButton.Checked = value; }
+    }
+    public event EventHandler CheckedChanged;
+
+    public DoubleLimit Limits {
+      get { return doubleLimitView.Content; }
+    }
+    public event EventHandler LimitsChanged;
+
+    private IList<double> trainingValues;
+
+    // For VisualStudio Designer
+    internal DensityTrackbar() {
+      InitializeComponent();
+    }
+
+    public DensityTrackbar(string name, DoubleLimit limit, IList<double> trainingValues) {
+      InitializeComponent();
+
+      this.trainingValues = trainingValues;
+
+      doubleLimitView.Content = limit;
+      doubleLimitView.Content.ValueChanged += doubleLimit_ValueChanged;
+
+      textBox.Text = Value.ToString(CultureInfo.InvariantCulture);
+      radioButton.Text = name;
+
+      UpdateDensityChart();
+    }
+
+    public void UpdateTrainingValues(IList<double> trainingValues) {
+      this.trainingValues = trainingValues;
+      UpdateDensityChart();
+    }
+
+    private void UpdateDensityChart() {
+      var series = chart.Series[0];
+      ClearPointsQuick(series.Points);
+
+      int numBuckets = trackBar.Maximum - trackBar.Minimum;
+      var buckets = new double[numBuckets];
+      var bucketSize = (Limits.Upper - Limits.Lower) / buckets.Length;
+      foreach (var value in trainingValues) {
+        if (bucketSize > 0.0) {
+          int bucketIndex = (int)((value - Limits.Lower) / bucketSize);
+          if (bucketIndex == numBuckets) {
+            bucketIndex--;
+          }
+          buckets[bucketIndex] += 1.0;
+        }
+      }
+
+      // set minimum height of all non-zero buckets on 20% of maximum
+      double min = buckets.Max() / 20.0;
+      for (int i = 0; i < buckets.Length; i++) {
+        if (buckets[i] >= 1 && buckets[i] < min)
+          buckets[i] = min;
+      }
+
+      series.Points.DataBindY(buckets);
+
+      // Set trackbar on highest density
+      double highestDensity = buckets.Max();
+      var highestIndices = buckets.Select((v, i) => new { v, i }).Where(x => x.v.IsAlmost(highestDensity)).Select(x => x.i).ToList();
+      trackBar.Value = highestIndices[highestIndices.Count / 2];
+    }
+
+    #region Event Handlers
+    private void trackBar_ValueChanged(object sender, EventArgs e) {
+      textBox.Text = Value.ToString(CultureInfo.InvariantCulture);
+      OnValueChanged();
+    }
+    private void doubleLimit_ValueChanged(object sender, EventArgs e) {
+      UpdateDensityChart();
+      OnLimitsChanged();
+      OnValueChanged();
+    }
+    private void radioButton_CheckedChanged(object sender, EventArgs e) {
+      Checked = radioButton.Checked;
+      trackBar.Enabled = !Checked;
+      textBox.Text = Checked ? "Plotted" : Value.ToString(CultureInfo.InvariantCulture);
+      OnCheckedChanged();
+    }
+    protected override void OnTextChanged(EventArgs e) {
+      base.OnTextChanged(e);
+      radioButton.Text = Text;
+    }
+    #endregion
+
+    protected virtual void OnValueChanged() {
+      if (ValueChanged != null)
+        ValueChanged(this, EventArgs.Empty);
+    }
+    protected virtual void OnCheckedChanged() {
+      if (CheckedChanged != null)
+        CheckedChanged(this, EventArgs.Empty);
+    }
+    protected virtual void OnLimitsChanged() {
+      if (LimitsChanged != null)
+        LimitsChanged(this, EventArgs.Empty);
+    }
+
+    #region Hepers
+
+    private decimal TickToValue(int tick) {
+      return TickToValue(tick, trackBar.Maximum - trackBar.Minimum, (decimal)Limits.Lower, (decimal)Limits.Upper);
+    }
+    private int ValueToTick(decimal value) {
+      return ValueToTick(value, trackBar.Maximum - trackBar.Minimum, (decimal)Limits.Lower, (decimal)Limits.Upper);
+    }
+    private static decimal TickToValue(int tick, int numberOfTicks, decimal lower, decimal upper) {
+      return lower + (upper - lower) * tick / numberOfTicks;
+    }
+    private static int ValueToTick(decimal value, int numberOfTicks, decimal lower, decimal upper) {
+      return (int)((value - lower) / ((upper - lower) / numberOfTicks));
+    }
+
+    // workaround as per http://stackoverflow.com/questions/5744930/datapointcollection-clear-performance
+    private static void ClearPointsQuick(DataPointCollection points) {
+      points.SuspendUpdates();
+      while (points.Count > 0)
+        points.RemoveAt(points.Count - 1);
+      points.ResumeUpdates();
+    }
+
+    #endregion
+
+
+  }
+}
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 13823)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 13824)
@@ -103,8 +103,4 @@
       <Private>False</Private>
     </Reference>
-    <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4">
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis-3.4.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
     <Reference Include="HeuristicLab.Analysis-3.3">
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
@@ -250,4 +246,10 @@
       <DependentUpon>ClusteringSolutionVisualizationView.cs</DependentUpon>
     </Compile>
+    <Compile Include="DensityTrackbar.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="DensityTrackbar.Designer.cs">
+      <DependentUpon>DensityTrackbar.cs</DependentUpon>
+    </Compile>
     <Compile Include="FeatureCorrelation\AbstractFeatureCorrelationView.cs">
       <SubType>UserControl</SubType>
@@ -268,4 +270,10 @@
     <Compile Include="FeatureCorrelation\FeatureCorrelationView.Designer.cs">
       <DependentUpon>FeatureCorrelationView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="RegressionSolutionGradientView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="RegressionSolutionGradientView.Designer.cs">
+      <DependentUpon>RegressionSolutionGradientView.cs</DependentUpon>
     </Compile>
     <Compile Include="Interfaces\IDataPreprocessorStarter.cs" />
@@ -283,10 +291,4 @@
     <Compile Include="ProblemDataView.Designer.cs">
       <DependentUpon>ProblemDataView.cs</DependentUpon>
-    </Compile>
-    <Compile Include="RegressionSolutionGradientView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="RegressionSolutionGradientView.Designer.cs">
-      <DependentUpon>RegressionSolutionGradientView.cs</DependentUpon>
     </Compile>
     <Compile Include="RegressionSolutionTargetResponseGradientView.cs">
@@ -500,4 +502,8 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Algorithms.DataAnalysis\3.4\HeuristicLab.Algorithms.DataAnalysis-3.4.csproj">
+      <Project>{2E782078-FA81-4B70-B56F-74CE38DAC6C8}</Project>
+      <Name>HeuristicLab.Algorithms.DataAnalysis-3.4</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
       <Project>{df87c13e-a889-46ff-8153-66dcaa8c5674}</Project>
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.Designer.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.Designer.cs	(revision 13823)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.Designer.cs	(revision 13824)
@@ -1,3 +1,24 @@
-﻿namespace HeuristicLab.Problems.DataAnalysis.Views {
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Algorithms.DataAnalysis.Views {
   partial class RegressionSolutionGradientView {
     /// <summary> 
@@ -25,64 +46,106 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
-      this.label1 = new System.Windows.Forms.Label();
-      this.variableComboBox = new System.Windows.Forms.ComboBox();
-      this.gradientChart1 = new HeuristicLab.Problems.DataAnalysis.Views.GradientChart();
-      ((System.ComponentModel.ISupportInitialize)(this.gradientChart1)).BeginInit();
+      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
+      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
+      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
+      this.splitContainer = new System.Windows.Forms.SplitContainer();
+      this.configurationGroupBox = new System.Windows.Forms.GroupBox();
+      this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+      this.splitContainer.Panel1.SuspendLayout();
+      this.splitContainer.Panel2.SuspendLayout();
+      this.splitContainer.SuspendLayout();
+      this.configurationGroupBox.SuspendLayout();
       this.SuspendLayout();
       // 
-      // label1
+      // chart
       // 
-      this.label1.AutoSize = true;
-      this.label1.Location = new System.Drawing.Point(5, 7);
-      this.label1.Name = "label1";
-      this.label1.Size = new System.Drawing.Size(48, 13);
-      this.label1.TabIndex = 1;
-      this.label1.Text = "Variable:";
+      chartArea1.Name = "ChartArea";
+      this.chart.ChartAreas.Add(chartArea1);
+      this.chart.Dock = System.Windows.Forms.DockStyle.Fill;
+      legend1.Alignment = System.Drawing.StringAlignment.Center;
+      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
+      legend1.Name = "Default";
+      this.chart.Legends.Add(legend1);
+      this.chart.Location = new System.Drawing.Point(0, 0);
+      this.chart.Name = "chart";
+      this.chart.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.None;
+      this.chart.PaletteCustomColors = new System.Drawing.Color[] {
+        System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(180)))), ((int)(((byte)(65))))),
+        System.Drawing.Color.FromArgb(((int)(((byte)(65)))), ((int)(((byte)(140)))), ((int)(((byte)(240))))),
+        System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(58)))), ((int)(((byte)(2)))))};
+      this.chart.Size = new System.Drawing.Size(715, 376);
+      this.chart.TabIndex = 0;
+      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
+      this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Chart_MouseDoubleClick);
+      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
+      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
       // 
-      // variableComboBox
+      // splitContainer
       // 
-      this.variableComboBox.FormattingEnabled = true;
-      this.variableComboBox.Location = new System.Drawing.Point(59, 4);
-      this.variableComboBox.Name = "variableComboBox";
-      this.variableComboBox.Size = new System.Drawing.Size(121, 21);
-      this.variableComboBox.TabIndex = 2;
-      this.variableComboBox.SelectedIndexChanged += new System.EventHandler(this.variableComboBox_SelectedIndexChanged);
+      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.splitContainer.Location = new System.Drawing.Point(0, 0);
+      this.splitContainer.Name = "splitContainer";
+      this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
       // 
-      // gradientChart1
+      // splitContainer.Panel1
       // 
-      this.gradientChart1.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.gradientChart1.Location = new System.Drawing.Point(3, 31);
-      this.gradientChart1.Max = 0D;
-      this.gradientChart1.Min = 0D;
-      this.gradientChart1.Name = "gradientChart1";
-      this.gradientChart1.Points = 0;
-      this.gradientChart1.Row = 0;
-      this.gradientChart1.Size = new System.Drawing.Size(944, 532);
-      this.gradientChart1.TabIndex = 3;
-      this.gradientChart1.Text = "gradientChart1";
-      this.gradientChart1.UseMedianValues = false;
-      this.gradientChart1.Variable = null;
+      this.splitContainer.Panel1.Controls.Add(this.chart);
+      // 
+      // splitContainer.Panel2
+      // 
+      this.splitContainer.Panel2.Controls.Add(this.configurationGroupBox);
+      this.splitContainer.Size = new System.Drawing.Size(715, 591);
+      this.splitContainer.SplitterDistance = 376;
+      this.splitContainer.TabIndex = 1;
+      // 
+      // configurationGroupBox
+      // 
+      this.configurationGroupBox.Controls.Add(this.tableLayoutPanel);
+      this.configurationGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.configurationGroupBox.Location = new System.Drawing.Point(0, 0);
+      this.configurationGroupBox.Name = "configurationGroupBox";
+      this.configurationGroupBox.Size = new System.Drawing.Size(715, 211);
+      this.configurationGroupBox.TabIndex = 1;
+      this.configurationGroupBox.TabStop = false;
+      this.configurationGroupBox.Text = "Configuration";
+      // 
+      // tableLayoutPanel
+      // 
+      this.tableLayoutPanel.AutoScroll = true;
+      this.tableLayoutPanel.ColumnCount = 1;
+      this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+      this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.tableLayoutPanel.Location = new System.Drawing.Point(3, 16);
+      this.tableLayoutPanel.Name = "tableLayoutPanel";
+      this.tableLayoutPanel.RowCount = 1;
+      this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
+      this.tableLayoutPanel.Size = new System.Drawing.Size(709, 192);
+      this.tableLayoutPanel.TabIndex = 0;
       // 
       // RegressionSolutionGradientView
       // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.gradientChart1);
-      this.Controls.Add(this.variableComboBox);
-      this.Controls.Add(this.label1);
+      this.AllowDrop = true;
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Controls.Add(this.splitContainer);
       this.Name = "RegressionSolutionGradientView";
-      this.Size = new System.Drawing.Size(950, 566);
-      ((System.ComponentModel.ISupportInitialize)(this.gradientChart1)).EndInit();
+      this.Size = new System.Drawing.Size(715, 591);
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
+      this.splitContainer.Panel1.ResumeLayout(false);
+      this.splitContainer.Panel2.ResumeLayout(false);
+      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+      this.splitContainer.ResumeLayout(false);
+      this.configurationGroupBox.ResumeLayout(false);
       this.ResumeLayout(false);
-      this.PerformLayout();
 
     }
 
     #endregion
-    private System.Windows.Forms.Label label1;
-    protected System.Windows.Forms.ComboBox variableComboBox;
-    private GradientChart gradientChart1;
+
+    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
+    private System.Windows.Forms.SplitContainer splitContainer;
+    private System.Windows.Forms.GroupBox configurationGroupBox;
+    private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;
   }
 }
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs	(revision 13823)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs	(revision 13824)
@@ -20,44 +20,303 @@
 #endregion
 
+using System;
 using System.Collections.Generic;
+using System.Drawing;
 using System.Linq;
 using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.Collections;
+using HeuristicLab.Data;
 using HeuristicLab.MainForm;
-
-namespace HeuristicLab.Problems.DataAnalysis.Views {
+using HeuristicLab.MainForm.WindowsForms;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.DataAnalysis.Views;
+using HeuristicLab.Visualization.ChartControlsExtensions;
+
+namespace HeuristicLab.Algorithms.DataAnalysis.Views {
   [View("Gradient View")]
-  [Content(typeof(IRegressionSolution))]
-  public partial class RegressionSolutionGradientView : DataAnalysisSolutionEvaluationView {
-    public RegressionSolutionGradientView() {
+  [Content(typeof(IConfidenceBoundRegressionSolution))]
+  public partial class RegressionSolutionGradientView
+    : DataAnalysisSolutionEvaluationView {
+
+    private const int DrawingSteps = 1000;
+
+    private const string EstimatedMeanSeriesName = "Estimated Mean";
+    private const string EstimatedVarianceSeriesName = "95% Conficence Interval";
+
+    private readonly List<string> dimensionNames;
+    private readonly ObservableList<DensityTrackbar> dimensionTrackbars;
+
+    private int ActiveDimension {
+      get { return dimensionTrackbars.FindIndex(tb => tb.Checked); }
+    }
+
+    public new IConfidenceBoundRegressionSolution Content {
+      get { return (IConfidenceBoundRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public RegressionSolutionGradientView()
+      : base() {
+      dimensionNames = new List<string>();
+
+      dimensionTrackbars = new ObservableList<DensityTrackbar>();
+      dimensionTrackbars.ItemsAdded += (sender, args) => {
+        ForEach(args.Items.Select(i => i.Value), RegisterEvents);
+      };
+      dimensionTrackbars.ItemsRemoved += (sender, args) => {
+        ForEach(args.Items.Select(i => i.Value), DeregisterEvents);
+      };
+      dimensionTrackbars.CollectionReset += (sender, args) => {
+        ForEach(args.OldItems.Select(i => i.Value), DeregisterEvents);
+        ForEach(args.Items.Select(i => i.Value), RegisterEvents);
+      };
+
+
       InitializeComponent();
-    }
-
-    public new IRegressionSolution Content {
-      get { return (IRegressionSolution)base.Content; }
-      set {
-        if (value == null || value == Content) return;
-        base.Content = value;
-      }
+
+      // Avoid additional horizontal scrollbar
+      var vertScrollWidth = SystemInformation.VerticalScrollBarWidth;
+      tableLayoutPanel.Padding = new Padding(0, 0, vertScrollWidth, 0);
+
+      // Configure axis
+      chart.CustomizeAllChartAreas();
+      chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
+      chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
+      chart.ChartAreas[0].CursorX.Interval = 1;
+
+      chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
+      chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
+      chart.ChartAreas[0].CursorY.Interval = 0;
+    }
+
+    private void RedrawChart() {
+      chart.Series.Clear();
+      chart.ChartAreas[0].AxisX.StripLines.Clear();
+      if (Content == null || ActiveDimension < 0) return;
+
+      double minX = dimensionTrackbars[ActiveDimension].Limits.Lower;
+      double maxX = dimensionTrackbars[ActiveDimension].Limits.Upper;
+      decimal stepSize = (decimal)((maxX - minX) / DrawingSteps);
+
+      // Build dataset
+      var activeXs = Enumerable.Range(0, DrawingSteps).Select(i => (decimal)minX + i * stepSize).ToList();
+      var fixedXs = dimensionTrackbars.Select(tb => tb.Value).ToList();
+      var values = new double[DrawingSteps, dimensionNames.Count];
+      for (int r = 0; r < DrawingSteps; r++) {
+        for (int c = 0; c < dimensionNames.Count; c++) {
+          values[r, c] = (double)(c == ActiveDimension ? activeXs[r] : fixedXs[c]);
+        }
+      }
+      var dataset = new Dataset(dimensionNames, values);
+
+      // Estimations
+      var model = Content.Model;
+      var means = model.GetEstimatedValues(dataset, Enumerable.Range(0, DrawingSteps)).ToList();
+      var variances = model.GetEstimatedVariances(dataset, Enumerable.Range(0, DrawingSteps)).ToList();
+
+      // Charting config
+      chart.ChartAreas[0].AxisX.Minimum = minX;
+      chart.ChartAreas[0].AxisX.Maximum = maxX;
+      chart.ChartAreas[0].AxisX.Interval = (maxX - minX) / 10;
+
+      // ToDo only databind and put config in codebehind
+      chart.Series.Add(EstimatedVarianceSeriesName);
+      chart.Series[EstimatedVarianceSeriesName].LegendText = EstimatedVarianceSeriesName;
+      chart.Series[EstimatedVarianceSeriesName].ChartType = SeriesChartType.Range;
+      chart.Series[EstimatedVarianceSeriesName].EmptyPointStyle.Color = chart.Series[EstimatedVarianceSeriesName].Color;
+
+      chart.Series.Add(EstimatedMeanSeriesName);
+      chart.Series[EstimatedMeanSeriesName].LegendText = EstimatedMeanSeriesName;
+      chart.Series[EstimatedMeanSeriesName].ChartType = SeriesChartType.FastLine;
+
+      // Charting databind
+      var lower = means.Zip(variances, GetLowerConfBound).ToList();
+      var upper = means.Zip(variances, GetUpperConfBound).ToList();
+      chart.Series[EstimatedVarianceSeriesName].Points.DataBindXY(activeXs, lower, upper);
+      chart.Series[EstimatedMeanSeriesName].Points.DataBindXY(activeXs, means);
+
+      // Update StripLines
+      var trainingValues = Content.ProblemData.Dataset.GetDoubleValues(dimensionNames[ActiveDimension],
+        Content.ProblemData.TrainingIndices);
+      var trainingRange = new DoubleRange(trainingValues.Min(), trainingValues.Max());
+      if (minX < trainingRange.Start)
+        CreateAndAddStripLine(minX, trainingRange.Start, Color.FromArgb(40, 223, 58, 2), Color.Transparent);
+      if (maxX > trainingRange.End)
+        CreateAndAddStripLine(trainingRange.End, maxX, Color.FromArgb(40, 223, 58, 2), Color.Transparent);
+
+      // Update axis description
+      chart.ChartAreas[0].AxisX.Title = dimensionNames[ActiveDimension];
+    }
+
+    private void CreateAndAddStripLine(double start, double end, Color color, Color secondColor) {
+      StripLine stripLine = new StripLine {
+        BackColor = color,
+        BackSecondaryColor = secondColor,
+        StripWidth = end - start,
+        IntervalOffset = start
+      };
+      chart.ChartAreas[0].AxisX.StripLines.Add(stripLine);
+    }
+
+    private void UpdateConfigurationControls() {
+      tableLayoutPanel.SuspendRepaint();
+      tableLayoutPanel.SuspendLayout();
+
+      tableLayoutPanel.RowCount = 0;
+      tableLayoutPanel.Controls.Clear();
+
+      dimensionNames.Clear();
+      dimensionTrackbars.Clear();
+
+      if (Content == null) {
+        tableLayoutPanel.ResumeLayout(true);
+        tableLayoutPanel.ResumeRepaint(true);
+        return;
+      }
+
+      dimensionNames.AddRange(Content.ProblemData.AllowedInputVariables);
+      var ranges = new List<DoubleLimit>();
+      for (int i = 0; i < dimensionNames.Count; i++) {
+        var values = Content.ProblemData.Dataset.GetDoubleValues(dimensionNames[i], Content.ProblemData.AllIndices);
+        double min, max, interval;
+        ChartUtil.CalculateAxisInterval(values.Min(), values.Max(), 10, out min, out max, out interval);
+        ranges.Add(new DoubleLimit(min, max));
+      }
+
+      tableLayoutPanel.RowCount = dimensionNames.Count;
+      while (tableLayoutPanel.RowStyles.Count < dimensionNames.Count)
+        tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
+
+      for (int i = 0; i < dimensionNames.Count; i++) {
+        var name = dimensionNames[i];
+        var trainingData =
+          Content.ProblemData.Dataset.GetDoubleValues(name, Content.ProblemData.TrainingIndices).ToList();
+
+        var dimensionTrackbar = new DensityTrackbar(name, ranges[i], trainingData);
+
+        // events registered automatically
+        dimensionTrackbars.Add(dimensionTrackbar);
+
+        dimensionTrackbar.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+        tableLayoutPanel.Controls.Add(dimensionTrackbar, 0, i);
+      }
+
+      if (dimensionTrackbars.Any())
+        dimensionTrackbars.First().Checked = true;
+
+      tableLayoutPanel.ResumeLayout(true);
+      tableLayoutPanel.ResumeRepaint(true);
+    }
+
+    private void RegisterEvents(DensityTrackbar trackbar) {
+      trackbar.CheckedChanged += DimensionTrackbar_CheckedChanged;
+      trackbar.ValueChanged += DimensionTrackbar_ValueChanged;
+      trackbar.LimitsChanged += DimensionTrackbar_LimitsChanged;
+    }
+
+    private void DeregisterEvents(DensityTrackbar trackbar) {
+      trackbar.CheckedChanged -= DimensionTrackbar_CheckedChanged;
+      trackbar.ValueChanged -= DimensionTrackbar_ValueChanged;
+      trackbar.LimitsChanged -= DimensionTrackbar_LimitsChanged;
+    }
+
+    private void DimensionTrackbar_CheckedChanged(object sender, EventArgs e) {
+      var trackBarSender = sender as DensityTrackbar;
+      if (trackBarSender == null || !trackBarSender.Checked) return;
+      // Uncheck all others
+      foreach (var tb in dimensionTrackbars.Except(new[] { trackBarSender }))
+        tb.Checked = false;
+      RedrawChart();
+    }
+
+    private void DimensionTrackbar_LimitsChanged(object sender, EventArgs e) {
+      RedrawChart();
+    }
+
+    private void DimensionTrackbar_ValueChanged(object sender, EventArgs e) {
+      RedrawChart();
+    }
+
+    #region Events
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ModelChanged += Content_ModelChanged;
+      Content.ProblemDataChanged += Content_ProblemDataChanged;
+    }
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ModelChanged -= Content_ModelChanged;
+      Content.ProblemDataChanged -= Content_ProblemDataChanged;
     }
 
     protected override void OnContentChanged() {
       base.OnContentChanged();
-      if (Content == null) return;
-      var variable = Content.ProblemData.AllowedInputVariables.First();
-      var values = (IList<double>)Content.ProblemData.Dataset.GetReadOnlyDoubleValues(variable);
-      gradientChart1.Configure(new[] { Content }, Content.ProblemData, values.Min(), values.Max(), 1000);
-      UpdateVariableList();
-    }
-
-    protected virtual void UpdateVariableList() {
-      variableComboBox.Items.Clear();
-      var variables = Content.ProblemData.AllowedInputVariables.ToArray();
-      variableComboBox.Items.AddRange(variables);
-      variableComboBox.Text = variables[0];
-    }
-
-    private void variableComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
-      gradientChart1.Variable = variableComboBox.Text;
-    }
+      UpdateConfigurationControls();
+      RedrawChart();
+    }
+
+    private void Content_ModelChanged(object sender, EventArgs e) {
+      RedrawChart();
+    }
+
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      UpdateConfigurationControls();
+      RedrawChart();
+    }
+
+    private void Chart_MouseDoubleClick(object sender, MouseEventArgs e) {
+      var result = chart.HitTest(e.X, e.Y);
+      if (true || result.ChartArea != null && (result.ChartElementType == ChartElementType.PlottingArea ||
+                                               result.ChartElementType == ChartElementType.Gridlines) ||
+          result.ChartElementType == ChartElementType.StripLines) {
+        foreach (var axis in result.ChartArea.Axes)
+          axis.ScaleView.ZoomReset(int.MaxValue);
+      }
+    }
+
+    private void chart_MouseMove(object sender, MouseEventArgs e) {
+      //HitTestResult result = chart.HitTest(e.X, e.Y);
+      //if (result.ChartElementType == ChartElementType.LegendItem && result.Series.Name != TARGETVARIABLE_SERIES_NAME)
+      //  Cursor = Cursors.Hand;
+      //else
+      //  Cursor = Cursors.Default;
+    }
+
+    private void chart_MouseDown(object sender, MouseEventArgs e) {
+      //HitTestResult result = chart.HitTest(e.X, e.Y);
+      //if (result.ChartElementType == ChartElementType.LegendItem && result.Series.Name != TARGETVARIABLE_SERIES_NAME) {
+      //  ToggleSeriesData(result.Series);
+      //}
+    }
+
+    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
+      //if (chart.Series.Count != 4) return;
+      //e.LegendItems[0].Cells[1].ForeColor = this.chart.Series[EstimatedMeanSeriesName].Points.Count == 0 ? Color.Gray : Color.Black;
+      //e.LegendItems[1].Cells[1].ForeColor = this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
+      //e.LegendItems[2].Cells[1].ForeColor = this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
+      //e.LegendItems[3].Cells[1].ForeColor = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
+    }
+
+    #endregion
+
+    #region Helper
+
+    private double GetLowerConfBound(double m, double s2) {
+      return m - 1.96 * Math.Sqrt(s2);
+    }
+
+    private double GetUpperConfBound(double m, double s2) {
+      return m + 1.96 * Math.Sqrt(s2);
+    }
+
+    public static void ForEach<T>(IEnumerable<T> source, Action<T> action) {
+      foreach (T item in source)
+        action(item);
+    }
+
+    #endregion
   }
 }
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 13823)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 13824)
@@ -176,4 +176,5 @@
     <Compile Include="Implementation\Clustering\ClusteringSolution.cs" />
     <Compile Include="Implementation\ConstantModel.cs" />
+    <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" />
     <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" />
     <Compile Include="Implementation\Regression\ConstantRegressionSolution.cs" />
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConfidenceBoundRegressionSolution.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConfidenceBoundRegressionSolution.cs	(revision 13824)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConfidenceBoundRegressionSolution.cs	(revision 13824)
@@ -0,0 +1,90 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents a regression data analysis solution that supports confidence estimates
+  /// </summary>
+  [StorableClass]
+  public class ConfidenceBoundRegressionSolution : RegressionSolution, IConfidenceBoundRegressionSolution {
+    protected readonly Dictionary<int, double> varianceEvaluationCache;
+
+    public new IConfidenceBoundRegressionModel Model {
+      get { return (IConfidenceBoundRegressionModel)base.Model; }
+      set { base.Model = value; }
+    }
+
+    [StorableConstructor]
+    protected ConfidenceBoundRegressionSolution(bool deserializing)
+      : base(deserializing) {
+      varianceEvaluationCache = new Dictionary<int, double>();
+    }
+    protected ConfidenceBoundRegressionSolution(ConfidenceBoundRegressionSolution original, Cloner cloner)
+      : base(original, cloner) {
+      varianceEvaluationCache = new Dictionary<int, double>(original.varianceEvaluationCache);
+    }
+    public ConfidenceBoundRegressionSolution(IConfidenceBoundRegressionModel model, IRegressionProblemData problemData)
+      : base(model, problemData) {
+      varianceEvaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows);
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new ConfidenceBoundRegressionSolution(this, cloner);
+    }
+
+    public IEnumerable<double> EstimatedVariances {
+      get { return GetEstimatedVariances(Enumerable.Range(0, ProblemData.Dataset.Rows)); }
+    }
+    public IEnumerable<double> EstimatedTrainingVariances {
+      get { return GetEstimatedVariances(ProblemData.TrainingIndices); }
+    }
+    public IEnumerable<double> EstimatedTestVariances {
+      get { return GetEstimatedVariances(ProblemData.TestIndices); }
+    }
+
+    public IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows) {
+      var rowsToEvaluate = rows.Except(varianceEvaluationCache.Keys);
+      var rowsEnumerator = rowsToEvaluate.GetEnumerator();
+      var valuesEnumerator = Model.GetEstimatedVariances(ProblemData.Dataset, rowsToEvaluate).GetEnumerator();
+
+      while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) {
+        varianceEvaluationCache.Add(rowsEnumerator.Current, valuesEnumerator.Current);
+      }
+
+      return rows.Select(row => varianceEvaluationCache[row]);
+    }
+
+    protected override void OnProblemDataChanged() {
+      varianceEvaluationCache.Clear();
+      base.OnProblemDataChanged();
+    }
+
+    protected override void OnModelChanged() {
+      varianceEvaluationCache.Clear();
+      base.OnModelChanged();
+    }
+  }
+}
Index: /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs
===================================================================
--- /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs	(revision 13823)
+++ /branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs	(revision 13824)
@@ -46,4 +46,6 @@
 
   public interface IConfidenceBoundRegressionSolution : IRegressionSolution {
+    new IConfidenceBoundRegressionModel Model { get; }
+
     IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows);
   }
