Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs	(revision 7866)
@@ -57,6 +57,4 @@
       matrixView.DataGridView.RowPrePaint += new DataGridViewRowPrePaintEventHandler(DataGridView_RowPrePaint);
     }
-
-
 
     private void SamplesComboBox_SelectedIndexChanged(object sender, EventArgs e) {
Index: anches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/DataAnalysisProblemView.Designer.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/DataAnalysisProblemView.Designer.cs	(revision 7865)
+++ 	(revision )
@@ -1,108 +1,0 @@
-﻿#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 DataAnalysisProblemView {
-    /// <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.ImportButton = new System.Windows.Forms.Button();
-      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
-      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
-      this.SuspendLayout();
-      // 
-      // parameterCollectionView
-      // 
-      this.parameterCollectionView.Location = new System.Drawing.Point(3, 55);
-      this.parameterCollectionView.Size = new System.Drawing.Size(490, 279);
-      this.parameterCollectionView.TabIndex = 4;
-      // 
-      // nameTextBox
-      // 
-      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
-      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
-      this.nameTextBox.Size = new System.Drawing.Size(409, 20);
-      // 
-      // infoLabel
-      // 
-      this.infoLabel.Location = new System.Drawing.Point(474, 3);
-      // 
-      // ImportButton
-      // 
-      this.ImportButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.ImportButton.Location = new System.Drawing.Point(0, 26);
-      this.ImportButton.Name = "ImportButton";
-      this.ImportButton.Size = new System.Drawing.Size(493, 23);
-      this.ImportButton.TabIndex = 3;
-      this.ImportButton.Text = "Import from CSV file";
-      this.ImportButton.UseVisualStyleBackColor = true;
-      this.ImportButton.Click += new System.EventHandler(this.ImportButton_Click);
-      // 
-      // openFileDialog
-      // 
-      this.openFileDialog.Filter = "CSV files|*.csv|Text files|*.txt|All files|*.*";
-      this.openFileDialog.Title = "Import data...";
-      // 
-      // DataAnalysisProblemView
-      // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.ImportButton);
-      this.Name = "DataAnalysisProblemView";
-      this.Size = new System.Drawing.Size(493, 334);
-      this.Controls.SetChildIndex(this.ImportButton, 0);
-      this.Controls.SetChildIndex(this.infoLabel, 0);
-      this.Controls.SetChildIndex(this.nameTextBox, 0);
-      this.Controls.SetChildIndex(this.nameLabel, 0);
-      this.Controls.SetChildIndex(this.parameterCollectionView, 0);
-      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
-      this.ResumeLayout(false);
-      this.PerformLayout();
-
-    }
-
-    #endregion
-
-    private System.Windows.Forms.Button ImportButton;
-    private System.Windows.Forms.OpenFileDialog openFileDialog;
-  }
-}
Index: anches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/DataAnalysisProblemView.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/DataAnalysisProblemView.cs	(revision 7865)
+++ 	(revision )
@@ -1,57 +1,0 @@
-﻿#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;
-using System.Windows.Forms;
-using HeuristicLab.MainForm;
-using HeuristicLab.Optimization.Views;
-using HeuristicLab.PluginInfrastructure;
-
-namespace HeuristicLab.Problems.DataAnalysis.Views {
-  [View("DataAnalysisProblem View")]
-  [Content(typeof(IDataAnalysisProblem), true)]
-  public partial class DataAnalysisProblemView : ProblemView {
-    public DataAnalysisProblemView() {
-      InitializeComponent();
-    }
-
-    public new IDataAnalysisProblem Content {
-      get { return (IDataAnalysisProblem)base.Content; }
-      set { base.Content = value; }
-    }
-
-    protected override void SetEnabledStateOfControls() {
-      base.SetEnabledStateOfControls();
-      ImportButton.Enabled = !Locked && !ReadOnly && Content != null;
-    }
-
-    private void ImportButton_Click(object sender, System.EventArgs e) {
-      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
-        try {
-          Content.ImportProblemDataFromFile(openFileDialog.FileName);
-        }
-        catch (Exception ex) {
-          ErrorHandling.ShowErrorDialog(this, ex);
-        }
-      }
-    }
-  }
-}
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 7866)
@@ -161,4 +161,10 @@
     </Compile>
     <Compile Include="Plugin.cs" />
+    <Compile Include="Regression\RegressionEnsembleSolutionModelView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Regression\RegressionEnsembleSolutionModelView.Designer.cs">
+      <DependentUpon>RegressionEnsembleSolutionModelView.cs</DependentUpon>
+    </Compile>
     <Compile Include="Regression\RegressionSolutionErrorCharacteristicsCurveView.cs">
       <SubType>UserControl</SubType>
@@ -167,9 +173,27 @@
       <DependentUpon>RegressionSolutionErrorCharacteristicsCurveView.cs</DependentUpon>
     </Compile>
-    <Compile Include="Regression\RegressionEnsembleSolutionModelView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="Regression\RegressionEnsembleSolutionModelView.Designer.cs">
-      <DependentUpon>RegressionEnsembleSolutionModelView.cs</DependentUpon>
+    <Compile Include="Regression\RegressionSolutionEstimatedValuesView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Regression\RegressionSolutionEstimatedValuesView.Designer.cs">
+      <DependentUpon>RegressionSolutionEstimatedValuesView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Regression\RegressionSolutionLineChartView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Regression\RegressionSolutionLineChartView.Designer.cs">
+      <DependentUpon>RegressionSolutionLineChartView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Regression\RegressionSolutionResidualHistogram.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Regression\RegressionSolutionResidualHistogram.Designer.cs">
+      <DependentUpon>RegressionSolutionResidualHistogram.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Regression\RegressionSolutionScatterPlotView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="Regression\RegressionSolutionScatterPlotView.Designer.cs">
+      <DependentUpon>RegressionSolutionScatterPlotView.cs</DependentUpon>
     </Compile>
     <Compile Include="Solution Views\ClassificationSolutionView.cs">
@@ -265,31 +289,7 @@
       <DependentUpon>RegressionSolutionView.cs</DependentUpon>
     </Compile>
