Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 8486)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 8487)
@@ -278,4 +278,10 @@
       <DependentUpon>RegressionSolutionView.cs</DependentUpon>
     </Compile>
+    <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.Designer.cs">
+      <DependentUpon>TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs</DependentUpon>
+    </Compile>
     <None Include="HeuristicLab.snk" />
     <None Include="Plugin.cs.frame" />
@@ -300,7 +306,5 @@
     </BootstrapperPackage>
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="TimeSeriesPrognosis\" />
-  </ItemGroup>
+  <ItemGroup />
   <ItemGroup>
     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.Designer.cs	(revision 8486)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.Designer.cs	(revision 8487)
@@ -25,47 +25,6 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
-      System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
-      System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
-      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
-      this.label1 = new System.Windows.Forms.Label();
-      this.cmbSamples = new System.Windows.Forms.ComboBox();
       ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
       this.SuspendLayout();
-      // 
-      // chart
-      // 
-      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Left)
-            | System.Windows.Forms.AnchorStyles.Right)));
-      chartArea1.Name = "ChartArea1";
-      this.chart.ChartAreas.Add(chartArea1);
-      legend1.Alignment = System.Drawing.StringAlignment.Center;
-      legend1.Docking = System.Windows.Forms.DataVisualization.Charting.Docking.Top;
-      legend1.Name = "Legend1";
-      this.chart.Legends.Add(legend1);
-      this.chart.Location = new System.Drawing.Point(6, 28);
-      this.chart.Name = "chart";
-      this.chart.Size = new System.Drawing.Size(366, 202);
-      this.chart.TabIndex = 0;
-      this.chart.Text = "chart";
-      // 
-      // label1
-      // 
-      this.label1.AutoSize = true;
-      this.label1.Location = new System.Drawing.Point(3, 6);
-      this.label1.Name = "label1";
-      this.label1.Size = new System.Drawing.Size(47, 13);
-      this.label1.TabIndex = 4;
-      this.label1.Text = "Samples";
-      // 
-      // cmbSamples
-      // 
-      this.cmbSamples.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-      this.cmbSamples.FormattingEnabled = true;
-      this.cmbSamples.Location = new System.Drawing.Point(56, 3);
-      this.cmbSamples.Name = "cmbSamples";
-      this.cmbSamples.Size = new System.Drawing.Size(121, 21);
-      this.cmbSamples.TabIndex = 3;
-      this.cmbSamples.SelectedIndexChanged += new System.EventHandler(this.cmbSamples_SelectedIndexChanged);
       // 
       // TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView
@@ -73,9 +32,5 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.label1);
-      this.Controls.Add(this.cmbSamples);
-      this.Controls.Add(this.chart);
       this.Name = "TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView";
-      this.Size = new System.Drawing.Size(366, 230);
       ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
       this.ResumeLayout(false);
@@ -85,8 +40,4 @@
 
     #endregion
-
-    protected HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
-    protected System.Windows.Forms.Label label1;
-    protected System.Windows.Forms.ComboBox cmbSamples;
   }
 }
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs	(revision 8486)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs	(revision 8487)
@@ -20,9 +20,7 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Windows.Forms;
-using System.Windows.Forms.DataVisualization.Charting;
 using HeuristicLab.MainForm;
 using HeuristicLab.MainForm.WindowsForms;
@@ -30,31 +28,10 @@
   [View("Error Characteristics Curve")]
   [Content(typeof(ITimeSeriesPrognosisSolution))]
