Index: /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/OneRClassificationModelView.Designer.cs
===================================================================
--- /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/OneRClassificationModelView.Designer.cs	(revision 9134)
+++ /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/OneRClassificationModelView.Designer.cs	(revision 9135)
@@ -46,8 +46,9 @@
     private void InitializeComponent() {
       this.dataGridView = new System.Windows.Forms.DataGridView();
-      this.variableLabel = new System.Windows.Forms.Label();
       this.intervalstart = new System.Windows.Forms.DataGridViewTextBoxColumn();
       this.intervalend = new System.Windows.Forms.DataGridViewTextBoxColumn();
       this.classcolumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+      this.variableLabel = new System.Windows.Forms.Label();
+      this.MissingValuesClassLabel = new System.Windows.Forms.Label();
       ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
       this.SuspendLayout();
@@ -68,15 +69,6 @@
       this.dataGridView.Name = "dataGridView";
       this.dataGridView.ReadOnly = true;
-      this.dataGridView.Size = new System.Drawing.Size(361, 196);
+      this.dataGridView.Size = new System.Drawing.Size(389, 230);
       this.dataGridView.TabIndex = 0;
-      // 
-      // variableLabel
-      // 
-      this.variableLabel.AutoSize = true;
-      this.variableLabel.Location = new System.Drawing.Point(3, 10);
-      this.variableLabel.Name = "variableLabel";
-      this.variableLabel.Size = new System.Drawing.Size(48, 13);
-      this.variableLabel.TabIndex = 1;
-      this.variableLabel.Text = "Variable:";
       // 
       // intervalstart
@@ -98,12 +90,32 @@
       this.classcolumn.ReadOnly = true;
       // 
+      // variableLabel
+      // 
+      this.variableLabel.AutoSize = true;
+      this.variableLabel.Location = new System.Drawing.Point(3, 10);
+      this.variableLabel.Name = "variableLabel";
+      this.variableLabel.Size = new System.Drawing.Size(48, 13);
+      this.variableLabel.TabIndex = 1;
+      this.variableLabel.Text = "Variable:";
+      // 
+      // MissingValuesClassLabel
+      // 
+      this.MissingValuesClassLabel.Anchor = System.Windows.Forms.AnchorStyles.Top;
+      this.MissingValuesClassLabel.AutoSize = true;
+      this.MissingValuesClassLabel.Location = new System.Drawing.Point(165, 10);
+      this.MissingValuesClassLabel.Name = "MissingValuesClassLabel";
+      this.MissingValuesClassLabel.Size = new System.Drawing.Size(118, 13);
+      this.MissingValuesClassLabel.TabIndex = 2;
+      this.MissingValuesClassLabel.Text = "Class of missing values:";
+      // 
       // OneRClassificationModelView
       // 
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.MissingValuesClassLabel);
       this.Controls.Add(this.variableLabel);
       this.Controls.Add(this.dataGridView);
       this.Name = "OneRClassificationModelView";
-      this.Size = new System.Drawing.Size(367, 231);
+      this.Size = new System.Drawing.Size(395, 265);
       ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
       this.ResumeLayout(false);
@@ -119,4 +131,5 @@
     private System.Windows.Forms.DataGridViewTextBoxColumn intervalend;
     private System.Windows.Forms.DataGridViewTextBoxColumn classcolumn;
+    private System.Windows.Forms.Label MissingValuesClassLabel;
   }
 }