-    <Compile Include="Regression\RegressionSolutionEstimatedValuesView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="Regression\RegressionSolutionEstimatedValuesView.Designer.cs">
-      <DependentUpon>RegressionSolutionEstimatedValuesView.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Regression\RegressionSolutionLineChartView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="Regression\RegressionSolutionLineChartView.Designer.cs">
-      <DependentUpon>RegressionSolutionLineChartView.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Regression\RegressionSolutionScatterPlotView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="Regression\RegressionSolutionScatterPlotView.Designer.cs">
-      <DependentUpon>RegressionSolutionScatterPlotView.cs</DependentUpon>
-    </Compile>
     <None Include="HeuristicLab.snk" />
     <None Include="Plugin.cs.frame" />
     <None Include="Properties\AssemblyInfo.cs.frame" />
-    <Compile Include="DataAnalysisProblemView.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="DataAnalysisProblemView.Designer.cs">
-      <DependentUpon>DataAnalysisProblemView.cs</DependentUpon>
-    </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
@@ -317,4 +317,7 @@
       <Install>true</Install>
     </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="obj\" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/CreateEnsembleMenuItem.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/CreateEnsembleMenuItem.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/CreateEnsembleMenuItem.cs	(revision 7866)
@@ -73,5 +73,5 @@
               .First()
               .ProblemData.Clone();
-            var ensemble = new RegressionEnsembleSolution(Enumerable.Empty<IRegressionModel>(), problemData);
+            var ensemble = new RegressionEnsembleSolution(problemData);
             ensemble.Name = group.Key + " ensemble";
             var nestedSolutions = group.OfType<RegressionEnsembleSolution>().SelectMany(e => e.RegressionSolutions);
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs	(revision 7866)
@@ -49,5 +49,6 @@
       this.chart.TabIndex = 0;
       this.chart.Text = "chart";
-      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
+      this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Chart_MouseDoubleClick);
+      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
       // 
       // label1
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs	(revision 7866)
@@ -27,4 +27,5 @@
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
+
 namespace HeuristicLab.Problems.DataAnalysis.Views {
   [View("Error Characteristics Curve")]
@@ -104,17 +105,17 @@
       var originalValues = GetOriginalValues().ToList();
       constantModel = CreateConstantModel();
-      var meanModelEstimatedValues = GetEstimatedValues(constantModel);
-      var meanModelResiduals = GetResiduals(originalValues, meanModelEstimatedValues);
-
-      meanModelResiduals.Sort();
-      chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(meanModelResiduals.Last());
-      chart.ChartAreas[0].CursorX.Interval = meanModelResiduals.First() / 100;
-
-      Series meanModelSeries = new Series("Mean Model");
-      meanModelSeries.ChartType = SeriesChartType.FastLine;
-      UpdateSeries(meanModelResiduals, meanModelSeries);
-      meanModelSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(meanModelSeries);
-      meanModelSeries.Tag = constantModel;
-      chart.Series.Add(meanModelSeries);
+      var baselineEstimatedValues = GetEstimatedValues(constantModel);
+      var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues);
+
+      baselineResiduals.Sort();
+      chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(baselineResiduals.Last());
+      chart.ChartAreas[0].CursorX.Interval = baselineResiduals.First() / 100;
+
+      Series baselineSeries = new Series("Baseline");
+      baselineSeries.ChartType = SeriesChartType.FastLine;
+      UpdateSeries(baselineResiduals, baselineSeries);
+      baselineSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(baselineSeries);
+      baselineSeries.Tag = constantModel;
+      chart.Series.Add(baselineSeries);
 
       AddRegressionSolution(Content);
@@ -200,5 +201,5 @@
     }
 