-  public partial class TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView : DataAnalysisSolutionEvaluationView {
-    protected const string TrainingSamples = "Training";
-    protected const string TestSamples = "Test";
-    protected const string AllSamples = "All Samples";
+  public partial class TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView : RegressionSolutionErrorCharacteristicsCurveView {
+
 
     public TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView()
       : base() {
       InitializeComponent();
-
-      cmbSamples.Items.Add(TrainingSamples);
-      cmbSamples.Items.Add(TestSamples);
-      cmbSamples.Items.Add(AllSamples);
-
-      cmbSamples.SelectedIndex = 0;
-
-      chart.CustomizeAllChartAreas();
-      chart.ChartAreas[0].AxisX.Title = "Absolute Error";
-      chart.ChartAreas[0].AxisX.Minimum = 0.0;
-      chart.ChartAreas[0].AxisX.Maximum = 1.0;
-      chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
-      chart.ChartAreas[0].CursorX.Interval = 0.01;
-
-      chart.ChartAreas[0].AxisY.Title = "Number of Samples";
-      chart.ChartAreas[0].AxisY.Minimum = 0.0;
-      chart.ChartAreas[0].AxisY.Maximum = 1.0;
-      chart.ChartAreas[0].AxisY.MajorGrid.Interval = 0.2;
-      chart.ChartAreas[0].CursorY.Interval = 0.01;
     }
 
@@ -63,5 +40,5 @@
       set { base.Content = value; }
     }
-    public ITimeSeriesPrognosisProblemData ProblemData {
+    public new ITimeSeriesPrognosisProblemData ProblemData {
       get {
         if (Content == null) return null;
@@ -70,157 +47,19 @@
     }
 
-    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 UpdateChart() {
+      base.UpdateChart();
+      if (Content == null) return;
+      var movingAverageModel = new TimeSeriesPrognosisMovingAverageModel(10, Content.ProblemData.TargetVariable).CreateTimeSeriesPrognosisSolution(ProblemData);
+      movingAverageModel.Name = "Moving average Model";
+      AddRegressionSolution(movingAverageModel);
 
-    protected virtual void Content_ModelChanged(object sender, EventArgs e) {
-      if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_ModelChanged, sender, e);
-      else UpdateChart();
-    }
-    protected virtual void Content_ProblemDataChanged(object sender, EventArgs e) {
-      if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_ProblemDataChanged, sender, e);
-      else {
-        UpdateChart();
-      }
-    }
-    protected override void OnContentChanged() {
-      base.OnContentChanged();
-      UpdateChart();
-    }
-
-    protected virtual void UpdateChart() {
-      chart.Series.Clear();
-      chart.Annotations.Clear();
-      if (Content == null) return;
-
-      var originalValues = GetOriginalValues();
-      var meanModelEstimatedValues = GetMeanModelEstimatedValues(originalValues);
-      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);
-      chart.Series.Add(meanModelSeries);
-
-      AddTimeSeriesPrognosisSolution(Content);
-    }
-
-    protected void AddTimeSeriesPrognosisSolution(ITimeSeriesPrognosisSolution solution) {
-      if (chart.Series.Any(s => s.Name == solution.Name)) return;
-
-      Series solutionSeries = new Series(solution.Name);
-      solutionSeries.Tag = solution;
-      solutionSeries.ChartType = SeriesChartType.FastLine;
-      var estimatedValues = GetResiduals(GetOriginalValues(), GetPrognosedValues(solution));
-      UpdateSeries(estimatedValues, solutionSeries);
-      solutionSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(solutionSeries);
-      chart.Series.Add(solutionSeries);
-    }
-
-    protected void UpdateSeries(List<double> residuals, Series series) {
-      series.Points.Clear();
-      residuals.Sort();
-
-      series.Points.AddXY(0, 0);
-      for (int i = 0; i < residuals.Count; i++) {
-        var point = new DataPoint();
-        if (residuals[i] > chart.ChartAreas[0].AxisX.Maximum) {
-          point.XValue = chart.ChartAreas[0].AxisX.Maximum;
-          point.YValues[0] = ((double)i) / residuals.Count;
-          point.ToolTip = "Error: " + point.XValue + "\n" + "Samples: " + point.YValues[0];
-          series.Points.Add(point);
-          break;
-        }
-
-        point.XValue = residuals[i];
-        point.YValues[0] = ((double)i + 1) / residuals.Count;
-        point.ToolTip = "Error: " + point.XValue + "\n" + "Samples: " + point.YValues[0];
-        series.Points.Add(point);
-      }
-
-      if (series.Points.Last().XValue < chart.ChartAreas[0].AxisX.Maximum) {
-        var point = new DataPoint();
-        point.XValue = chart.ChartAreas[0].AxisX.Maximum;
-        point.YValues[0] = 1;
-        point.ToolTip = "Error: " + point.XValue + "\n" + "Samples: " + point.YValues[0];
-        series.Points.Add(point);
-      }
-    }
-
-    protected IEnumerable<double> GetOriginalValues() {
-      IEnumerable<double> originalValues;
-      switch (cmbSamples.SelectedItem.ToString()) {
-        case TrainingSamples:
-          originalValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
-          break;
-        case TestSamples:
-          originalValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
-          break;
-        case AllSamples:
-          originalValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable);
-          break;
-        default:
-          throw new NotSupportedException();
-      }
-      return originalValues;
-    }
-
-    protected IEnumerable<double> GetPrognosedValues(ITimeSeriesPrognosisSolution solution) {
-      IEnumerable<double> prognosedValues;
-      switch (cmbSamples.SelectedItem.ToString()) {
-        case TrainingSamples:
-          prognosedValues = solution.PrognosedTrainingValues;
-          break;
-        case TestSamples:
-          prognosedValues = solution.PrognosedTestValues;
-          break;
-        case AllSamples:
-          prognosedValues = solution.PrognosedValues;
-          break;
-        default:
-          throw new NotSupportedException();
-      }
-      return prognosedValues;
-    }
-
-    protected IEnumerable<double> GetMeanModelEstimatedValues(IEnumerable<double> originalValues) {
-      double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average();
-      return Enumerable.Repeat(averageTrainingTarget, originalValues.Count());
-    }
-
-    protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) {
-      return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)).ToList();
-    }
-
-    private double CalculateAreaOverCurve(Series series) {
-      if (series.Points.Count < 1) throw new ArgumentException("Could not calculate area under curve if less than 1 data points were given.");
-
-      double auc = 0.0;
-      for (int i = 1; i < series.Points.Count; i++) {
-        double width = series.Points[i].XValue - series.Points[i - 1].XValue;
-        double y1 = 1 - series.Points[i - 1].YValues[0];
-        double y2 = 1 - series.Points[i].YValues[0];
-
-        auc += (y1 + y2) * width / 2;
-      }
-
-      return auc;
-    }
-
-    protected void cmbSamples_SelectedIndexChanged(object sender, EventArgs e) {
-      if (InvokeRequired) Invoke((Action<object, EventArgs>)cmbSamples_SelectedIndexChanged, sender, e);
-      else UpdateChart();
+      //AR1 model
+      double alpha, beta;
+      OnlineCalculatorError errorState;
+      IEnumerable<double> trainingStartValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Select(r => r - 1).Where(r => r > 0)).ToList();
+      OnlineLinearScalingParameterCalculator.Calculate(ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Where(x => x > 0)), trainingStartValues, out alpha, out beta, out errorState);
+      var AR1model = new TimeSeriesPrognosisAutoRegressiveModel(ProblemData.TargetVariable, new double[] { beta }, alpha).CreateTimeSeriesPrognosisSolution(ProblemData);
+      AR1model.Name = "AR(1) Model";
+      AddRegressionSolution(AR1model);
     }
   }
