Index: /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionEstimatedValuesView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionEstimatedValuesView.cs	(revision 13591)
+++ /trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionEstimatedValuesView.cs	(revision 13592)
@@ -19,9 +19,7 @@
  */
 #endregion
-using System;
 using System.Linq;
 using System.Windows.Forms;
 using HeuristicLab.Data;
-using HeuristicLab.Data.Views;
 using HeuristicLab.MainForm;
 using HeuristicLab.Problems.DataAnalysis.Views;
@@ -31,8 +29,4 @@
   [Content(typeof(GaussianProcessRegressionSolution), false)]
   public partial class GaussianProcessRegressionSolutionEstimatedValuesView : RegressionSolutionEstimatedValuesView {
-    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
-    private const string ESTIMATEDVALUES_SERIES_NAME = "Estimated Values (all)";
-    private const string ESTIMATEDVALUES_TRAINING_SERIES_NAME = "Estimated Values (training)";
-    private const string ESTIMATEDVALUES_TEST_SERIES_NAME = "Estimated Values (test)";
     private const string ESTIMATEDVARIANCE_TRAINING_SERIES_NAME = "Estimated Variance (training)";
     private const string ESTIMATEDVARIANCE_TEST_SERIES_NAME = "Estimated Variance (test)";
@@ -40,7 +34,5 @@
     public new GaussianProcessRegressionSolution Content {
       get { return (GaussianProcessRegressionSolution)base.Content; }
-      set {
-        base.Content = value;
-      }
+      set { base.Content = value; }
     }
 
@@ -50,80 +42,31 @@
     }
 
-    #region events
-    protected override void RegisterContentEvents() {
-      base.RegisterContentEvents();
-      Content.ModelChanged += new EventHandler(Content_ModelChanged);
-      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+
+    protected override StringMatrix CreateValueMatrix() {
+      var matrix = base.CreateValueMatrix();
+
+      var columnNames = matrix.ColumnNames.Concat(new[] { ESTIMATEDVARIANCE_TRAINING_SERIES_NAME, ESTIMATEDVARIANCE_TEST_SERIES_NAME }).ToList();
+      ((IStringConvertibleMatrix)matrix).Columns += 2;
+      matrix.ColumnNames = columnNames;
+
+      var trainingRows = Content.ProblemData.TrainingIndices;
+      var testRows = Content.ProblemData.TestIndices;
+
+      var estimated_var_training = Content.GetEstimatedVariance(trainingRows).GetEnumerator();
+      var estimated_var_test = Content.GetEstimatedVariance(testRows).GetEnumerator();
+
+      foreach (var row in Content.ProblemData.TrainingIndices) {
+        estimated_var_training.MoveNext();
+        matrix[row, 7] = estimated_var_training.Current.ToString();
+      }
+
+      foreach (var row in Content.ProblemData.TestIndices) {
+        estimated_var_test.MoveNext();
+        matrix[row, 8] = estimated_var_test.Current.ToString();
+      }
+
+
+      return matrix;
     }
-
-    protected override void DeregisterContentEvents() {
-      base.DeregisterContentEvents();
-      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
-      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
-    }
-
-    private void Content_ProblemDataChanged(object sender, EventArgs e) {
-      OnContentChanged();
-    }
-
-    private void Content_ModelChanged(object sender, EventArgs e) {
-      OnContentChanged();
-    }
-
-    protected override void OnContentChanged() {
-      base.OnContentChanged();
-      UpdateEstimatedValues();
-    }
-
-    private void UpdateEstimatedValues() {
-      if (InvokeRequired) Invoke((Action)UpdateEstimatedValues);
-      else {
-        StringMatrix matrix = null;
-        if (Content != null) {
-          string[,] values = new string[Content.ProblemData.Dataset.Rows, 9];
-
-          var trainingRows = Content.ProblemData.TrainingIndices;
-          var testRows = Content.ProblemData.TestIndices;
-
-          double[] target = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
-          var estimated = Content.EstimatedValues.GetEnumerator();
-          var estimated_training = Content.EstimatedTrainingValues.GetEnumerator();
-          var estimated_test = Content.EstimatedTestValues.GetEnumerator();
-          var estimated_var_training = Content.GetEstimatedVariance(trainingRows).GetEnumerator();
-          var estimated_var_test = Content.GetEstimatedVariance(testRows).GetEnumerator();
-
-          foreach (var row in Content.ProblemData.TrainingIndices) {
-            estimated_training.MoveNext();
-            estimated_var_training.MoveNext();
-            values[row, 3] = estimated_training.Current.ToString();
-            values[row, 7] = estimated_var_training.Current.ToString();
-          }
-
-          foreach (var row in Content.ProblemData.TestIndices) {
-            estimated_test.MoveNext();
-            estimated_var_test.MoveNext();
-            values[row, 4] = estimated_test.Current.ToString();
-            values[row, 8] = estimated_var_test.Current.ToString();
-          }
-
-          foreach (var row in Enumerable.Range(0, Content.ProblemData.Dataset.Rows)) {
-            estimated.MoveNext();
-            double est = estimated.Current;
-            double res = Math.Abs(est - target[row]);
-            values[row, 0] = row.ToString();
-            values[row, 1] = target[row].ToString();
-            values[row, 2] = est.ToString();
-            values[row, 5] = Math.Abs(res).ToString();
-            values[row, 6] = Math.Abs(res / est).ToString();
-          }
-
-          matrix = new StringMatrix(values);
-          matrix.ColumnNames = new string[] { "Id", TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME, "Absolute Error (all)", "Relative Error (all)", ESTIMATEDVARIANCE_TRAINING_SERIES_NAME, ESTIMATEDVARIANCE_TEST_SERIES_NAME };
-          matrix.SortableView = true;
-        }
-        matrixView.Content = matrix;
-      }
-    }
-    #endregion
   }
 }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs	(revision 13591)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs	(revision 13592)