-    protected IEnumerable<double> GetMeanModelEstimatedValues(IEnumerable<double> originalValues) {
+    protected IEnumerable<double> GetbaselineEstimatedValues(IEnumerable<double> originalValues) {
       double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average();
       return Enumerable.Repeat(averageTrainingTarget, originalValues.Count());
@@ -229,10 +230,8 @@
     }
 
-    #region Mean Model
-    private void chart_MouseDown(object sender, MouseEventArgs e) {
-      if (e.Clicks < 2) return;
+    #region Baseline
+    private void Chart_MouseDoubleClick(object sender, MouseEventArgs e) {
       HitTestResult result = chart.HitTest(e.X, e.Y);
       if (result.ChartElementType != ChartElementType.LegendItem) return;
-      if (result.Series.Name != constantModel.Name) return;
 
       MainFormManager.MainForm.ShowContent((IRegressionSolution)result.Series.Tag);
@@ -242,8 +241,16 @@
       double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average();
       var solution = new ConstantRegressionModel(averageTrainingTarget).CreateRegressionSolution(ProblemData);
-      solution.Name = "Mean Model";
+      solution.Name = "Baseline";
       return solution;
     }
     #endregion
+
+    private void chart_MouseMove(object sender, MouseEventArgs e) {
+      HitTestResult result = chart.HitTest(e.X, e.Y);
+      if (result.ChartElementType == ChartElementType.LegendItem)
+        Cursor = Cursors.Hand;
+      else
+        Cursor = Cursors.Default;
+    }
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.Designer.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.Designer.cs	(revision 7866)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.Designer.cs	(revision 7866)
@@ -0,0 +1,66 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Views {
+  partial class RegressionSolutionResidualHistogram {
+    /// <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() {
+      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();
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
+      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.Size = new System.Drawing.Size(358, 225);
+      this.chart.TabIndex = 0;
+      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
+      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
+      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
+      // 
+      // RegressionSolutionResidualHistogram
+      // 
+      this.AllowDrop = true;
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.chart);
+      this.Name = "RegressionSolutionResidualHistogram";
+      this.Size = new System.Drawing.Size(289, 220);
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
+  }
+}
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.cs	(revision 7866)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.cs	(revision 7866)
@@ -0,0 +1,240 @@
+﻿#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;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Forms;
+using System.Windows.Forms.DataVisualization.Charting;
+using HeuristicLab.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Views {
+  [View("Residual Histogram")]
+  [Content(typeof(IRegressionSolution))]
+  public partial class RegressionSolutionResidualHistogram : DataAnalysisSolutionEvaluationView {
+
+    #region variables
+    protected const string ALL_SAMPLES = "All samples";
+    protected const string TRAINING_SAMPLES = "Training samples";
+    protected const string TEST_SAMPLES = "Test samples";
+    /// <summary>
+    /// used to reduce code duplication
+    /// </summary>
+    protected static string[] ALL_SERIES = new string[] { ALL_SAMPLES, TRAINING_SAMPLES, TEST_SAMPLES };
+    /// <summary>
+    /// approximate amount of bins 
+    /// </summary>
+    protected const double bins = 25;
+    /// <summary>
+    ///  keeps for all series a list for every bin with the position of the bin, the relative frequency of the
+    ///  residuals and the beginning and the end of the interval of the bin
+    ///  </summary>
+    protected Dictionary<string, List<List<double>>> relativeFrequencies;
+    #endregion
+
+    public new IRegressionSolution Content {
+      get { return (IRegressionSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    public RegressionSolutionResidualHistogram()
+      : base() {
+      InitializeComponent();
+      relativeFrequencies = new Dictionary<string, List<List<double>>>();
+      foreach (string series in ALL_SERIES) {
+        chart.Series.Add(series);
+        chart.Series[series].LegendText = series;
+        chart.Series[series].ChartType = SeriesChartType.Column;
+        chart.Series[series]["PointWidth"] = "0.9";
+        chart.Series[series].BorderWidth = 1;
+        chart.Series[series].BorderDashStyle = ChartDashStyle.Solid;
+        chart.Series[series].BorderColor = Color.Black;
+        chart.Series[series].ToolTip = series + " Y = #VALY from #CUSTOMPROPERTY(from) to #CUSTOMPROPERTY(to)";
+        relativeFrequencies[series] = new List<List<double>>();
+      }
+      //configure axis 
+      chart.CustomizeAllChartAreas();
+      chart.ChartAreas[0].AxisX.Title = "Residuals";
+      chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
+      chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
+      chart.ChartAreas[0].CursorX.Interval = 1;
+      chart.ChartAreas[0].CursorY.Interval = 1;
+      chart.ChartAreas[0].AxisY.Title = "Relative Frequency";
+      chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
+      chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
+      chart.ChartAreas[0].AxisY.IsStartedFromZero = true;
+    }
+
+    private void RedrawChart() {
+      foreach (string series in ALL_SERIES) {
+        chart.Series[series].Points.Clear();
+        relativeFrequencies[series].Clear();
+      }
+      if (Content != null) {
+        Dictionary<string, List<double>> residuals = CalculateResiduals();
+        double realMax = Math.Max(Math.Abs(residuals[ALL_SAMPLES].Min()), Math.Abs(residuals[ALL_SAMPLES].Max()));
+        double roundedMax = HumanRoundMax(realMax);
+        double intervalWidth = (roundedMax * 2.0) / bins;
+        intervalWidth = HumanRoundMax(intervalWidth);
+        // sets roundedMax to a value, so that zero will be in the middle of the x axis
+        double help = realMax / intervalWidth;
+        help = help % 1 < 0.5 ? (int)help : (int)help + 1;
+        roundedMax = help * intervalWidth;
+
+        foreach (string series in ALL_SERIES) {
+          CalculateFrequencies(residuals[series], series, roundedMax, intervalWidth);
+          if (!series.Equals(ALL_SAMPLES))
+            ShowValues(chart.Series[series], relativeFrequencies[series]);
+        }
+
+        ChartArea chartArea = chart.ChartAreas[0];
+        chartArea.AxisX.Minimum = -roundedMax - intervalWidth;
+        chartArea.AxisX.Maximum = roundedMax + intervalWidth;
+        // get the highest frequency of a residual of any series
+        chartArea.AxisY.Maximum = (from series in relativeFrequencies.Values
+                                   select (from residual in series
+                                           select residual.ElementAt(1)).Max()).Max();
+        if (chartArea.AxisY.Maximum < 0.1) {
+          chartArea.AxisY.Interval = 0.01;
+          chartArea.AxisY.Maximum = Math.Ceiling(chartArea.AxisY.Maximum * 100) / 100;
+        } else {
+          chartArea.AxisY.Interval = 0.1;
+          chartArea.AxisY.Maximum = Math.Ceiling(chartArea.AxisY.Maximum * 10) / 10;
+        }
+        chartArea.AxisX.Interval = intervalWidth;
+        int curBins = (int)Math.Round((roundedMax * 2) / intervalWidth);
+        //shifts the x axis label so that zero is in the middle
+        if (curBins % 2 == 0)
+          chartArea.AxisX.IntervalOffset = intervalWidth;
+        else
+          chartArea.AxisX.IntervalOffset = intervalWidth / 2;
+      }
+    }
+
+    private Dictionary<string, List<double>> CalculateResiduals() {
+      Dictionary<string, List<double>> residuals = new Dictionary<string, List<double>>();
+
+      foreach (string series in ALL_SERIES) {
+        residuals[series] = new List<double>();
+      }
+      IRegressionProblemData problemdata = Content.ProblemData;
+      List<double> targetValues = problemdata.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToList();
+      List<double> estimatedValues = Content.EstimatedValues.ToList();
+
+      for (int i = 0; i < Content.ProblemData.Dataset.Rows; i++) {
+        double residual = estimatedValues[i] - targetValues[i];
+        residuals[ALL_SAMPLES].Add(residual);
+        if (i >= problemdata.TrainingPartition.Start && i < problemdata.TrainingPartition.End)
+          residuals[TRAINING_SAMPLES].Add(residual);
+        if (i >= problemdata.TestPartition.Start && i < problemdata.TestPartition.End)
+          residuals[TEST_SAMPLES].Add(residual);
+      }
+      return residuals;
+    }
+
+    private void CalculateFrequencies(List<double> residualValues, string series, double max, double intervalWidth) {
+      double intervalCenter = intervalWidth / 2.0;
+      double sampleCount = residualValues.Count();
+      double current = -max;
+
+      for (int i = 0; i <= bins; i++) {
+        IEnumerable<double> help = residualValues.Where(x => x >= (current - intervalCenter) && x < (current + intervalCenter));
+        relativeFrequencies[series].Add(new List<double>() { current, help.Count() / sampleCount, current - intervalCenter, current + intervalCenter });
+        current += intervalWidth;
+      }
+    }
+
+    private double HumanRoundMax(double max) {
+      double base10;
+      if (max > 0) base10 = Math.Pow(10.0, Math.Floor(Math.Log10(max)));
+      else base10 = Math.Pow(10.0, Math.Ceiling(Math.Log10(-max)));
+      double rounding = (max > 0) ? base10 : -base10;
+      while (rounding < max) rounding += base10;
+      return rounding;
+    }
+
+    #region events
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.ModelChanged += new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      RedrawChart();
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      RedrawChart();
+    }
+    private void Content_ModelChanged(object sender, EventArgs e) {
+      RedrawChart();
+    }
+    private void chart_MouseDown(object sender, MouseEventArgs e) {
+      HitTestResult result = chart.HitTest(e.X, e.Y);
+      if (result.ChartElementType == ChartElementType.LegendItem) {
+        ToggleSeriesData(result.Series);
+      }
+    }
+    private void chart_MouseMove(object sender, MouseEventArgs e) {
+      HitTestResult result = chart.HitTest(e.X, e.Y);
+      if (result.ChartElementType == ChartElementType.LegendItem)
+        Cursor = Cursors.Hand;
+      else
+        Cursor = Cursors.Default;
+    }
+    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
+      if (chart.Series.Count != 3) return;
+      e.LegendItems[0].Cells[1].ForeColor = chart.Series[ALL_SAMPLES].Points.Count == 0 ? Color.Gray : Color.Black;
+      e.LegendItems[1].Cells[1].ForeColor = chart.Series[TRAINING_SAMPLES].Points.Count == 0 ? Color.Gray : Color.Black;
+      e.LegendItems[2].Cells[1].ForeColor = chart.Series[TEST_SAMPLES].Points.Count == 0 ? Color.Gray : Color.Black;
+    }
+    #endregion
+
+    private void ToggleSeriesData(Series series) {
+      if (series.Points.Count > 0) {  //checks if series is shown
+        if (chart.Series.Any(s => s != series && s.Points.Count > 0)) {
+          series.Points.Clear();
+        }
+      } else if (Content != null) {
+        ShowValues(series, relativeFrequencies[series.Name]);
+        chart.Legends[series.Legend].ForeColor = Color.Black;
+        chart.Refresh();
+      }
+    }
+    private void ShowValues(Series series, List<List<double>> relativeSeriesFrequencies) {
+      DataPointCollection seriesPoints = series.Points;
+
+      foreach (var valueList in relativeSeriesFrequencies) {
+        seriesPoints.AddXY(valueList[0], valueList[1]);
+        seriesPoints[seriesPoints.Count - 1]["from"] = valueList[2].ToString();
+        seriesPoints[seriesPoints.Count - 1]["to"] = valueList[3].ToString();
+      }
+    }
+  }
+}
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationEnsembleSolutionView.cs	(revision 7866)
@@ -51,6 +51,7 @@
       if (cmbWeightCalculator.Items.Count == 0) {
         cmbWeightCalculator.Items.AddRange(ApplicationManager.Manager.GetInstances<IClassificationEnsembleSolutionWeightCalculator>().OrderBy(b => b.Name, new NaturalStringComparer()).ToArray());
-        if (cmbWeightCalculator.Items.Count > 0)
+        if (cmbWeightCalculator.Items.Count > 0) {
           cmbWeightCalculator.SelectedIndex = 0;
+        }
       } else {
         Content.WeightCalculator = (IClassificationEnsembleSolutionWeightCalculator)cmbWeightCalculator.SelectedItem;
@@ -59,6 +60,7 @@
 
     protected void cmbWeightCalculator_SelectedIndexChanged(object sender, System.EventArgs e) {
-      if (cmbWeightCalculator.SelectedItem != null)
+      if (cmbWeightCalculator.SelectedItem != null) {
         Content.WeightCalculator = (IClassificationEnsembleSolutionWeightCalculator)cmbWeightCalculator.SelectedItem;
+      }
     }
 
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs	(revision 7866)
@@ -72,5 +72,5 @@
       rows = variableValues.First().Count;
       this.variableNames = new List<string>(variableNames);
-      this.variableValues = new Dictionary<string, IList>();
+      this.variableValues = new Dictionary<string, IList>(this.variableNames.Count);
       for (int i = 0; i < this.variableNames.Count; i++) {
         var values = variableValues.ElementAt(i);
@@ -107,8 +107,8 @@
       this.variableNames = new List<string>(variableNames);
 
-      this.variableValues = new Dictionary<string, IList>();
+      this.variableValues = new Dictionary<string, IList>(variableValues.GetLength(1));
       for (int col = 0; col < variableValues.GetLength(1); col++) {
         string columName = this.variableNames[col];
-        var values = new List<double>();
+        var values = new List<double>(variableValues.GetLength(0));
         for (int row = 0; row < variableValues.GetLength(0); row++) {
           values.Add(variableValues[row, col]);
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 7866)
@@ -120,4 +120,7 @@
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core">
@@ -179,4 +182,5 @@
     <Compile Include="Interfaces\Regression\IRegressionEnsembleSolution.cs" />
     <Compile Include="Implementation\Regression\RegressionSolutionBase.cs" />
+    <Compile Include="OnlineCalculators\OnlineMaxAbsoluteErrorCalculator.cs" />
     <Compile Include="OnlineCalculators\OnlineMeanErrorCalculator.cs" />
     <Compile Include="OnlineCalculators\NormalizedGiniCalculator.cs" />
@@ -217,5 +221,4 @@
     <Compile Include="Implementation\Regression\RegressionSolution.cs" />
     <Compile Include="Plugin.cs" />
-    <Compile Include="TableFileParser.cs" />
     <Compile Include="Implementation\Classification\ThresholdCalculators\AccuracyMaximizationThresholdCalculator.cs" />
     <Compile Include="Implementation\Classification\ThresholdCalculators\NormalDistributionCutPointsThresholdCalculator.cs" />
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs	(revision 7866)
@@ -40,9 +40,4 @@
       ProblemData = new ClassificationProblemData();
     }
-
-    public override void ImportProblemDataFromFile(string fileName) {
-      ClassificationProblemData problemData = ClassificationProblemData.ImportFromFile(fileName);
-      ProblemData = problemData;
-    }
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs	(revision 7866)
@@ -22,5 +22,4 @@
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using HeuristicLab.Common;
@@ -403,18 +402,4 @@
     }
     #endregion
-
-    #region Import from file
-    public static ClassificationProblemData ImportFromFile(string fileName) {
-      TableFileParser csvFileParser = new TableFileParser();
-      csvFileParser.Parse(fileName);
-
-      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
-      dataset.Name = Path.GetFileName(fileName);
-
-      ClassificationProblemData problemData = new ClassificationProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());
-      problemData.Name = "Data imported from " + Path.GetFileName(fileName);
-      return problemData;
-    }
-    #endregion
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MajorityVoteWeightCalculator.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MajorityVoteWeightCalculator.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MajorityVoteWeightCalculator.cs	(revision 7866)
@@ -51,4 +51,14 @@
       return Enumerable.Repeat<double>(1, classificationSolutions.Count());
     }
+
+    public override double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue) {
+      if (solutions.Count() < 1)
+        return double.NaN;
+      Dataset dataset = solutions.First().ProblemData.Dataset;
+      int correctEstimated = solutions.Select(s => s.Model.GetEstimatedClassValues(dataset, Enumerable.Repeat(index, 1)).First())
+                                      .Where(x => x.Equals(estimatedClassValue))
+                                      .Count();
+      return ((double)correctEstimated / (double)solutions.Count() - 0.5) * 2;
+    }
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblem.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblem.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblem.cs	(revision 7866)
@@ -38,9 +38,4 @@
       ProblemData = new ClusteringProblemData();
     }