Index: anches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionLineChartView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionLineChartView.Designer.cs	(revision 8486)
+++ 	(revision )
@@ -1,130 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 TimeSeriesPrognosisSolutionLineChartView {
-    /// <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();
-      this.targetVariableComboBox = new System.Windows.Forms.ComboBox();
-      this.label = new System.Windows.Forms.Label();
-      this.prognosedValuesCheckbox = new System.Windows.Forms.CheckBox();
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
-      this.SuspendLayout();
-      // 
-      // chart
-      // 
-      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-      chartArea1.Name = "ChartArea";
-      this.chart.ChartAreas.Add(chartArea1);
-      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, 31);
-      this.chart.Name = "chart";
-      this.chart.Size = new System.Drawing.Size(609, 194);
-      this.chart.TabIndex = 0;
-      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
-      this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Chart_MouseDoubleClick);
-      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
-      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
-      // 
-      // targetVariableComboBox
-      // 
-      this.targetVariableComboBox.FormattingEnabled = true;
-      this.targetVariableComboBox.Location = new System.Drawing.Point(91, 4);
-      this.targetVariableComboBox.Name = "targetVariableComboBox";
-      this.targetVariableComboBox.Size = new System.Drawing.Size(173, 21);
-      this.targetVariableComboBox.TabIndex = 1;
-      this.targetVariableComboBox.SelectedIndexChanged += new System.EventHandler(this.targetVariableComboBox_SelectedIndexChanged);
-      // 
-      // label
-      // 
-      this.label.AutoSize = true;
-      this.label.Location = new System.Drawing.Point(4, 7);
-      this.label.Name = "label";
-      this.label.Size = new System.Drawing.Size(81, 13);
-      this.label.TabIndex = 2;
-      this.label.Text = "Target variable:";
-      // 
-      // prognosedValuesCheckbox
-      // 
-      this.prognosedValuesCheckbox.AutoSize = true;
-      this.prognosedValuesCheckbox.Checked = true;
-      this.prognosedValuesCheckbox.CheckState = System.Windows.Forms.CheckState.Checked;
-      this.prognosedValuesCheckbox.Location = new System.Drawing.Point(271, 6);
-      this.prognosedValuesCheckbox.Name = "prognosedValuesCheckbox";
-      this.prognosedValuesCheckbox.Size = new System.Drawing.Size(112, 17);
-      this.prognosedValuesCheckbox.TabIndex = 3;
-      this.prognosedValuesCheckbox.Text = "Prognosed Values";
-      this.prognosedValuesCheckbox.UseVisualStyleBackColor = true;
-      this.prognosedValuesCheckbox.CheckedChanged += new System.EventHandler(this.prognosedValuesCheckbox_CheckedChanged);
-      // 
-      // TimeSeriesPrognosisSolutionLineChartView
-      // 
-      this.AllowDrop = true;
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.prognosedValuesCheckbox);
-      this.Controls.Add(this.label);
-      this.Controls.Add(this.targetVariableComboBox);
-      this.Controls.Add(this.chart);
-      this.Name = "TimeSeriesPrognosisSolutionLineChartView";
-      this.Size = new System.Drawing.Size(609, 225);
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
-      this.ResumeLayout(false);
-      this.PerformLayout();
-
-    }
-
-    #endregion
-
-    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
-    private System.Windows.Forms.ComboBox targetVariableComboBox;
-    private System.Windows.Forms.Label label;
-    private System.Windows.Forms.CheckBox prognosedValuesCheckbox;
-  }
-}
Index: anches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionLineChartView.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionLineChartView.cs	(revision 8486)
+++ 	(revision )
@@ -1,293 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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.Common;
-using HeuristicLab.MainForm;
-using HeuristicLab.MainForm.WindowsForms;
-
-namespace HeuristicLab.Problems.DataAnalysis.Views {
-  [View("Line Chart")]
-  [Content(typeof(ITimeSeriesPrognosisSolution))]
-  public partial class TimeSeriesPrognosisSolutionLineChartView : DataAnalysisSolutionEvaluationView {
-    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
-    private const string PROGNOSEDVALUES_TRAINING_SERIES_NAME = "Prognosed Values (training)";
-    private const string PROGNOSEDVALUES_TEST_SERIES_NAME = "Prognosed Values (test)";
-    private const string PROGNOSEDVALUES_ALL_SERIES_NAME = "Prognosed Values (all samples)";
-    private int testPrognosisStart;
-
-    public new ITimeSeriesPrognosisSolution Content {
-      get { return (ITimeSeriesPrognosisSolution)base.Content; }
-      set { base.Content = value; }
-    }
-
-    public TimeSeriesPrognosisSolutionLineChartView()
-      : base() {
-      InitializeComponent();
-      //configure axis
-      this.chart.CustomizeAllChartAreas();
-      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
-      this.chart.ChartAreas[0].CursorX.Interval = 1;
-      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
-      this.chart.ChartAreas[0].AxisX.IsStartedFromZero = true;
-
-      this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
-      this.chart.ChartAreas[0].CursorY.Interval = 0.1;
-      this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
-
-      this.chart.SuppressExceptions = false;
-    }
-
-    private void RedrawChart() {
-      this.chart.Series.Clear();
-      if (Content != null) {
-        this.chart.ChartAreas[0].AxisX.Minimum = 0;
-        this.chart.ChartAreas[0].AxisX.Maximum = Content.ProblemData.Dataset.Rows - 1;
-        string targetVariable = Content.ProblemData.TargetVariable;
-
-        this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);
-        this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = targetVariable;
-        this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
-        AddDataPoints(chart.Series[TARGETVARIABLE_SERIES_NAME].Points, Enumerable.Range(0, Content.ProblemData.Dataset.Rows), Content.ProblemData.Dataset.GetDoubleValues(targetVariable));
-        //this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray(),
-        //  Content.ProblemData.Dataset.GetDoubleValues(targetVariable).ToArray());
-
-        this.chart.Series.Add(PROGNOSEDVALUES_TRAINING_SERIES_NAME);
-        this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].LegendText = PROGNOSEDVALUES_TRAINING_SERIES_NAME;
-        this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].ChartType = SeriesChartType.FastLine;
-        if (prognosedValuesCheckbox.Checked) {
-          //this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Points
-          //  .DataBindXY(Content.ProblemData.TrainingIndices.ToArray(),
-          //              Content.GetPrognosedValues(Content.ProblemData.TrainingIndices.Take(1), Content.ProblemData.TrainingIndices.Count().ToEnumerable()).First().ToArray());
-          AddDataPoints(chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Points, Content.ProblemData.TrainingIndices, Content.GetPrognosedValues(Content.ProblemData.TrainingIndices.Take(1), Content.ProblemData.TrainingIndices.Count().ToEnumerable()).First());
-        } else {
-          //this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Points
-          //  .DataBindXY(Content.ProblemData.TrainingIndices.ToArray(),
-          //              Content.GetPrognosedValues(Content.ProblemData.TrainingIndices, Enumerable.Repeat(1, Content.ProblemData.TrainingIndices.Count())).SelectMany(x => x).ToArray());
-          AddDataPoints(chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Points, Content.ProblemData.TrainingIndices, Content.GetPrognosedValues(Content.ProblemData.TrainingIndices, Enumerable.Repeat(1, Content.ProblemData.TrainingIndices.Count())).SelectMany(x => x));
-        }
-        this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Tag = Content;
-        this.chart.DataManipulator.InsertEmptyPoints(1, IntervalType.Number, PROGNOSEDVALUES_TRAINING_SERIES_NAME);
-        this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.BorderWidth = 0;
-        this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.MarkerStyle = MarkerStyle.None;
-
-
-        this.chart.Series.Add(PROGNOSEDVALUES_TEST_SERIES_NAME);
-        this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].LegendText = PROGNOSEDVALUES_TEST_SERIES_NAME;
-        this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].ChartType = SeriesChartType.FastLine;
-        if (prognosedValuesCheckbox.Checked) {
-          //this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Points
-          //  .DataBindXY(Content.ProblemData.TestIndices.ToArray(),
-          //              Content.GetPrognosedValues(Content.ProblemData.TestIndices.Take(1), Content.ProblemData.TestIndices.Count().ToEnumerable()).First().ToArray());
-          AddDataPoints(chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Points, Content.ProblemData.TestIndices, Content.GetPrognosedValues(Content.ProblemData.TestIndices.Take(1), Content.ProblemData.TestIndices.Count().ToEnumerable()).First());
-        } else {
-          //this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Points
-          //  .DataBindXY(Content.ProblemData.TestIndices.ToArray(),
-          //              Content.GetPrognosedValues(Content.ProblemData.TestIndices, Enumerable.Repeat(1, Content.ProblemData.TestIndices.Count())).SelectMany(x => x).ToArray());
-          AddDataPoints(chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Points, Content.ProblemData.TestIndices, Content.GetPrognosedValues(Content.ProblemData.TestIndices, Enumerable.Repeat(1, Content.ProblemData.TestIndices.Count())).SelectMany(x => x));
-        }
-        this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Tag = Content;
-        UpdateCursorInterval();
-        this.UpdateStripLines();
-      }
-      chart.Refresh();
-    }
-
-    private void AddDataPoints(DataPointCollection points, IEnumerable<int> xValues, IEnumerable<double> yValues) {
-      var xValuesEnumerator = xValues.GetEnumerator();
-      var yValuesEnumerator = yValues.GetEnumerator();
-
-      while (xValuesEnumerator.MoveNext() & yValuesEnumerator.MoveNext()) {
-        var xValue = xValuesEnumerator.Current;
-        var yValue = yValuesEnumerator.Current;
-
-        if (yValue < (double)decimal.MaxValue && yValue > (double)decimal.MinValue) {
-          DataPoint dataPoint = new DataPoint(xValue, yValue);
-          points.Add(dataPoint);
-        }
-      }
-    }
-
-    private void UpdateCursorInterval() {
-      var estimatedValues = this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
-      var targetValues = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
-      double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min();
-      double targetValuesRange = targetValues.Max() - targetValues.Min();
-      double interestingValuesRange = Math.Min(Math.Max(targetValuesRange, 1.0), Math.Max(estimatedValuesRange, 1.0));
-      double digits = (int)Math.Log10(interestingValuesRange) - 3;
-      double yZoomInterval = Math.Max(Math.Pow(10, digits), 10E-5);
-      this.chart.ChartAreas[0].CursorY.Interval = yZoomInterval;
-    }
-
-    #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 targetVariableComboBox_SelectedIndexChanged(object sender, EventArgs e) {
-      RedrawChart();
-    }
-    private void prognosedValuesCheckbox_CheckedChanged(object sender, EventArgs e) {
-      RedrawChart();
-    }
-
-    private void Chart_MouseDoubleClick(object sender, MouseEventArgs e) {
-      HitTestResult result = chart.HitTest(e.X, e.Y);
-      if (result.ChartArea != null && (result.ChartElementType == ChartElementType.PlottingArea ||
-                                       result.ChartElementType == ChartElementType.Gridlines) ||
-                                       result.ChartElementType == ChartElementType.StripLines) {
-        foreach (var axis in result.ChartArea.Axes)
-          axis.ScaleView.ZoomReset(int.MaxValue);
-      }
-    }
-    #endregion
-
-    private void UpdateStripLines() {
-      this.chart.ChartAreas[0].AxisX.StripLines.Clear();
-
-      int[] attr = new int[Content.ProblemData.Dataset.Rows + 1]; // add a virtual last row that is again empty to simplify loop further down
-      foreach (var row in Content.ProblemData.TrainingIndices) {
-        attr[row] += 1;
-      }
-      foreach (var row in Content.ProblemData.TestIndices) {
-        attr[row] += 2;
-      }
-      int start = 0;
-      int curAttr = attr[start];
-      for (int row = 0; row < attr.Length; row++) {
-        if (attr[row] != curAttr) {
-          switch (curAttr) {
-            case 0: break;
-            case 1:
-              this.CreateAndAddStripLine("Training", start, row, Color.FromArgb(40, Color.Green), Color.Transparent);
-              break;
-            case 2:
-              this.CreateAndAddStripLine("Test", start, row, Color.FromArgb(40, Color.Red), Color.Transparent);
-              break;
-            case 3:
-              this.CreateAndAddStripLine("Training and Test", start, row, Color.FromArgb(40, Color.Green), Color.FromArgb(40, Color.Red), ChartHatchStyle.WideUpwardDiagonal);
-              break;
-            default: throw new NotSupportedException();
-          }
-          curAttr = attr[row];
-          start = row;
-        }
-      }
-    }
-
-    private void CreateAndAddStripLine(string title, int start, int end, Color color, Color secondColor, ChartHatchStyle hatchStyle = ChartHatchStyle.None) {
-      StripLine stripLine = new StripLine();
-      stripLine.BackColor = color;
-      stripLine.BackSecondaryColor = secondColor;
-      stripLine.BackHatchStyle = hatchStyle;
-      stripLine.Text = title;
-      stripLine.Font = new Font("Times New Roman", 12, FontStyle.Bold);
-      // strip range is [start .. end] inclusive, but we evaluate [start..end[ (end is exclusive)
-      // the strip should be by one longer (starting at start - 0.5 and ending at end + 0.5)
-      stripLine.StripWidth = end - start;
-      stripLine.IntervalOffset = start - 0.5; // start slightly to the left of the first point to clearly indicate the first point in the partition
-      this.chart.ChartAreas[0].AxisX.StripLines.Add(stripLine);
-    }
-
-    private void ToggleSeriesData(Series series) {
-      if (series.Points.Count > 0) {  //checks if series is shown
-        if (this.chart.Series.Any(s => s != series && s.Points.Count > 0)) {
-          series.Points.Clear();
-        }
-      } else if (Content != null) {
-        IEnumerable<int> Indices = null;
-        IEnumerable<double> predictedValues = null;
-
-        switch (series.Name) {
-          case PROGNOSEDVALUES_TRAINING_SERIES_NAME:
-            Indices = Content.ProblemData.TrainingIndices.ToArray();
-            predictedValues = Content.GetPrognosedValues(Content.ProblemData.TrainingIndices.Take(1), Content.ProblemData.TrainingPartition.Size.ToEnumerable()).First();
-            break;
-          case PROGNOSEDVALUES_TEST_SERIES_NAME:
-            testPrognosisStart = Content.ProblemData.TestPartition.Start;
-            Indices = Content.ProblemData.TestIndices.ToArray();
-            predictedValues = Content.GetPrognosedValues(Content.ProblemData.TestIndices.Take(1), Content.ProblemData.TestPartition.Size.ToEnumerable()).First();
-            break;
-        }
-        series.Points.DataBindXY(Indices, predictedValues);
-        chart.DataManipulator.InsertEmptyPoints(1, IntervalType.Number, series.Name);
-        chart.Legends[series.Legend].ForeColor = Color.Black;
-        UpdateCursorInterval();
-        chart.Refresh();
-      }
-    }
-
-    private void chart_MouseMove(object sender, MouseEventArgs e) {
-      //HitTestResult result = chart.HitTest(e.X, e.Y);
-      //if (result.ChartElementType == ChartElementType.LegendItem && result.Series.Name != TARGETVARIABLE_SERIES_NAME)
-      //  Cursor = Cursors.Hand;
-      //else
-      //  Cursor = Cursors.Default;
-    }
-
-    private void chart_MouseDown(object sender, MouseEventArgs e) {
-      //HitTestResult result = chart.HitTest(e.X, e.Y);
-      //if (result.ChartElementType == ChartElementType.LegendItem && result.Series.Name != TARGETVARIABLE_SERIES_NAME) {
-      //  ToggleSeriesData(result.Series);
-      //} else if (result.ChartElementType == ChartElementType.Axis || result.ChartElementType == ChartElementType.AxisLabels ||
-      //  result.ChartElementType == ChartElementType.TickMarks) {
-      //  chart.ChartAreas[0].CursorX.SetCursorPixelPosition(new Point(e.X, e.Y), true);
-      //  int pos = (int)Math.Round(chart.ChartAreas[0].CursorX.Position);
-      //  if (pos >= Content.ProblemData.TestPartition.Start && pos < Content.ProblemData.TestPartition.End) {
-      //    testPrognosisStart = pos;
-      //    RedrawChart();
-      //  }
-      //}
-    }
-
-    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
-      if (chart.Series.Count != 4) return;
-      e.LegendItems[0].Cells[1].ForeColor = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
-      e.LegendItems[1].Cells[1].ForeColor = this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
-      e.LegendItems[2].Cells[1].ForeColor = this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
-      e.LegendItems[3].Cells[1].ForeColor = this.chart.Series[PROGNOSEDVALUES_ALL_SERIES_NAME].Points.Count == 0 ? Color.Gray : Color.Black;
-    }
-  }
-}
Index: anches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionPrognosedValuesView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionPrognosedValuesView.Designer.cs	(revision 8486)
+++ 	(revision )
@@ -1,62 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 TimeSeriesPrognosisSolutionEstimatedValuesView {
-    /// <summary> 
-    /// Required designer variable.
-    /// </summary>
-    private System.ComponentModel.IContainer components = null;
-
-    /// <summary> 
-    /// Clean up any resources being used.
-    /// </summary>
-    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-    protected override void Dispose(bool disposing) {
-      if (disposing && (components != null)) {
-        components.Dispose();
-      }
-      base.Dispose(disposing);
-    }
-
-    #region Component Designer generated code
-
-    /// <summary> 
-    /// Required method for Designer support - do not modify 
-    /// the contents of this method with the code editor.
-    /// </summary>
-    private void InitializeComponent() {
-      this.SuspendLayout();
-      // 
-      // EstimatedValuesView
-      // 
-      this.AllowDrop = true;
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Name = "EstimatedValuesView";
-      this.Size = new System.Drawing.Size(310, 285);
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-  }
-}
Index: anches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionPrognosedValuesView.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionPrognosedValuesView.cs	(revision 8486)
+++ 	(revision )
@@ -1,131 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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.Linq;
-using System.Windows.Forms;
-using HeuristicLab.Common;
-using HeuristicLab.Data;
-using HeuristicLab.Data.Views;
-using HeuristicLab.MainForm;
-using HeuristicLab.MainForm.WindowsForms;
-
-namespace HeuristicLab.Problems.DataAnalysis.Views {
-  [View("Estimated Values")]
-  [Content(typeof(ITimeSeriesPrognosisSolution))]
-  public partial class TimeSeriesPrognosisSolutionEstimatedValuesView : DataAnalysisSolutionEvaluationView {
-    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
-    private const string PROGNOSEDVALUES_TRAINING_SERIES_NAME = "Prognosed Values (training)";
-    private const string PROGNOSEDVALUES_TEST_SERIES_NAME = "Prognosed Values (test)";
-
-    public new ITimeSeriesPrognosisSolution Content {
-      get { return (ITimeSeriesPrognosisSolution)base.Content; }
-      set {
-        base.Content = value;
-      }
-    }
-
-    private StringConvertibleMatrixView matrixView;
-
-    public TimeSeriesPrognosisSolutionEstimatedValuesView()
-      : base() {
-      InitializeComponent();
-      matrixView = new StringConvertibleMatrixView();
-      matrixView.ShowRowsAndColumnsTextBox = false;
-      matrixView.ShowStatisticalInformation = false;
-      matrixView.Dock = DockStyle.Fill;
-      this.Controls.Add(matrixView);
-    }
-
-    #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);
-    }
-
-    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);
-        return;
-      }
-      if (Content == null) return;
-
-      var targetVariable = Content.ProblemData.TargetVariable;
-      StringMatrix matrix = null;
-      List<string> columnNames = new List<string>();
-      columnNames.Add("Id");
-
-      string[,] values = new string[Content.ProblemData.Dataset.Rows, 4];
-      var prognosedTraining = Content.GetPrognosedValues(Content.ProblemData.TrainingIndices.Take(1), Content.ProblemData.TrainingPartition.Size.ToEnumerable()).First();
-      var prognosedTest = Content.GetPrognosedValues(Content.ProblemData.TestIndices.Take(1), Content.ProblemData.TestPartition.Size.ToEnumerable()).First();
-      double[] target = Content.ProblemData.Dataset.GetDoubleValues(targetVariable).ToArray();
-
-
-      foreach (var row in Enumerable.Range(0, Content.ProblemData.Dataset.Rows)) {
-        values[row, 0] = row.ToString();
-        values[row, 1] = target[row].ToString();
-      }
-
-      var rowsEnumerator = Content.ProblemData.TrainingIndices.GetEnumerator();
-      var prognosisEnumerator = prognosedTraining.GetEnumerator();
-      while (rowsEnumerator.MoveNext() & prognosisEnumerator.MoveNext()) {
-        var row = rowsEnumerator.Current;
-        var prognosis = prognosisEnumerator.Current;
-        values[row, 2] = prognosis.ToString();
-      }
-
-      rowsEnumerator = Content.ProblemData.TestIndices.GetEnumerator();
-      prognosisEnumerator = prognosedTest.GetEnumerator();
-      while (rowsEnumerator.MoveNext() & prognosisEnumerator.MoveNext()) {
-        var row = rowsEnumerator.Current;
-        var prognosis = prognosisEnumerator.Current;
-        values[row, 3] = prognosis.ToString();
-      }
-
-      columnNames.AddRange(new string[] { targetVariable + "(actual)", targetVariable + "(training)", targetVariable + "(test)" });
-      matrix = new StringMatrix(values);
-      matrix.ColumnNames = columnNames.ToArray();
-      matrix.SortableView = true;
-      matrixView.Content = matrix;
-    }
-    #endregion
-  }
-}
Index: anches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionScatterPlotView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionScatterPlotView.Designer.cs	(revision 8486)
+++ 	(revision )
@@ -1,87 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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 TimeSeriesPrognosisSolutionScatterPlotView {
-    /// <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(527, 392);
-      this.chart.TabIndex = 1;
-      this.chart.PostPaint += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.ChartPaintEventArgs>(this.chart_PostPaint);
-      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);
-      // 
-      // TimeSeriesPrognosisSolutionScatterPlotView
-      // 
-      this.AllowDrop = true;
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.Controls.Add(this.chart);
-      this.Name = "TimeSeriesPrognosisSolutionScatterPlotView";
-      this.Size = new System.Drawing.Size(527, 392);
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
-  }
-}
Index: anches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionScatterPlotView.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionScatterPlotView.cs	(revision 8486)
+++ 	(revision )
@@ -1,246 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 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("Scatter Plot")]
-  [Content(typeof(ITimeSeriesPrognosisSolution))]
-  public partial class TimeSeriesPrognosisSolutionScatterPlotView : DataAnalysisSolutionEvaluationView {
-    private const string ALL_SERIES = "All samples";
-    private const string TRAINING_SERIES = "Training samples";
-    private const string TEST_SERIES = "Test samples";
-
-    public new ITimeSeriesPrognosisSolution Content {
-      get { return (ITimeSeriesPrognosisSolution)base.Content; }
-      set { base.Content = value; }
-    }
-
-    public TimeSeriesPrognosisSolutionScatterPlotView()
-      : base() {
-      InitializeComponent();
-
-      this.chart.Series.Add(ALL_SERIES);
-      this.chart.Series[ALL_SERIES].LegendText = ALL_SERIES;
-      this.chart.Series[ALL_SERIES].ChartType = SeriesChartType.FastPoint;
-
-      this.chart.Series.Add(TRAINING_SERIES);
-      this.chart.Series[TRAINING_SERIES].LegendText = TRAINING_SERIES;
-      this.chart.Series[TRAINING_SERIES].ChartType = SeriesChartType.FastPoint;
-      this.chart.Series[TRAINING_SERIES].Points.Add(1.0);
-
-      this.chart.Series.Add(TEST_SERIES);
-      this.chart.Series[TEST_SERIES].LegendText = TEST_SERIES;
-      this.chart.Series[TEST_SERIES].ChartType = SeriesChartType.FastPoint;
-
-      this.chart.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
-      this.chart.AxisViewChanged += new EventHandler<System.Windows.Forms.DataVisualization.Charting.ViewEventArgs>(chart_AxisViewChanged);
-
-      //configure axis 
-      this.chart.CustomizeAllChartAreas();
-      this.chart.ChartAreas[0].AxisX.Title = "Prognosed Values";
-      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
-      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
-      this.chart.ChartAreas[0].CursorX.Interval = 1;
-      this.chart.ChartAreas[0].CursorY.Interval = 1;
-
-      this.chart.ChartAreas[0].AxisY.Title = "Target Values";
-      this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
-      this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
-      this.chart.ChartAreas[0].AxisY.IsStartedFromZero = true;
-    }
-
-    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);
-    }
-
-
-    private void Content_ProblemDataChanged(object sender, EventArgs e) {
-      UpdateChart();
-    }
-    private void Content_ModelChanged(object sender, EventArgs e) {
-      UpdateSeries();
-    }
-
-    protected override void OnContentChanged() {
-      base.OnContentChanged();
-      UpdateChart();
-    }
-
-    private void UpdateChart() {
-      if (InvokeRequired) Invoke((Action)UpdateChart);
-      else {
-        if (Content != null) {
-          this.UpdateSeries();
-          if (!this.chart.Series.Any(s => s.Points.Count > 0))
-            this.ClearChart();
-        }
-      }
-    }
-
-    private void UpdateCursorInterval() {
-      var estimatedValues = this.chart.Series[ALL_SERIES].Points.Select(x => x.XValue).DefaultIfEmpty(1.0);
-      var targetValues = this.chart.Series[ALL_SERIES].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0);
-      double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min();
-      double targetValuesRange = targetValues.Max() - targetValues.Min();
-      double interestingValuesRange = Math.Min(Math.Max(targetValuesRange, 1.0), Math.Max(estimatedValuesRange, 1.0));
-      double digits = (int)Math.Log10(interestingValuesRange) - 3;
-      double zoomInterval = Math.Max(Math.Pow(10, digits), 10E-5);
-      this.chart.ChartAreas[0].CursorX.Interval = zoomInterval;
-      this.chart.ChartAreas[0].CursorY.Interval = zoomInterval;
-    }
-
-
-    private void UpdateSeries() {
-      if (InvokeRequired) Invoke((Action)UpdateSeries);
-      else {
-        string targetVariableName = Content.ProblemData.TargetVariable;
-        Dataset dataset = Content.ProblemData.Dataset;
-        if (this.chart.Series[ALL_SERIES].Points.Count > 0)
-          this.chart.Series[ALL_SERIES].Points.DataBindXY(Content.PrognosedValues.ToArray(), "",
-            dataset.GetDoubleValues(targetVariableName).ToArray(), "");
-        if (this.chart.Series[TRAINING_SERIES].Points.Count > 0)
-          this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.PrognosedTrainingValues.ToArray(), "",
-            dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray(), "");
-        if (this.chart.Series[TEST_SERIES].Points.Count > 0)
-          this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.PrognosedTestValues.ToArray(), "",
-           dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray(), "");
-
-        double max = Content.PrognosedTrainingValues.Concat(Content.PrognosedTestValues.Concat(Content.PrognosedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Max();
-        double min = Content.PrognosedTrainingValues.Concat(Content.PrognosedTestValues.Concat(Content.PrognosedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Min();
-
-        max = max + 0.2 * Math.Abs(max);
-        min = min - 0.2 * Math.Abs(min);
-
-        double interestingValuesRange = max - min;
-        int digits = Math.Max(0, 3 - (int)Math.Log10(interestingValuesRange));
-
-        max = Math.Round(max, digits);
-        min = Math.Round(min, digits);
-
-        this.chart.ChartAreas[0].AxisX.Maximum = max;
-        this.chart.ChartAreas[0].AxisX.Minimum = min;
-        this.chart.ChartAreas[0].AxisY.Maximum = max;
-        this.chart.ChartAreas[0].AxisY.Minimum = min;
-        UpdateCursorInterval();
-      }
-    }
-
-    private void ClearChart() {
-      this.chart.Series[ALL_SERIES].Points.Clear();
-      this.chart.Series[TRAINING_SERIES].Points.Clear();
-      this.chart.Series[TEST_SERIES].Points.Clear();
-    }
-
-    private void ToggleSeriesData(Series series) {
-      if (series.Points.Count > 0) {  //checks if series is shown
-        if (this.chart.Series.Any(s => s != series && s.Points.Count > 0)) {
-          series.Points.Clear();
-        }
-      } else if (Content != null) {
-        string targetVariableName = Content.ProblemData.TargetVariable;
-
-        IEnumerable<double> predictedValues = null;
-        IEnumerable<double> targetValues = null;
-        switch (series.Name) {
-          case ALL_SERIES:
-            predictedValues = Content.PrognosedValues.ToArray();
-            targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName).ToArray();
-            break;
-          case TRAINING_SERIES:
-            predictedValues = Content.PrognosedTrainingValues.ToArray();
-            targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndizes).ToArray();
-            break;
-          case TEST_SERIES:
-            predictedValues = Content.PrognosedTestValues.ToArray();
-            targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndizes).ToArray();
-            break;
-        }
-        series.Points.DataBindXY(predictedValues, "", targetValues, "");
-        this.chart.Legends[series.Legend].ForeColor = Color.Black;
-        UpdateCursorInterval();
-      }
-    }
-
-    private void chart_MouseDown(object sender, MouseEventArgs e) {
-      HitTestResult result = chart.HitTest(e.X, e.Y);
-      if (result.ChartElementType == ChartElementType.LegendItem) {
-        this.ToggleSeriesData(result.Series);
-      }
-    }
-
-    private void chart_MouseMove(object sender, MouseEventArgs e) {
-      HitTestResult result = chart.HitTest(e.X, e.Y);
-      if (result.ChartElementType == ChartElementType.LegendItem)
-        this.Cursor = Cursors.Hand;
-      else
-        this.Cursor = Cursors.Default;
-    }
-
-    private void chart_AxisViewChanged(object sender, System.Windows.Forms.DataVisualization.Charting.ViewEventArgs e) {
-      this.chart.ChartAreas[0].AxisX.ScaleView.Size = e.NewSize;
-      this.chart.ChartAreas[0].AxisY.ScaleView.Size = e.NewSize;
-    }
-
-    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
-      e.LegendItems[0].Cells[1].ForeColor = this.chart.Series[ALL_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
-      e.LegendItems[1].Cells[1].ForeColor = this.chart.Series[TRAINING_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
-      e.LegendItems[2].Cells[1].ForeColor = this.chart.Series[TEST_SERIES].Points.Count == 0 ? Color.Gray : Color.Black;
-    }
-
-    private void chart_PostPaint(object sender, ChartPaintEventArgs e) {
-      var chartArea = e.ChartElement as ChartArea;
-      if (chartArea != null) {
-        ChartGraphics chartGraphics = e.ChartGraphics;
-        using (Pen p = new Pen(Color.DarkGray)) {
-          double xmin = chartArea.AxisX.ScaleView.ViewMinimum;
-          double xmax = chartArea.AxisX.ScaleView.ViewMaximum;
-          double ymin = chartArea.AxisY.ScaleView.ViewMinimum;
-          double ymax = chartArea.AxisY.ScaleView.ViewMaximum;
-
-          if (xmin > ymax || ymin > xmax) return;
-
-          PointF start = PointF.Empty;
-          start.X = (float)chartGraphics.GetPositionFromAxis(chartArea.Name, chartArea.AxisX.AxisName, Math.Max(xmin, ymin));
-          start.Y = (float)chartGraphics.GetPositionFromAxis(chartArea.Name, chartArea.AxisY.AxisName, Math.Max(xmin, ymin));
-          PointF end = PointF.Empty;
-          end.X = (float)chartGraphics.GetPositionFromAxis(chartArea.Name, chartArea.AxisX.AxisName, Math.Min(xmax, ymax));
-          end.Y = (float)chartGraphics.GetPositionFromAxis(chartArea.Name, chartArea.AxisY.AxisName, Math.Min(xmax, ymax));
-
-          chartGraphics.Graphics.DrawLine(p, chartGraphics.GetAbsolutePoint(start), chartGraphics.GetAbsolutePoint(end));
-        }
-      }
-    }
-  }
-}
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/TimeSeriesPrognosisAutoRegressiveModel.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/TimeSeriesPrognosisAutoRegressiveModel.cs	(revision 8486)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/TimeSeriesPrognosisAutoRegressiveModel.cs	(revision 8487)
@@ -52,5 +52,5 @@
     }
     public TimeSeriesPrognosisAutoRegressiveModel(string targetVariable, double[] phi, double constant)
-      : base() {
+      : base("AR(1) Model") {
       Phi = (double[])phi.Clone();
       Constant = constant;
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/TimeSeriesPrognosisMovingAverageModel.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/TimeSeriesPrognosisMovingAverageModel.cs	(revision 8486)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/TimeSeriesPrognosisMovingAverageModel.cs	(revision 8487)
@@ -47,5 +47,5 @@
     }
     public TimeSeriesPrognosisMovingAverageModel(int windowSize, string targetVariable)
-      : base() {
+      : base("Moving Average Model") {
       TargetVariable = targetVariable;
       WindowSize = Math.Abs(windowSize);