@@ -42,5 +42,5 @@
     }
 
-    protected StringConvertibleMatrixView matrixView;
+    private StringConvertibleMatrixView matrixView;
 
     public RegressionSolutionEstimatedValuesView()
@@ -67,9 +67,9 @@
     }
 
-    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+    protected virtual void Content_ProblemDataChanged(object sender, EventArgs e) {
       OnContentChanged();
     }
 
-    private void Content_ModelChanged(object sender, EventArgs e) {
+    protected virtual void Content_ModelChanged(object sender, EventArgs e) {
       OnContentChanged();
     }
@@ -80,40 +80,45 @@
     }
 
-    private void UpdateEstimatedValues() {
+    protected virtual StringMatrix CreateValueMatrix() {
+      string[,] values = new string[Content.ProblemData.Dataset.Rows, 7];
+
+      double[] target = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
+      var estimated = Content.EstimatedValues.GetEnumerator();
+      var estimated_training = Content.EstimatedTrainingValues.GetEnumerator();
+      var estimated_test = Content.EstimatedTestValues.GetEnumerator();
+
+      foreach (var row in Content.ProblemData.TrainingIndices) {
+        estimated_training.MoveNext();
+        values[row, 3] = estimated_training.Current.ToString();
+      }
+
+      foreach (var row in Content.ProblemData.TestIndices) {
+        estimated_test.MoveNext();
+        values[row, 4] = estimated_test.Current.ToString();
+      }
+
+      foreach (var row in Enumerable.Range(0, Content.ProblemData.Dataset.Rows)) {
+        estimated.MoveNext();
+        double est = estimated.Current;
+        double res = Math.Abs(est - target[row]);
+        values[row, 0] = row.ToString();
+        values[row, 1] = target[row].ToString();
+        values[row, 2] = est.ToString();
+        values[row, 5] = Math.Abs(res).ToString();
+        values[row, 6] = Math.Abs(res / target[row]).ToString();
+      }
+
+      var matrix = new StringMatrix(values);
+      matrix.ColumnNames = new string[] { "Id", TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME, "Absolute Error (all)", "Relative Error (all)" };
+      matrix.SortableView = true;
+      return matrix;
+    }
+
+    protected virtual void UpdateEstimatedValues() {
       if (InvokeRequired) Invoke((Action)UpdateEstimatedValues);
       else {
         StringMatrix matrix = null;
         if (Content != null) {
-          string[,] values = new string[Content.ProblemData.Dataset.Rows, 7];
-
-          double[] target = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
-          var estimated = Content.EstimatedValues.GetEnumerator();
-          var estimated_training = Content.EstimatedTrainingValues.GetEnumerator();
-          var estimated_test = Content.EstimatedTestValues.GetEnumerator();
-
-          foreach (var row in Content.ProblemData.TrainingIndices) {
-            estimated_training.MoveNext();
-            values[row, 3] = estimated_training.Current.ToString();
-          }
-
-          foreach (var row in Content.ProblemData.TestIndices) {
-            estimated_test.MoveNext();
-            values[row, 4] = estimated_test.Current.ToString();
-          }
-
-          foreach (var row in Enumerable.Range(0, Content.ProblemData.Dataset.Rows)) {
-            estimated.MoveNext();
-            double est = estimated.Current;
-            double res = Math.Abs(est - target[row]);
-            values[row, 0] = row.ToString();
-            values[row, 1] = target[row].ToString();
-            values[row, 2] = est.ToString();
-            values[row, 5] = Math.Abs(res).ToString();
-            values[row, 6] = Math.Abs(res / target[row]).ToString();
-          }
-
-          matrix = new StringMatrix(values);
-          matrix.ColumnNames = new string[] { "Id", TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME, "Absolute Error (all)", "Relative Error (all)" };
-          matrix.SortableView = true;
+          matrix = CreateValueMatrix();
         }
         matrixView.Content = matrix;