-
-    public override void ImportProblemDataFromFile(string fileName) {
-      ClusteringProblemData problemData = ClusteringProblemData.ImportFromFile(fileName);
-      ProblemData = problemData;
-    }
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs	(revision 7866)
@@ -21,5 +21,4 @@
 
 using System.Collections.Generic;
-using System.IO;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -90,19 +89,4 @@
       : base(dataset, allowedInputVariables) {
     }
-
-
-    #region Import from file
-    public static ClusteringProblemData ImportFromFile(string fileName) {
-      TableFileParser csvFileParser = new TableFileParser();
-      csvFileParser.Parse(fileName);
-
-      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
-      dataset.Name = Path.GetFileName(fileName);
-
-      ClusteringProblemData problemData = new ClusteringProblemData(dataset, dataset.DoubleVariables);
-      problemData.Name = "Data imported from " + Path.GetFileName(fileName);
-      return problemData;
-    }
-    #endregion
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs	(revision 7866)
@@ -26,9 +26,10 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.Instances;
 
 namespace HeuristicLab.Problems.DataAnalysis {
   [StorableClass]
-  public abstract class DataAnalysisProblem<T> : Problem,
-    IDataAnalysisProblem<T>
+  public abstract class DataAnalysisProblem<T> : Problem, IDataAnalysisProblem<T>,
+    IProblemInstanceConsumer<T>, IProblemInstanceExporter<T>
     where T : class, IDataAnalysisProblemData {
     private const string ProblemDataParameterName = "ProblemData";
@@ -91,5 +92,16 @@
     }
 
-    public abstract void ImportProblemDataFromFile(string fileName);
+    #region Import & Export
+    public void Load(T data) {
+      Name = data.Name;
+      Description = data.Description;
+      ProblemData = data;
+      OnReset();
+    }
+
+    public T Export() {
+      return ProblemData;
+    }
+    #endregion
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs	(revision 7866)
@@ -97,4 +97,8 @@
 
       RegisterRegressionSolutionsEventHandler();
+    }
+
+    public RegressionEnsembleSolution(IRegressionProblemData problemData)
+      : this(Enumerable.Empty<IRegressionModel>(), problemData) {
     }
 
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs	(revision 7866)
@@ -40,9 +40,4 @@
       ProblemData = new RegressionProblemData();
     }