Index: /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/OneRClassificationModelView.cs
===================================================================
--- /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/OneRClassificationModelView.cs	(revision 9134)
+++ /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/OneRClassificationModelView.cs	(revision 9135)
@@ -49,7 +49,9 @@
         if (Content == null) {
           variableLabel.Text = "Variable: ";
+          MissingValuesClassLabel.Text = "Class of missing values: ";
           dataGridView.Rows.Clear();
         } else {
           variableLabel.Text = "Variable: " + Content.Variable;
+          MissingValuesClassLabel.Text = "Class of missing values: " + Content.MissingValuesClass;
 
           dataGridView.RowCount = Content.Classes.Length;
Index: /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR.cs
===================================================================
--- /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR.cs	(revision 9134)
+++ /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR.cs	(revision 9135)
@@ -84,4 +84,5 @@
       string bestVariable = null;
       Dictionary<double, double> bestSplits = null;
+      double missingValuesClass = double.NaN;
       int correctClassified = 0;
 
@@ -98,4 +99,18 @@
         bool done = false;
         int curRow = 0;
+
+        if (curRow < inputVariableValues.Length && Double.IsNaN(inputVariableValues[curRow])) {
+          while (curRow < inputVariableValues.Length && Double.IsNaN(inputVariableValues[curRow])) {
+            classCount[classValuesInDataset[curRow]] += 1;
+            curRow++;
+          }
+          if (ExistsDominatingClass(classCount, out dominatingClass)) {
+            missingValuesClass = dominatingClass;
+          } else {
+            missingValuesClass = GetRandomMaxClass(classCount, random);
+          }
+          correctClassified += classCount[missingValuesClass];
+          classCount = PrepareClassCountDictionary(classValues);
+        }
         while (curRow < inputVariableValues.Length) {
           if (newBucket) {
@@ -108,17 +123,15 @@
             }
             curSplit = inputVariableValues[curRow];
-            curRow = SetCurRowCorrectly(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
+            curRow = SetCurRowToEndOfSplit(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
             newBucket = false;
           }
-
 
           if (ExistsDominatingClass(classCount, out dominatingClass)) {
             while (curRow + 1 < classValuesInDataset.Length &&
-              IsNextSplitStillDominationClass(curRow, inputVariableValues, classValuesInDataset, curSplit, dominatingClass)) {
-              // curRow + i < classValuesInDataset.Length && classValuesInDataset[curRow + i] == dominatingClass) {
-              curSplit = inputVariableValues[curRow + 1];
-              classCount[classValuesInDataset[curRow + 1]] += 1;
+              IsNextSplitStillDominatingClass(curRow, inputVariableValues, classValuesInDataset, curSplit, dominatingClass)) {
               curRow++;
-              curRow = SetCurRowCorrectly(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
+              curSplit = inputVariableValues[curRow];
+              classCount[classValuesInDataset[curRow]] += 1;
+              curRow = SetCurRowToEndOfSplit(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
             }
 
@@ -144,5 +157,5 @@
             curSplit = inputVariableValues[curRow];
             classCount[classValuesInDataset[curRow]] += 1;
-            curRow = SetCurRowCorrectly(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
+            curRow = SetCurRowToEndOfSplit(curRow, inputVariableValues, classValuesInDataset, classCount, curSplit);
           }
         }
@@ -150,20 +163,8 @@
         if (!done) {
           curSplit = Double.PositiveInfinity;
-
-          IList<double> possibleClasses = new List<double>();
-          int max = 0;
-          foreach (var item in classCount) {
-            if (max < item.Value) {
-              max = item.Value;
-              possibleClasses = new List<double>();
-              possibleClasses.Add(item.Key);
-            } else {
-              possibleClasses.Add(item.Key);
-            }
-          }
-          int classindex = random.Next(possibleClasses.Count);
-          splits.Add(curSplit, possibleClasses[classindex]);
-
-          curCorrectClassified += classCount[possibleClasses[classindex]];
+          double randomClass = GetRandomMaxClass(classCount, random);
+          splits.Add(curSplit, randomClass);
+
+          curCorrectClassified += classCount[randomClass];
         }
 
@@ -177,5 +178,5 @@
       Dictionary<double, double> mergedSplits = MergeSplits(bestSplits);
 
-      var model = new OneRClassificationModel(bestVariable, mergedSplits.Keys.ToArray(), mergedSplits.Values.ToArray());
+      var model = new OneRClassificationModel(bestVariable, mergedSplits.Keys.ToArray(), mergedSplits.Values.ToArray(), missingValuesClass);
       var solution = new OneRClassificationSolution(model, (IClassificationProblemData)problemData.Clone());
 
@@ -183,5 +184,21 @@
     }
 
-    private static bool IsNextSplitStillDominationClass(int curRow, double[] inputVariableValues, double[] classValuesInDataset, double curSplit, double dominatingClass) {
+    private static double GetRandomMaxClass(Dictionary<double, int> classCount, IRandom random) {
+      IList<double> possibleClasses = new List<double>();
+      int max = 0;
+      foreach (var item in classCount) {
+        if (max < item.Value) {
+          max = item.Value;
+          possibleClasses = new List<double>();
+          possibleClasses.Add(item.Key);
+        } else if (max == item.Value) {
+          possibleClasses.Add(item.Key);
+        }
+      }
+      int classindex = random.Next(possibleClasses.Count);
+      return possibleClasses[classindex];
+    }
+
+    private static bool IsNextSplitStillDominatingClass(int curRow, double[] inputVariableValues, double[] classValuesInDataset, double curSplit, double dominatingClass) {
       if (curRow >= classValuesInDataset.Length) {
         return false;
@@ -205,5 +222,6 @@
     }
 
-    private static int SetCurRowCorrectly(int curRow, double[] inputVariableValues, double[] classValuesInDataset, Dictionary<double, int> classCount, double curSplit) {
+    // needed if variable contains the same value several times
+    private static int SetCurRowToEndOfSplit(int curRow, double[] inputVariableValues, double[] classValuesInDataset, Dictionary<double, int> classCount, double curSplit) {
       while (curRow + 1 < inputVariableValues.Length && inputVariableValues[curRow + 1] == curSplit) {
         curRow++;
Index: /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs
===================================================================
--- /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs	(revision 9134)
+++ /branches/ClassificationModelComparison/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/OneR/OneRClassificationModel.cs	(revision 9135)
@@ -50,4 +50,10 @@
     }
 
+    [Storable]
+    protected double missingValuesClass;
+    public double MissingValuesClass {
+      get { return missingValuesClass; }
+    }
+
     [StorableConstructor]
     protected OneRClassificationModel(bool deserializing) : base(deserializing) { }
@@ -60,5 +66,5 @@
     public override IDeepCloneable Clone(Cloner cloner) { return new OneRClassificationModel(this, cloner); }
 
-    public OneRClassificationModel(string variable, double[] splits, double[] classes)
+    public OneRClassificationModel(string variable, double[] splits, double[] classes, double missingValuesClass = double.NaN)
       : base() {
       if (splits.Length != classes.Length) {
@@ -73,4 +79,5 @@
       this.splits = splits;
       this.classes = classes;
+      this.missingValuesClass = missingValuesClass;
     }
 
@@ -85,4 +92,8 @@
       Array.Sort(values, rowsArray);
       int curSplit = 0, curIndex = 0;
+      while (curIndex < values.Length && Double.IsNaN(values[curIndex])) {
+        estimated[curIndex] = MissingValuesClass;
+        curIndex++;
+      }
       while (curSplit < Splits.Length) {
         while (curIndex < values.Length && Splits[curSplit] > values[curIndex]) {
Index: /branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionComparisonView.Designer.cs
===================================================================
--- /branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionComparisonView.Designer.cs	(revision 9134)
+++ /branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionComparisonView.Designer.cs	(revision 9135)
@@ -60,4 +60,5 @@
       this.dataGridView.Size = new System.Drawing.Size(418, 257);
       this.dataGridView.TabIndex = 0;
+      this.dataGridView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.dataGridView_MouseDoubleClick);
       // 
       // ClassificationSolutionComparisonView
Index: /branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionComparisonView.cs
===================================================================
--- /branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionComparisonView.cs	(revision 9134)
+++ /branches/ClassificationModelComparison/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionComparisonView.cs	(revision 9135)
@@ -33,4 +33,6 @@
   [Content(typeof(IClassificationSolution))]
   public partial class ClassificationSolutionComparisonView : DataAnalysisSolutionEvaluationView {
+    private List<IClassificationSolution> solutions;
+
     public ClassificationSolutionComparisonView() {
       InitializeComponent();
@@ -75,9 +77,10 @@
           dataGridView.Rows.Clear();
           dataGridView.Columns.Clear();
+          solutions.Clear();
         } else {
 
           IClassificationProblemData problemData = Content.ProblemData;
           Dataset dataset = problemData.Dataset;
-          List<IClassificationSolution> solutions = new List<IClassificationSolution>() { Content };
+          solutions = new List<IClassificationSolution>() { Content };
           solutions.AddRange(GenerateClassificationSolutions(problemData));
 
@@ -126,11 +129,27 @@
 
     private IEnumerable<IClassificationSolution> GenerateClassificationSolutions(IClassificationProblemData problemData) {
+      var solutions = new List<IClassificationSolution>();
       var zeroR = ZeroR.CreateZeroRSolution(problemData);
       zeroR.Name = "0R Classification Solution";
+      solutions.Add(zeroR);
       var oneR = OneR.CreateOneRSolution(problemData, 6, new FastRandom());
       oneR.Name = "1R Classification Solution";
-      var lda = LinearDiscriminantAnalysis.CreateLinearDiscriminantAnalysisSolution(problemData);
-      lda.Name = "Linear Discriminant Analysis Solution";
-      return new List<IClassificationSolution>() { zeroR, oneR, lda };
+      solutions.Add(oneR);
+      try {
+        var lda = LinearDiscriminantAnalysis.CreateLinearDiscriminantAnalysisSolution(problemData);
+        lda.Name = "Linear Discriminant Analysis Solution";
+        solutions.Add(lda);
+      }
+      catch (NotSupportedException) { }
+      catch (ArgumentException) { }
+      return solutions;
+    }
+
+    private void dataGridView_MouseDoubleClick(object sender, MouseEventArgs e) {
+      var hittestinfo = dataGridView.HitTest(e.X, e.Y);
+      if (hittestinfo.Type != DataGridViewHitTestType.RowHeader) { return; }
+      if (hittestinfo.RowIndex > solutions.Count) { return; }
+
+      MainFormManager.MainForm.ShowContent(solutions[hittestinfo.RowIndex]);
     }
   }
