Index: /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/ConfusionMatrixView.Designer.cs
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/ConfusionMatrixView.Designer.cs	(revision 4367)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/ConfusionMatrixView.Designer.cs	(revision 4367)
@@ -0,0 +1,85 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Classification.Views {
+  partial class ConfusionMatrixView {
+    /// <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.dataGridView = new System.Windows.Forms.DataGridView();
+      this.cmbSamples = new System.Windows.Forms.ComboBox();
+      this.label1 = new System.Windows.Forms.Label();
+      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
+      this.SuspendLayout();
+      // 
+      // dataGridView
+      // 
+      this.dataGridView.AllowUserToAddRows = false;
+      this.dataGridView.AllowUserToDeleteRows = false;
+      this.dataGridView.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)));
+      this.dataGridView.Location = new System.Drawing.Point(3, 30);
+      this.dataGridView.Name = "dataGridView";
+      this.dataGridView.ReadOnly = true;
+      this.dataGridView.Size = new System.Drawing.Size(303, 197);
+      this.dataGridView.TabIndex = 0;
+      // 
+      // cmbSamples
+      // 
+      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 = 1;
+      this.cmbSamples.SelectedIndexChanged += new System.EventHandler(this.cmbSamples_SelectedIndexChanged);
+      // 
+      // 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 = 2;
+      this.label1.Text = "Samples";
+      // 
+      // ConfusionMatrixView
+      // 
+      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.dataGridView);
+      this.Name = "ConfusionMatrixView";
+      this.Size = new System.Drawing.Size(309, 230);
+      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.DataGridView dataGridView;
+    private System.Windows.Forms.ComboBox cmbSamples;
+    private System.Windows.Forms.Label label1;
+
+  }
+}
Index: /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/ConfusionMatrixView.cs
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/ConfusionMatrixView.cs	(revision 4367)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/ConfusionMatrixView.cs	(revision 4367)
@@ -0,0 +1,150 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.MainForm;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.Problems.DataAnalysis.Classification.Views {
+  [View("Confusion Matrix View")]
+  [Content(typeof(SymbolicClassificationSolution))]
+  public partial class ConfusionMatrixView : AsynchronousContentView {
+    private const string TrainingSamples = "Training";
+    private const string TestSamples = "Test";
+    public ConfusionMatrixView() {
+      InitializeComponent();
+      cmbSamples.Items.Add(TrainingSamples);
+      cmbSamples.Items.Add(TestSamples);
+      cmbSamples.SelectedIndex = 0;
+    }
+
+    public new SymbolicClassificationSolution Content {
+      get { return (SymbolicClassificationSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+      Content.ThresholdsChanged += new EventHandler(Content_ThresholdsChanged);
+    }
+
+
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+      Content.ThresholdsChanged -= new EventHandler(Content_ThresholdsChanged);
+    }
+
+    private void Content_EstimatedValuesChanged(object sender, EventArgs e) {
+      FillDataGridView();
+    }
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      UpdateDataGridView();
+    }
+    private void Content_ThresholdsChanged(object sender, EventArgs e) {
+      FillDataGridView();
+    }
+
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateDataGridView();
+    }
+
+    private void UpdateDataGridView() {
+      if (InvokeRequired) Invoke((Action)UpdateDataGridView);
+      else {
+        if (Content == null) {
+          dataGridView.RowCount = 1;
+          dataGridView.ColumnCount = 1;
+        } else {
+          dataGridView.ColumnCount = Content.ProblemData.NumberOfClasses;
+          dataGridView.RowCount = Content.ProblemData.NumberOfClasses;
+
+          int i = 0;
+          foreach (string headerText in Content.ProblemData.ClassNames) {
+            dataGridView.Columns[i].HeaderText = "Actual " + headerText;
+            dataGridView.Rows[i].HeaderCell.Value = "Predicted " + headerText;
+            i++;
+          }
+          dataGridView.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.ColumnHeader);
+          dataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
+
+          FillDataGridView();
+        }
+      }
+    }
+
+    private void FillDataGridView() {
+      if (InvokeRequired) Invoke((Action)FillDataGridView);
+      else {
+        if (Content == null) return;
+
+        double[,] confusionMatrix = new double[Content.ProblemData.NumberOfClasses, Content.ProblemData.NumberOfClasses];
+        int start;
+        int end;
+
+        if (cmbSamples.SelectedItem.ToString() == TrainingSamples) {
+          start = Content.ProblemData.TrainingSamplesStart.Value;
+          end = Content.ProblemData.TrainingSamplesEnd.Value;
+        } else if (cmbSamples.SelectedItem.ToString() == TestSamples) {
+          start = Content.ProblemData.TestSamplesStart.Value;
+          end = Content.ProblemData.TestSamplesEnd.Value;
+        } else throw new InvalidOperationException();
+
+        Dictionary<double, int> classValueIndexMapping = new Dictionary<double, int>();
+        int index = 0;
+        foreach (double classValue in Content.ProblemData.SortedClassValues) {
+          classValueIndexMapping.Add(classValue, index);
+          index++;
+        }
+
+        double[] targetValues = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value, start, end);
+        double[] predictedValues = Content.EstimatedClassValues.Skip(start).Take(end - start).ToArray();
+
+        for (int i = 0; i < targetValues.Length; i++) {
+          double targetValue = targetValues[i];
+          double predictedValue = predictedValues[i];
+          int targetIndex = classValueIndexMapping[targetValue];
+          int predictedIndex = classValueIndexMapping[predictedValue];
+
+          confusionMatrix[predictedIndex, targetIndex] += 1;
+        }
+
+        for (int row = 0; row < confusionMatrix.GetLength(0); row++) {
+          for (int col = 0; col < confusionMatrix.GetLength(1); col++) {
+            //TODO add scaling to relative values;
+            dataGridView[col, row].Value = confusionMatrix[row, col];
+          }
+        }
+      }
+    }
+
+    private void cmbSamples_SelectedIndexChanged(object sender, System.EventArgs e) {
+      FillDataGridView();
+    }
+  }
+}
Index: /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/HeuristicLab.Problems.DataAnalysis.Classification.Views.csproj
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/HeuristicLab.Problems.DataAnalysis.Classification.Views.csproj	(revision 4367)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/HeuristicLab.Problems.DataAnalysis.Classification.Views.csproj	(revision 4367)
@@ -0,0 +1,170 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{7F038E9A-B91E-4F49-8C27-D47BC86F1220}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Classification.Views</RootNamespace>
+    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Debug\HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x86\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Debug\HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>bin\x86\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=AMD64" />
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=AMD64" />
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86" />
+    <Reference Include="HeuristicLab.Data.Views-3.3">
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.Data.Views-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=AMD64" />
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\..\..\Program Files\HeuristicLab 3.3\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=AMD64" />
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Windows.Forms.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ConfusionMatrixView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="ConfusionMatrixView.Designer.cs">
+      <DependentUpon>ConfusionMatrixView.cs</DependentUpon>
+    </Compile>
+    <Compile Include="HeuristicLabProblemsDataAnalysisClassificationViewsPlugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SymbolicClassificationSolutionView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="SymbolicClassificationSolutionView.Designer.cs">
+      <DependentUpon>SymbolicClassificationSolutionView.cs</DependentUpon>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabProblemsDataAnalysisClassificationViewsPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Classification\3.3\HeuristicLab.Problems.DataAnalysis.Classification.csproj">
+      <Project>{D35FD6DB-D704-4BEA-BDAE-C40ABFB5B13E}</Project>
+      <Name>HeuristicLab.Problems.DataAnalysis.Classification</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25HeuristicLabProblemsDataAnalysisClassificationViewsPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabProblemsDataAnalysisClassificationViewsPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/HeuristicLabProblemsDataAnalysisClassificationViewsPlugin.cs.frame
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/HeuristicLabProblemsDataAnalysisClassificationViewsPlugin.cs.frame	(revision 4367)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/HeuristicLabProblemsDataAnalysisClassificationViewsPlugin.cs.frame	(revision 4367)
@@ -0,0 +1,29 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.DataAnalysis.Classification.Views {
+  [Plugin("HeuristicLab.Problems.DataAnalysis.Classification.Views", "3.3.0.$WCREV$")]
+  [PluginFile("HeuristicLab.Problems.DataAnalysis.Classification.Views-3.3.dll", PluginFileType.Assembly)]
+  public class HeuristicLabProblemsDataAnalysisClassificationViewsPlugin : PluginBase {
+  }
+}
Index: /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/Properties/AssemblyInfo.frame
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/Properties/AssemblyInfo.frame	(revision 4367)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/Properties/AssemblyInfo.frame	(revision 4367)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.DataAnalysis.Classification.Views")]
+[assembly: AssemblyDescription("HeuristicLab DataAnalysis Classification Views")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2010 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("81f6afd4-4c1f-4867-8c11-726e242dd7cb")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.0.$WCREV$")]
Index: /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/SymbolicClassificationSolutionView.Designer.cs
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/SymbolicClassificationSolutionView.Designer.cs	(revision 4367)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/SymbolicClassificationSolutionView.Designer.cs	(revision 4367)
@@ -0,0 +1,101 @@
+﻿namespace HeuristicLab.Problems.DataAnalysis.Classification.Views {
+  partial class SymbolicClassificationSolutionView {
+    /// <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 System.Windows.Forms.DataVisualization.Charting.Chart();
+      this.JitterTrackBar = new System.Windows.Forms.TrackBar();
+      this.label1 = new System.Windows.Forms.Label();
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
+      ((System.ComponentModel.ISupportInitialize)(this.JitterTrackBar)).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(3, 3);
+      this.chart.Name = "chart";
+      this.chart.Size = new System.Drawing.Size(553, 364);
+      this.chart.TabIndex = 0;
+      this.chart.Text = "chart";
+      this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
+      this.chart.AnnotationPositionChanging += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.AnnotationPositionChangingEventArgs>(this.chart_AnnotationPositionChanging);
+      this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
+      this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
+      // 
+      // JitterTrackBar
+      // 
+      this.JitterTrackBar.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+      this.JitterTrackBar.BackColor = System.Drawing.SystemColors.Window;
+      this.JitterTrackBar.Location = new System.Drawing.Point(483, 341);
+      this.JitterTrackBar.Maximum = 100;
+      this.JitterTrackBar.Name = "JitterTrackBar";
+      this.JitterTrackBar.Size = new System.Drawing.Size(71, 45);
+      this.JitterTrackBar.TabIndex = 1;
+      this.JitterTrackBar.TickStyle = System.Windows.Forms.TickStyle.None;
+      this.JitterTrackBar.ValueChanged += new System.EventHandler(this.JitterTrackBar_ValueChanged);
+      // 
+      // label1
+      // 
+      this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+      this.label1.AutoSize = true;
+      this.label1.BackColor = System.Drawing.SystemColors.Window;
+      this.label1.Location = new System.Drawing.Point(448, 345);
+      this.label1.Name = "label1";
+      this.label1.Size = new System.Drawing.Size(32, 13);
+      this.label1.TabIndex = 2;
+      this.label1.Text = "Jitter:";
+      // 
+      // SymbolicClassificationSolutionView
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.Controls.Add(this.label1);
+      this.Controls.Add(this.JitterTrackBar);
+      this.Controls.Add(this.chart);
+      this.Name = "SymbolicClassificationSolutionView";
+      this.Size = new System.Drawing.Size(559, 370);
+      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
+      ((System.ComponentModel.ISupportInitialize)(this.JitterTrackBar)).EndInit();
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.DataVisualization.Charting.Chart chart;
+    private System.Windows.Forms.TrackBar JitterTrackBar;
+    private System.Windows.Forms.Label label1;
+  }
+}
Index: /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/SymbolicClassificationSolutionView.cs
===================================================================
--- /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/SymbolicClassificationSolutionView.cs	(revision 4367)
+++ /branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classfication.Views/3.3/SymbolicClassificationSolutionView.cs	(revision 4367)
@@ -0,0 +1,248 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Classification.Views {
+  [View("Symbolic Classification View")]
+  [Content(typeof(SymbolicClassificationSolution), true)]
+  public sealed partial class SymbolicClassificationSolutionView : AsynchronousContentView {
+    private const double TrainingAxisValue = 0.0;
+    private const double TestAxisValue = 10.0;
+    private const double TrainingTestBorder = (TestAxisValue - TrainingAxisValue) / 2;
+    private const string TrainingLabelText = "Training Samples";
+    private const string TestLabelText = "Test Samples";
+
+    public new SymbolicClassificationSolution Content {
+      get { return (SymbolicClassificationSolution)base.Content; }
+      set { base.Content = value; }
+    }
+
+    private Dictionary<double, Series> classValueSeriesMapping;
+    private Random random;
+    private bool updateInProgress;
+
+    public SymbolicClassificationSolutionView()
+      : base() {
+      InitializeComponent();
+
+      classValueSeriesMapping = new Dictionary<double, Series>();
+      random = new Random();
+      updateInProgress = false;
+
+      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
+      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
+      this.chart.ChartAreas[0].AxisX.Minimum = TrainingAxisValue - TrainingTestBorder;
+      this.chart.ChartAreas[0].AxisX.Maximum = TestAxisValue + TrainingTestBorder;
+      AddCustomLabelToAxis(this.chart.ChartAreas[0].AxisX);
+
+      this.chart.ChartAreas[0].AxisY.Title = "Estimated Values";
+      this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
+    }
+
+    private void AddCustomLabelToAxis(Axis axis) {
+      CustomLabel trainingLabel = new CustomLabel();
+      trainingLabel.Text = TrainingLabelText;
+      trainingLabel.GridTicks = GridTickTypes.TickMark;
+      trainingLabel.FromPosition = TrainingAxisValue - TrainingTestBorder;
+      trainingLabel.ToPosition = TrainingAxisValue + TrainingTestBorder;
+      axis.CustomLabels.Add(trainingLabel);
+
+      CustomLabel testLabel = new CustomLabel();
+      testLabel.Text = TestLabelText;
+      testLabel.GridTicks = GridTickTypes.TickMark;
+      testLabel.FromPosition = TestAxisValue - TrainingTestBorder;
+      testLabel.ToPosition = TestAxisValue + TrainingTestBorder;
+      axis.CustomLabels.Add(testLabel);
+    }
+
+    protected override void RegisterContentEvents() {
+      base.RegisterContentEvents();
+      Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
+      Content.ThresholdsChanged += new EventHandler(Content_ThresholdsChanged);
+    }
+    protected override void DeregisterContentEvents() {
+      base.DeregisterContentEvents();
+      Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
+      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
+      Content.ThresholdsChanged -= new EventHandler(Content_ThresholdsChanged);
+    }
+
+    private void Content_ProblemDataChanged(object sender, EventArgs e) {
+      UpdateChart();
+    }
+    private void Content_EstimatedValuesChanged(object sender, EventArgs e) {
+      UpdateChart();
+    }
+    private void Content_ThresholdsChanged(object sender, EventArgs e) {
+      AddThresholds();
+    }
+    protected override void OnContentChanged() {
+      base.OnContentChanged();
+      UpdateChart();
+    }
+
+    private void UpdateChart() {
+      if (InvokeRequired) Invoke((Action)UpdateChart);
+      else if (!updateInProgress) {
+        updateInProgress = true;
+        chart.Series.Clear();
+        classValueSeriesMapping.Clear();
+        if (Content != null) {
+          IEnumerator<string> classNameEnumerator = Content.ProblemData.ClassNames.GetEnumerator();
+          IEnumerator<double> classValueEnumerator = Content.ProblemData.SortedClassValues.GetEnumerator();
+          while (classNameEnumerator.MoveNext() && classValueEnumerator.MoveNext()) {
+            Series series = new Series(classNameEnumerator.Current);
+            series.ChartType = SeriesChartType.FastPoint;
+            series.Tag = classValueEnumerator.Current;
+            chart.Series.Add(series);
+            classValueSeriesMapping.Add(classValueEnumerator.Current, series);
+            FillSeriesWithDataPoints(series);
+          }
+          AddThresholds();
+        }
+        updateInProgress = false;
+      }
+    }
+
+    private void FillSeriesWithDataPoints(Series series) {
+      int row = Content.ProblemData.TrainingSamplesStart.Value;
+      foreach (double estimatedValue in Content.EstimatedTrainingValues) {
+        double targetValue = Content.ProblemData.Dataset[Content.ProblemData.TargetVariable.Value, row];
+        if (targetValue == (double)series.Tag) {
+          double jitterValue = random.NextDouble() * 2.0 - 1.0;
+          DataPoint point = new DataPoint();
+          point.XValue = TrainingAxisValue + 0.01 * jitterValue * JitterTrackBar.Value * (TrainingTestBorder * 0.9);
+          point.YValues[0] = estimatedValue;
+          point.Tag = new KeyValuePair<double, double>(TrainingAxisValue, jitterValue);
+          series.Points.Add(point);
+        }
+        row++;
+      }
+
+      row = Content.ProblemData.TestSamplesStart.Value;
+      foreach (double estimatedValue in Content.EstimatedTestValues) {
+        double targetValue = Content.ProblemData.Dataset[Content.ProblemData.TargetVariable.Value, row];
+        if (targetValue == (double)series.Tag) {
+          double jitterValue = random.NextDouble() * 2.0 - 1.0;
+          DataPoint point = new DataPoint();
+          point.XValue = TestAxisValue + 0.01 * jitterValue * JitterTrackBar.Value * (TrainingTestBorder * 0.9);
+          point.YValues[0] = estimatedValue;
+          point.Tag = new KeyValuePair<double, double>(TestAxisValue, jitterValue);
+          series.Points.Add(point);
+        }
+        row++;
+      }
+    }
+
+    private void AddThresholds() {
+      chart.Annotations.Clear();
+      int classIndex = 1;
+      foreach (double threshold in Content.Thresholds) {
+        if (!double.IsInfinity(threshold)) {
+          HorizontalLineAnnotation annotation = new HorizontalLineAnnotation();
+          annotation.AllowMoving = true;
+          annotation.AllowResizing = false;
+          annotation.LineWidth = 2;
+          annotation.LineColor = Color.Red;
+
+          annotation.IsInfinitive = true;
+          annotation.ClipToChartArea = chart.ChartAreas[0].Name;
+          annotation.Tag = classIndex;  //save classIndex as Tag to avoid moving the threshold accross class bounderies
+
+          annotation.AxisX = chart.ChartAreas[0].AxisX;
+          annotation.AxisY = chart.ChartAreas[0].AxisY;
+          annotation.Y = threshold;
+
+          chart.Annotations.Add(annotation);
+          classIndex++;
+        }
+      }
+    }
+
+    private void JitterTrackBar_ValueChanged(object sender, EventArgs e) {
+      foreach (Series series in chart.Series) {
+        foreach (DataPoint point in series.Points) {
+          double value = ((KeyValuePair<double, double>)point.Tag).Key;
+          double jitterValue = ((KeyValuePair<double, double>)point.Tag).Value; ;
+          point.XValue = value + 0.01 * jitterValue * JitterTrackBar.Value * (TrainingTestBorder * 0.9);
+        }
+      }
+    }
+
+    private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
+      foreach (LegendItem legendItem in e.LegendItems) {
+        var series = chart.Series[legendItem.SeriesName];
+        if (series != null) {
+          bool seriesIsInvisible = series.Points.Count == 0;
+          foreach (LegendCell cell in legendItem.Cells)
+            cell.ForeColor = seriesIsInvisible ? Color.Gray : Color.Black;
+        }
+      }
+    }
+
+    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 ToggleSeries(Series series) {
+      if (series.Points.Count == 0)
+        FillSeriesWithDataPoints(series);
+      else
+        series.Points.Clear();
+    }
+
+    private void chart_MouseDown(object sender, MouseEventArgs e) {
+      HitTestResult result = chart.HitTest(e.X, e.Y);
+      if (result.ChartElementType == ChartElementType.LegendItem) {
+        if (result.Series != null) ToggleSeries(result.Series);
+      }
+    }
+
+    private void chart_AnnotationPositionChanging(object sender, AnnotationPositionChangingEventArgs e) {
+      int classIndex = (int)e.Annotation.Tag;
+
+      double classValue = Content.ProblemData.SortedClassValues.ElementAt(classIndex);
+      if (e.NewLocationY >= classValue)
+        e.NewLocationY = classValue;
+
+      classValue = Content.ProblemData.SortedClassValues.ElementAt(classIndex - 1);
+      if (e.NewLocationY <= classValue)
+        e.NewLocationY = classValue;
+
+      double[] thresholds = Content.Thresholds.ToArray();
+      thresholds[classIndex] = e.NewLocationY;
+      Content.Thresholds = thresholds;
+    }
+  }
+}