-
-    public override void ImportProblemDataFromFile(string fileName) {
-      RegressionProblemData problemData = RegressionProblemData.ImportFromFile(fileName);
-      ProblemData = problemData;
-    }
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs	(revision 7866)
@@ -22,5 +22,4 @@
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using HeuristicLab.Common;
@@ -136,18 +135,4 @@
       OnChanged();
     }
-
-    #region Import from file
-    public static RegressionProblemData ImportFromFile(string fileName) {
-      TableFileParser csvFileParser = new TableFileParser();
-      csvFileParser.Parse(fileName);
-
-      Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
-      dataset.Name = Path.GetFileName(fileName);
-
-      RegressionProblemData problemData = new RegressionProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());
-      problemData.Name = "Data imported from " + Path.GetFileName(fileName);
-      return problemData;
-    }
-    #endregion
   }
 }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs	(revision 7866)
@@ -44,5 +44,5 @@
     protected RegressionSolution(IRegressionModel model, IRegressionProblemData problemData)
       : base(model, problemData) {
-      evaluationCache = new Dictionary<int, double>();
+      evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows);
     }
 
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs	(revision 7866)
@@ -21,5 +21,4 @@
 
 using System.Collections.Generic;
-using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Data;
@@ -166,8 +165,8 @@
 
     protected void CalculateResults() {
-      double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values
-      double[] originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToArray();
-      double[] estimatedTestValues = EstimatedTestValues.ToArray(); // cache values
-      double[] originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes).ToArray();
+      IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values
+      IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
+      IEnumerable<double> estimatedTestValues = EstimatedTestValues; // cache values
+      IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
 
       OnlineCalculatorError errorState;
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs	(revision 7866)
@@ -29,6 +29,4 @@
     IDataAnalysisProblemData ProblemData { get; }
     event EventHandler ProblemDataChanged;
