Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs	(revision 8228)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs	(revision 9363)
@@ -96,5 +96,5 @@
       }
 
-      int classValuesCount = Content.ProblemData.ClassValues.Count;
+      int classValuesCount = Content.ProblemData.Classes;
       int solutionsCount = Content.ClassificationSolutions.Count();
       string[,] values = new string[indices.Length, 5 + classValuesCount + solutionsCount];
@@ -106,16 +106,20 @@
         int row = indices[i];
         values[i, 0] = row.ToString();
-        values[i, 1] = target[i].ToString();
+        values[i, 1] = target[row].ToString();
         //display only indices and target values if no models are present
         if (solutionsCount > 0) {
           values[i, 2] = estimatedClassValues[i].ToString();
-          values[i, 3] = (target[i].IsAlmost(estimatedClassValues[i])).ToString();
+          values[i, 3] = (target[row].IsAlmost(estimatedClassValues[i])).ToString();
           var groups =
             estimatedValuesVector[i].GroupBy(x => x).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
           var estimationCount = groups.Where(g => g.Key != null).Select(g => g.Count).Sum();
-          values[i, 4] =
-            (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString();
-          for (int classIndex = 0; classIndex < Content.ProblemData.ClassValues.Count; classIndex++) {
-            var group = groups.Where(g => g.Key == Content.ProblemData.ClassValues[classIndex]).SingleOrDefault();
+          // take care of divide by zero
+          if (estimationCount != 0) {
+            values[i, 4] = (((double)groups.Where(g => g.Key == estimatedClassValues[i]).Single().Count) / estimationCount).ToString();
+          } else {
+            values[i, 4] = double.NaN.ToString();
+          }
+          for (int classIndex = 0; classIndex < Content.ProblemData.Classes; classIndex++) {
+            var group = groups.Where(g => g.Key == Content.ProblemData.ClassValues.ElementAt(classIndex)).SingleOrDefault();
             if (group == null) values[i, 5 + classIndex] = 0.ToString();
             else values[i, 5 + classIndex] = group.Count.ToString();
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs	(revision 8228)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs	(revision 9363)
@@ -20,7 +20,9 @@
 #endregion
 
+using System;
 using System.Linq;
 using System.Windows.Forms;
 using HeuristicLab.Common;
+using HeuristicLab.Core;
 using HeuristicLab.Core.Views;
 using HeuristicLab.MainForm;
@@ -83,6 +85,30 @@
             solutions = solutions.Select(s => cloner.Clone(s));
           }
-          foreach (var solution in solutions)
-            Content.Add(solution);
+          var solutionCollection = Content as ItemCollection<IClassificationSolution>;
+          if (solutionCollection != null) {
+            solutionCollection.AddRange(solutions);
+          } else {
+            foreach (var solution in solutions)
+              Content.Add(solution);
+          }
+        }
+      }
+      protected override void itemsListView_KeyDown(object sender, KeyEventArgs e) {
+        var solutionCollection = Content as ItemCollection<IClassificationSolution>;
+        if (e.KeyCode == Keys.Delete && solutionCollection != null) {
+          if ((itemsListView.SelectedItems.Count > 0) && !Content.IsReadOnly && !ReadOnly) {
+            solutionCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(x => (IClassificationSolution)x.Tag));
+          }
+        } else {
+          base.itemsListView_KeyDown(sender, e);
+        }
+      }
+      protected override void removeButton_Click(object sender, EventArgs e) {
+        var solutionCollection = Content as ItemCollection<IClassificationSolution>;
+        if (itemsListView.SelectedItems.Count > 0 && solutionCollection != null) {
+          solutionCollection.RemoveRange(itemsListView.SelectedItems.Cast<ListViewItem>().Select(x => (IClassificationSolution)x.Tag));
+          itemsListView.SelectedItems.Clear();
+        } else {
+          base.removeButton_Click(sender, e);
         }
       }
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.Designer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.Designer.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.Designer.cs	(revision 9363)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 ClassificationFeatureCorrelationView {
+    /// <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() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+    }
+
+    #endregion
+  }
+}
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationFeatureCorrelationView.cs	(revision 9363)
@@ -0,0 +1,46 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Linq;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Classification Feature Correlation View")]
+  [Content(typeof(ClassificationProblemData), false)]
+  public partial class ClassificationFeatureCorrelationView : FeatureCorrelationView {
+
+    public new ClassificationProblemData Content {
+      get { return (ClassificationProblemData)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public ClassificationFeatureCorrelationView() {
+      InitializeComponent();
+    }
+
+    protected override bool[] SetInitialVariableVisibility() {
+      int i = Content.Dataset.DoubleVariables.ToList().FindIndex(x => x == Content.TargetVariable);
+      var initialVisibility = base.SetInitialVariableVisibility();
+      initialVisibility[i] = true;
+      return initialVisibility;
+    }
+  }
+}
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionConfusionMatrixView.Designer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionConfusionMatrixView.Designer.cs	(revision 8228)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionConfusionMatrixView.Designer.cs	(revision 9363)
@@ -1,3 +1,24 @@
-﻿namespace HeuristicLab.Problems.DataAnalysis.Views {
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 ClassificationSolutionConfusionMatrixView {
     /// <summary> 
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.Designer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.Designer.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.Designer.cs	(revision 9363)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 ClassificationTimeframeFeatureCorrelationView {
+    /// <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() {
+      components = new System.ComponentModel.Container();
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+    }
+
+    #endregion
+  }
+}
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationTimeframeFeatureCorrelationView.cs	(revision 9363)
@@ -0,0 +1,51 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Linq;
+using HeuristicLab.MainForm;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Classification Timeframe Feature Correlation View")]
+  [Content(typeof(ClassificationProblemData), false)]
+  public partial class ClassificationTimeframeFeatureCorrelationView : TimeframeFeatureCorrelationView {
+
+    public new ClassificationProblemData Content {
+      get { return (ClassificationProblemData)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public ClassificationTimeframeFeatureCorrelationView() {
+      InitializeComponent();
+    }
+
+    protected override void SetVariableSelectionComboBox() {
+      base.SetVariableSelectionComboBox();
+      variableSelectionComboBox.SelectedItem = Content.TargetVariable;
+    }
+
+    protected override bool[] SetInitialVariableVisibility() {
+      int i = Content.Dataset.DoubleVariables.ToList().FindIndex(x => x == Content.TargetVariable);
+      var initialVisibility = base.SetInitialVariableVisibility();
+      initialVisibility[i] = true;
+      return initialVisibility;
+    }
+  }
+}
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationModelView.Designer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationModelView.Designer.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationModelView.Designer.cs	(revision 9363)
@@ -0,0 +1,59 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 DiscriminantFunctionClassificationModelView {
+    /// <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.SuspendLayout();
+
+      // 
+      // RegressionSolutionEnsembleModelView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
+      this.Name = "DiscriminantFunctionClassificationModelView";
+      this.ResumeLayout(false);
+    }
+
+    #endregion
+  }
+}
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationModelView.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationModelView.cs	(revision 9363)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationModelView.cs	(revision 9363)
@@ -0,0 +1,52 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Discriminant Function Classification Model")]
+  [Content(typeof(DiscriminantFunctionClassificationModel), true)]
+  internal sealed partial class DiscriminantFunctionClassificationModelView : AsynchronousContentView {
+    private ViewHost view;
+
+    public DiscriminantFunctionClassificationModelView() {
+      InitializeComponent();
+      view = new ViewHost();
+      view.Dock = DockStyle.Fill;
+      Controls.Add(view);
+    }
+
+    public new DiscriminantFunctionClassificationModel Content {
+      get { return (DiscriminantFunctionClassificationModel)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      if (Content != null) {
+        view.Content = Content.Model;
+      } else
+        view.Content = null;
+    }
+  }
+}
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.Designer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.Designer.cs	(revision 8228)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.Designer.cs	(revision 9363)
@@ -1,3 +1,24 @@
-﻿namespace HeuristicLab.Problems.DataAnalysis.Views {
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 DiscriminantFunctionClassificationRocCurvesView {
     /// <summary> 
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.cs	(revision 8228)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.cs	(revision 9363)
@@ -114,5 +114,5 @@
         maxThreshold += thresholdIncrement;
 
-        List<double> classValues = Content.ProblemData.ClassValues.OrderBy(x => x).ToList();
+        List<double> classValues = Content.ProblemData.ClassValues.ToList();
 
         foreach (double classValue in classValues) {
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.Designer.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.Designer.cs	(revision 8228)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.Designer.cs	(revision 9363)
@@ -1,3 +1,24 @@
-﻿namespace HeuristicLab.Problems.DataAnalysis.Views {
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2012 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 DiscriminantFunctionClassificationSolutionThresholdView {
     /// <summary> 
@@ -92,5 +113,4 @@
 
     }
-
     #endregion
 
Index: branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs
===================================================================
--- branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs	(revision 8228)
+++ branches/OaaS/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs	(revision 9363)
@@ -65,4 +65,5 @@
 
       this.chart.ChartAreas[0].AxisY.Title = "Estimated Values";
+      this.chart.ChartAreas[0].AxisY.IsStartedFromZero = false;
       this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
       this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
@@ -169,4 +170,9 @@
       chart.Annotations.Clear();
       int classIndex = 1;
+      IClassificationProblemData problemData = Content.ProblemData;
+      var classValues = Content.Model.ClassValues.ToArray();
+      Axis y = chart.ChartAreas[0].AxisY;
+      Axis x = chart.ChartAreas[0].AxisX;
+      string name;
       foreach (double threshold in Content.Model.Thresholds) {
         if (!double.IsInfinity(threshold)) {
@@ -176,17 +182,55 @@
           annotation.LineWidth = 2;
           annotation.LineColor = Color.Red;
-
           annotation.IsInfinitive = true;
           annotation.ClipToChartArea = chart.ChartAreas[0].Name;
           annotation.Tag = classIndex;  //save classIndex as Tag to avoid moving the threshold accross class bounderies
-
           annotation.AxisX = chart.ChartAreas[0].AxisX;
-          annotation.AxisY = chart.ChartAreas[0].AxisY;
+          annotation.AxisY = y;
           annotation.Y = threshold;
 
+          name = problemData.GetClassName(classValues[classIndex - 1]);
+          TextAnnotation beneathLeft = CreateTextAnnotation(name, classIndex, x, y, x.Minimum, threshold, ContentAlignment.TopLeft);
+          TextAnnotation beneathRight = CreateTextAnnotation(name, classIndex, x, y, x.Maximum, threshold, ContentAlignment.TopRight);
+
+          name = problemData.GetClassName(classValues[classIndex]);
+          TextAnnotation aboveLeft = CreateTextAnnotation(name, classIndex, x, y, x.Minimum, threshold, ContentAlignment.BottomLeft);
+          TextAnnotation aboveRight = CreateTextAnnotation(name, classIndex, x, y, x.Maximum, threshold, ContentAlignment.BottomRight);
+
           chart.Annotations.Add(annotation);
+          chart.Annotations.Add(beneathLeft);
+          chart.Annotations.Add(aboveLeft);
+          chart.Annotations.Add(beneathRight);
+          chart.Annotations.Add(aboveRight);
+
+          beneathLeft.ResizeToContent();
+          beneathRight.ResizeToContent();
+          aboveLeft.ResizeToContent();
+          aboveRight.ResizeToContent();
+
+          beneathRight.Width = -beneathRight.Width;
+          aboveLeft.Height = -aboveLeft.Height;
+          aboveRight.Height = -aboveRight.Height;
+          aboveRight.Width = -aboveRight.Width;
+
           classIndex++;
         }
       }
+    }
+
+    private TextAnnotation CreateTextAnnotation(string name, int classIndex, Axis axisX, Axis axisY, double x, double y, ContentAlignment alignment) {
+      TextAnnotation annotation = new TextAnnotation();
+      annotation.Text = name;
+      annotation.AllowMoving = true;
+      annotation.AllowResizing = false;
+      annotation.AllowSelecting = false;
+      annotation.IsSizeAlwaysRelative = true;
+      annotation.ClipToChartArea = chart.ChartAreas[0].Name;
+      annotation.Tag = classIndex;
+      annotation.AxisX = axisX;
+      annotation.AxisY = axisY;
+      annotation.Alignment = alignment;
+      annotation.X = x;
+      annotation.Y = y;
+      return annotation;
     }
 
@@ -238,4 +282,5 @@
       double[] thresholds = Content.Model.Thresholds.ToArray();
       thresholds[classIndex] = e.NewLocationY;
+      Array.Sort(thresholds);
       Content.Model.SetThresholdsAndClassValues(thresholds, Content.Model.ClassValues);
     }