-
-    void ImportProblemDataFromFile(string fileName);
   }
 
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMaxAbsoluteErrorCalculator.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMaxAbsoluteErrorCalculator.cs	(revision 7866)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineMaxAbsoluteErrorCalculator.cs	(revision 7866)
@@ -0,0 +1,91 @@
+﻿#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;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  public class OnlineMaxAbsoluteErrorCalculator : IOnlineCalculator {
+
+    private double mae;
+    private int n;
+    public double MaxAbsoluteError {
+      get {
+        return n > 0 ? mae : 0.0;
+      }
+    }
+
+    public OnlineMaxAbsoluteErrorCalculator() {
+      Reset();
+    }
+
+    #region IOnlineCalculator Members
+    private OnlineCalculatorError errorState;
+    public OnlineCalculatorError ErrorState {
+      get { return errorState; }
+    }
+    public double Value {
+      get { return MaxAbsoluteError; }
+    }
+    public void Reset() {
+      n = 0;
+      mae = double.MinValue;
+      errorState = OnlineCalculatorError.InsufficientElementsAdded;
+    }
+
+    public void Add(double original, double estimated) {
+      if (double.IsNaN(estimated) || double.IsInfinity(estimated) ||
+          double.IsNaN(original) || double.IsInfinity(original) || (errorState & OnlineCalculatorError.InvalidValueAdded) > 0) {
+        errorState = errorState | OnlineCalculatorError.InvalidValueAdded;
+      } else {
+        double error = Math.Abs(estimated - original);
+        if (error > mae)
+          mae = error;
+        n++;
+        errorState = errorState & (~OnlineCalculatorError.InsufficientElementsAdded);        // n >= 1
+      }
+    }
+    #endregion
+
+    public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, out OnlineCalculatorError errorState) {
+      IEnumerator<double> originalEnumerator = originalValues.GetEnumerator();
+      IEnumerator<double> estimatedEnumerator = estimatedValues.GetEnumerator();
+      OnlineMaxAbsoluteErrorCalculator maeCalculator = new OnlineMaxAbsoluteErrorCalculator();
+
+      // always move forward both enumerators (do not use short-circuit evaluation!)
+      while (originalEnumerator.MoveNext() & estimatedEnumerator.MoveNext()) {
+        double original = originalEnumerator.Current;
+        double estimated = estimatedEnumerator.Current;
+        maeCalculator.Add(original, estimated);
+        if (maeCalculator.ErrorState != OnlineCalculatorError.None) break;
+      }
+
+      // check if both enumerators are at the end to make sure both enumerations have the same length
+      if (maeCalculator.ErrorState == OnlineCalculatorError.None &&
+         (estimatedEnumerator.MoveNext() || originalEnumerator.MoveNext())) {
+        throw new ArgumentException("Number of elements in originalValues and estimatedValues enumerations doesn't match.");
+      } else {
+        errorState = maeCalculator.ErrorState;
+        return maeCalculator.MaxAbsoluteError;
+      }
+    }
+  }
+}
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame	(revision 7865)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame	(revision 7866)
@@ -36,4 +36,5 @@
   [PluginDependency("HeuristicLab.Parameters", "3.3")]
   [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
   public class HeuristicLabProblemsDataAnalysisPlugin : PluginBase {
   }
Index: anches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/TableFileParser.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/TableFileParser.cs	(revision 7865)
+++ 	(revision )
@@ -1,435 +1,0 @@
-#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;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace HeuristicLab.Problems.DataAnalysis {
-  public class TableFileParser {
-    private const int BUFFER_SIZE = 1024;
-    private readonly char[] POSSIBLE_SEPARATORS = new char[] { ',', ';', '\t' };
-    private Tokenizer tokenizer;
-    private List<List<object>> rowValues;
-
-    private int rows;
-    public int Rows {
-      get { return rows; }
-      set { rows = value; }
-    }
-
-    private int columns;
-    public int Columns {
-      get { return columns; }
-      set { columns = value; }
-    }
-
-    private List<IList> values;
-    public List<IList> Values {
-      get {
-        return values;
-      }
-    }
-
-    private List<string> variableNames;
-    public IEnumerable<string> VariableNames {
-      get {
-        if (variableNames.Count > 0) return variableNames;
-        else {
-          string[] names = new string[columns];
-          for (int i = 0; i < names.Length; i++) {
-            names[i] = "X" + i.ToString("000");
-          }
-          return names;
-        }
-      }
-    }
-
-    public TableFileParser() {
-      rowValues = new List<List<object>>();
-      variableNames = new List<string>();
-    }
-
-    public void Parse(string fileName) {
-      NumberFormatInfo numberFormat;
-      DateTimeFormatInfo dateTimeFormatInfo;
-      char separator;
-      DetermineFileFormat(fileName, out numberFormat, out dateTimeFormatInfo, out separator);
-      using (StreamReader reader = new StreamReader(fileName)) {
-        tokenizer = new Tokenizer(reader, numberFormat, dateTimeFormatInfo, separator);
-        // parse the file
-        Parse();
-      }
-
-      // translate the list of samples into a DoubleMatrixData item
-      rows = rowValues.Count;
-      columns = rowValues[0].Count;
-      values = new List<IList>();
-
-      //create columns
-      for (int col = 0; col < columns; col++) {
-        var types = rowValues.Select(r => r[col]).Where(v => v != null && v as string != string.Empty).Take(10).Select(v => v.GetType());
-        if (!types.Any()) {
-          values.Add(new List<string>());
-          continue;
-        }
-
-        var columnType = types.GroupBy(v => v).OrderBy(v => v.Count()).Last().Key;
-        if (columnType == typeof(double)) values.Add(new List<double>());
-        else if (columnType == typeof(DateTime)) values.Add(new List<DateTime>());
-        else if (columnType == typeof(string)) values.Add(new List<string>());
-        else throw new InvalidOperationException();
-      }
-
-
-
-      //fill with values
-      foreach (List<object> row in rowValues) {
-        int columnIndex = 0;
-        foreach (object element in row) {
-          if (values[columnIndex] is List<double> && !(element is double))
-            values[columnIndex].Add(double.NaN);
-          else if (values[columnIndex] is List<DateTime> && !(element is DateTime))
-            values[columnIndex].Add(DateTime.MinValue);
-          else if (values[columnIndex] is List<string> && !(element is string))
-            values[columnIndex].Add(string.Empty);
-          else
-            values[columnIndex].Add(element);
-          columnIndex++;
-        }
-      }
-    }
-
-    private void DetermineFileFormat(string fileName, out NumberFormatInfo numberFormat, out DateTimeFormatInfo dateTimeFormatInfo, out char separator) {
-      using (StreamReader reader = new StreamReader(fileName)) {
-        // skip first line
-        reader.ReadLine();
-        // read a block
-        char[] buffer = new char[BUFFER_SIZE];
-        int charsRead = reader.ReadBlock(buffer, 0, BUFFER_SIZE);
-        // count frequency of special characters
-        Dictionary<char, int> charCounts = buffer.Take(charsRead)
-          .GroupBy(c => c)
-          .ToDictionary(g => g.Key, g => g.Count());
-
-        // depending on the characters occuring in the block 
-        // we distinghish a number of different cases based on the the following rules:
-        // many points => it must be English number format, the other frequently occuring char is the separator
-        // no points but many commas => this is the problematic case. Either German format (real numbers) or English format (only integer numbers) with ',' as separator
-        //   => check the line in more detail:
-        //            English: 0, 0, 0, 0
-        //            German:  0,0 0,0 0,0 ...
-        //            => if commas are followed by space => English format
-        // no points no commas => English format (only integer numbers) use the other frequently occuring char as separator
-        // in all cases only treat ' ' as separator if no other separator is possible (spaces can also occur additionally to separators)
-        if (OccurrencesOf(charCounts, '.') > 10) {
-          numberFormat = NumberFormatInfo.InvariantInfo;
-          dateTimeFormatInfo = DateTimeFormatInfo.InvariantInfo;
-          separator = POSSIBLE_SEPARATORS
-            .Where(c => OccurrencesOf(charCounts, c) > 10)
-            .OrderBy(c => -OccurrencesOf(charCounts, c))
-            .DefaultIfEmpty(' ')
-            .First();
-        } else if (OccurrencesOf(charCounts, ',') > 10) {
-          // no points and many commas
-          // count the number of tokens (chains of only digits and commas) that contain multiple comma characters
-          int tokensWithMultipleCommas = 0;
-          for (int i = 0; i < charsRead; i++) {
-            int nCommas = 0;
-            while (i < charsRead && (buffer[i] == ',' || Char.IsDigit(buffer[i]))) {
-              if (buffer[i] == ',') nCommas++;
-              i++;
-            }
-            if (nCommas > 2) tokensWithMultipleCommas++;
-          }
-          if (tokensWithMultipleCommas > 1) {
-            // English format (only integer values) with ',' as separator
-            numberFormat = NumberFormatInfo.InvariantInfo;
-            dateTimeFormatInfo = DateTimeFormatInfo.InvariantInfo;
-            separator = ',';
-          } else {
-            char[] disallowedSeparators = new char[] { ',' };
-            // German format (real values)
-            numberFormat = NumberFormatInfo.GetInstance(new CultureInfo("de-DE"));
-            dateTimeFormatInfo = DateTimeFormatInfo.GetInstance(new CultureInfo("de-DE"));
-            separator = POSSIBLE_SEPARATORS
-              .Except(disallowedSeparators)
-              .Where(c => OccurrencesOf(charCounts, c) > 10)
-              .OrderBy(c => -OccurrencesOf(charCounts, c))
-              .DefaultIfEmpty(' ')
-              .First();
-          }
-        } else {
-          // no points and no commas => English format
-          numberFormat = NumberFormatInfo.InvariantInfo;
-          dateTimeFormatInfo = DateTimeFormatInfo.InvariantInfo;
-          separator = POSSIBLE_SEPARATORS
-            .Where(c => OccurrencesOf(charCounts, c) > 10)
-            .OrderBy(c => -OccurrencesOf(charCounts, c))
-            .DefaultIfEmpty(' ')
-            .First();
-        }
-      }
-    }
-
-    private int OccurrencesOf(Dictionary<char, int> charCounts, char c) {
-      return charCounts.ContainsKey(c) ? charCounts[c] : 0;
-    }
-
-    #region tokenizer
-    internal enum TokenTypeEnum {
-      NewLine, Separator, String, Double, DateTime
-    }
-
-    internal class Token {
-      public TokenTypeEnum type;
-      public string stringValue;
-      public double doubleValue;
-      public DateTime dateTimeValue;
-
-      public Token(TokenTypeEnum type, string value) {
-        this.type = type;
-        stringValue = value;
-        dateTimeValue = DateTime.MinValue;
-        doubleValue = 0.0;
-      }
-
-      public override string ToString() {
-        return stringValue;
-      }
-    }
-
-
-    internal class Tokenizer {
-      private StreamReader reader;
-      private List<Token> tokens;
-      private NumberFormatInfo numberFormatInfo;
-      private DateTimeFormatInfo dateTimeFormatInfo;
-      private char separator;
-      private const string INTERNAL_SEPARATOR = "#";
-
-      private int currentLineNumber = 0;
-      public int CurrentLineNumber {
-        get { return currentLineNumber; }
-        private set { currentLineNumber = value; }
-      }
-      private string currentLine;
-      public string CurrentLine {
-        get { return currentLine; }
-        private set { currentLine = value; }
-      }
-
-      private Token newlineToken;
-      public Token NewlineToken {
-        get { return newlineToken; }
-        private set { newlineToken = value; }
-      }
-      private Token separatorToken;
-      public Token SeparatorToken {
-        get { return separatorToken; }
-        private set { separatorToken = value; }
-      }
-
-      public Tokenizer(StreamReader reader, NumberFormatInfo numberFormatInfo, DateTimeFormatInfo dateTimeFormatInfo, char separator) {
-        this.reader = reader;
-        this.numberFormatInfo = numberFormatInfo;
-        this.dateTimeFormatInfo = dateTimeFormatInfo;
-        this.separator = separator;
-        separatorToken = new Token(TokenTypeEnum.Separator, INTERNAL_SEPARATOR);
-        newlineToken = new Token(TokenTypeEnum.NewLine, Environment.NewLine);
-        tokens = new List<Token>();
-        ReadNextTokens();
-      }
-
-      private void ReadNextTokens() {
-        if (!reader.EndOfStream) {
-          CurrentLine = reader.ReadLine();
-          var newTokens = from str in Split(CurrentLine)
-                          let trimmedStr = str.Trim()
-                          where !string.IsNullOrEmpty(trimmedStr)
-                          select MakeToken(trimmedStr);
-
-          tokens.AddRange(newTokens);
-          tokens.Add(NewlineToken);
-          CurrentLineNumber++;
-        }
-      }
-
-      private IEnumerable<string> Split(string line) {
-        StringBuilder subStr = new StringBuilder();
-        foreach (char c in line) {
-          if (c == separator) {
-            yield return subStr.ToString();
-            subStr = new StringBuilder();
-            // all separator characters are transformed to the internally used separator character
-            yield return INTERNAL_SEPARATOR;
-          } else {
-            subStr.Append(c);
-          }
-        }
-        yield return subStr.ToString();
-      }
-
-      private Token MakeToken(string strToken) {
-        Token token = new Token(TokenTypeEnum.String, strToken);
-        if (strToken.Equals(INTERNAL_SEPARATOR)) {
-          return SeparatorToken;
-        } else if (double.TryParse(strToken, NumberStyles.Float, numberFormatInfo, out token.doubleValue)) {
-          token.type = TokenTypeEnum.Double;
-          return token;
-        } else if (DateTime.TryParse(strToken, dateTimeFormatInfo, DateTimeStyles.None, out token.dateTimeValue)) {
-          token.type = TokenTypeEnum.DateTime;
-          return token;
-        }
-
-        // couldn't parse the token as an int or float number  or datetime value so return a string token
-        return token;
-      }
-
-      public Token Peek() {
-        return tokens[0];
-      }
-
-      public Token Next() {
-        Token next = tokens[0];
-        tokens.RemoveAt(0);
-        if (tokens.Count == 0) {
-          ReadNextTokens();
-        }
-        return next;
-      }
-
-      public bool HasNext() {
-        return tokens.Count > 0 || !reader.EndOfStream;
-      }
-    }
-    #endregion
-
-    #region parsing
-    private void Parse() {
-      ParseVariableNames();
-      if (!tokenizer.HasNext()) Error("Couldn't parse data values. Probably because of incorrect number format (the parser expects english number format with a '.' as decimal separator).", "", tokenizer.CurrentLineNumber);
-      ParseValues();
-      if (rowValues.Count == 0) Error("Couldn't parse data values. Probably because of incorrect number format (the parser expects english number format with a '.' as decimal separator).", "", tokenizer.CurrentLineNumber);
-    }
-
-    private void ParseValues() {
-      while (tokenizer.HasNext()) {
-        if (tokenizer.Peek() == tokenizer.NewlineToken) {
-          tokenizer.Next();
-        } else {
-          List<object> row = new List<object>();
-          object value = NextValue(tokenizer);
-          row.Add(value);
-          while (tokenizer.HasNext() && tokenizer.Peek() == tokenizer.SeparatorToken) {
-            Expect(tokenizer.SeparatorToken);
-            row.Add(NextValue(tokenizer));
-          }
-          Expect(tokenizer.NewlineToken);
-          // all rows have to have the same number of values            
-          // the first row defines how many samples are needed
-          if (rowValues.Count > 0 && rowValues[0].Count != row.Count) {
-            Error("The first row of the dataset has " + rowValues[0].Count + " columns." +
-                  "\nLine " + tokenizer.CurrentLineNumber + " has " + row.Count + " columns.", "",
-                  tokenizer.CurrentLineNumber);
-          }
-          rowValues.Add(row);
-        }
-      }
-    }
-
-    private object NextValue(Tokenizer tokenizer) {
-      if (tokenizer.Peek() == tokenizer.SeparatorToken || tokenizer.Peek() == tokenizer.NewlineToken) return string.Empty;
-      Token current = tokenizer.Next();
-      if (current.type == TokenTypeEnum.Separator) {
-        return double.NaN;
-      } else if (current.type == TokenTypeEnum.String) {
-        return current.stringValue;
-      } else if (current.type == TokenTypeEnum.Double) {
-        return current.doubleValue;
-      } else if (current.type == TokenTypeEnum.DateTime) {
-        return current.dateTimeValue;
-      }
-      // found an unexpected token => throw error 
-      Error("Unexpected token.", current.stringValue, tokenizer.CurrentLineNumber);
-      // this line is never executed because Error() throws an exception
-      throw new InvalidOperationException();
-    }
-
-    private void ParseVariableNames() {
-      //if first token is double no variables names are given
-      if (tokenizer.Peek().type == TokenTypeEnum.Double) return;
-
-      // the first line must contain variable names
-      List<Token> tokens = new List<Token>();
-      Token valueToken;
-      valueToken = tokenizer.Next();
-      tokens.Add(valueToken);
-      while (tokenizer.HasNext() && tokenizer.Peek() == tokenizer.SeparatorToken) {
-        Expect(tokenizer.SeparatorToken);
-        valueToken = tokenizer.Next();
-        if (valueToken != tokenizer.NewlineToken) {
-          tokens.Add(valueToken);
-        }
-      }
-      if (valueToken != tokenizer.NewlineToken) {
-        Expect(tokenizer.NewlineToken);
-      }
-      variableNames = tokens.Select(x => x.stringValue.Trim()).ToList();
-    }
-
-    private void Expect(Token expectedToken) {
-      Token actualToken = tokenizer.Next();
-      if (actualToken != expectedToken) {
-        Error("Expected: " + expectedToken, actualToken.stringValue, tokenizer.CurrentLineNumber);
-      }
-    }
-
-    private void Error(string message, string token, int lineNumber) {
-      throw new DataFormatException("Error while parsing.\n" + message, token, lineNumber);
-    }
-    #endregion
-
-    [Serializable]
-    private class DataFormatException : Exception {
-      private int line;
-      public int Line {
-        get { return line; }
-      }
-      private string token;
-      public string Token {
-        get { return token; }
-      }
-      public DataFormatException(string message, string token, int line)
-        : base(message + "\nToken: " + token + " (line: " + line + ")") {
-        this.token = token;
-        this.line = line;
-      }
-
-      public DataFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { }
-    }
-  }
-}
