Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionAccuracyToCoveredSamples.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionAccuracyToCoveredSamples.cs	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionAccuracyToCoveredSamples.cs	(revision 8814)
@@ -26,5 +26,4 @@
 using System.Windows.Forms;
 using System.Windows.Forms.DataVisualization.Charting;
-using HeuristicLab.Data;
 using HeuristicLab.MainForm;
 
@@ -82,37 +81,34 @@
         IClassificationEnsembleSolutionWeightCalculator weightCalc = Content.WeightCalculator;
         var solutions = Content.ClassificationSolutions;
-        double[] estimatedClassValues;
+        double[] estimatedClassValues = null;
         double[] classValues;
         OnlineAccuracyCalculator accuracyCalc = new OnlineAccuracyCalculator();
 
-        int rows;
-        double[] confidences;
+        int rows = 0;
+        double[] confidences = null;
+
+        classValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
 
         if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxAllSamples)) {
           rows = Content.ProblemData.Dataset.Rows;
           estimatedClassValues = Content.EstimatedClassValues.ToArray();
-          classValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
-          confidences = weightCalc.GetConfidence(solutions, Enumerable.Range(0, rows), estimatedClassValues).ToArray();
-        } else {
-          IntRange range;
-          if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxTrainingSamples)) {
-            range = Content.ProblemData.TrainingPartition;
-            estimatedClassValues = Content.EstimatedTrainingClassValues.ToArray();
-          } else if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxTestSamples)) {
-            range = Content.ProblemData.TestPartition;
-            estimatedClassValues = Content.EstimatedTestClassValues.ToArray();
-          } else {
-            return;
-          }
-          rows = range.End - range.Start;
-          classValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable)
-                                      .Skip(range.Start).Take(range.End - range.Start).ToArray();
-          confidences = new double[rows];
-          int index;
-          for (int i = 0; i < rows; i++) {
-            index = range.Start + i;
-            confidences[i] = weightCalc.GetConfidence(GetRelevantSolutions(SamplesComboBox.SelectedItem.ToString(), solutions, index),
-                                                      index, estimatedClassValues[i]);
-          }
+          confidences = weightCalc.GetConfidence(solutions,
+                                                 Enumerable.Range(0, Content.ProblemData.Dataset.Rows),
+                                                 estimatedClassValues,
+                                                 weightCalc.GetAllClassDelegate()).ToArray();
+        } else if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxTrainingSamples)) {
+          rows = Content.ProblemData.TrainingIndices.Count();
+          estimatedClassValues = Content.EstimatedTrainingClassValues.ToArray();
+          confidences = weightCalc.GetConfidence(solutions,
+                                                 Content.ProblemData.TrainingIndices,
+                                                 estimatedClassValues,
+                                                 weightCalc.GetTrainingClassDelegate()).ToArray();
+        } else if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxTestSamples)) {
+          rows = Content.ProblemData.TestIndices.Count();
+          estimatedClassValues = Content.EstimatedTestClassValues.ToArray();
+          confidences = weightCalc.GetConfidence(solutions,
+                                                 Content.ProblemData.TestIndices,
+                                                 estimatedClassValues,
+                                                 weightCalc.GetTestClassDelegate()).ToArray();
         }
 
@@ -130,5 +126,7 @@
 
           accuracy[i + 1] = accuracyCalc.Accuracy;
-          covered[i] = 1.0 - (double)notCovered / (double)rows;
+          if (rows > 0) {
+            covered[i] = 1.0 - (double)notCovered / (double)rows;
+          }
           accuracyCalc.Reset();
         }
@@ -179,15 +177,4 @@
     }
 
-    protected IEnumerable<IClassificationSolution> GetRelevantSolutions(string samplesSelection, IEnumerable<IClassificationSolution> solutions, int curRow) {
-      if (samplesSelection == SamplesComboBoxAllSamples)
-        return solutions;
-      else if (samplesSelection == SamplesComboBoxTrainingSamples)
-        return solutions.Where(s => s.ProblemData.IsTrainingSample(curRow));
-      else if (samplesSelection == SamplesComboBoxTestSamples)
-        return solutions.Where(s => s.ProblemData.IsTestSample(curRow));
-      else
-        return new List<IClassificationSolution>();
-    }
-
     private double CalculateAreaUnderCurve(Series series) {
       if (series.Points.Count < 1) throw new ArgumentException("Could not calculate area under curve if less than 1 data points were given.");
Index: anches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionConfidenceAccuracyDependence.Designer.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionConfidenceAccuracyDependence.Designer.cs	(revision 8813)
+++ 	(revision )
@@ -1,100 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-namespace HeuristicLab.Problems.DataAnalysis.Views {
-  partial class ClassificationEnsembleSolutionConfidenceAccuracyDependence {
-    /// <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.SamplesComboBox = 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 = "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, 30);
-      this.chart.Name = "chart";
-      this.chart.Size = new System.Drawing.Size(358, 195);
-      this.chart.TabIndex = 0;
-      // 
-      // SamplesComboBox
-      // 
-      this.SamplesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
-      this.SamplesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-      this.SamplesComboBox.FormattingEnabled = true;
-      this.SamplesComboBox.Location = new System.Drawing.Point(3, 3);
-      this.SamplesComboBox.Name = "SamplesComboBox";
-      this.SamplesComboBox.Size = new System.Drawing.Size(355, 21);
-      this.SamplesComboBox.TabIndex = 1;
-      this.SamplesComboBox.SelectedIndexChanged += new System.EventHandler(this.SamplesComboBox_SelectedIndexChanged);
-      // 
-      // ClassificationEnsembleSolutionConfidenceAccuracyDependence
-      // 
-      this.AllowDrop = true;
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
-      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.SamplesComboBox);
-      this.Controls.Add(this.chart);
-      this.Name = "ClassificationEnsembleSolutionConfidenceAccuracyDependence";
-      this.Size = new System.Drawing.Size(358, 225);
-      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
-      this.ResumeLayout(false);
-
-    }
-
-    #endregion
-
-    private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
-    private System.Windows.Forms.ComboBox SamplesComboBox;
-  }
-}
Index: anches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionConfidenceAccuracyDependence.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionConfidenceAccuracyDependence.cs	(revision 8813)
+++ 	(revision )
@@ -1,190 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Windows.Forms;
-using System.Windows.Forms.DataVisualization.Charting;
-using HeuristicLab.Data;
-using HeuristicLab.MainForm;
-
-namespace HeuristicLab.Problems.DataAnalysis.Views {
-  [View("Confidence Accuracy Dependence")]
-  [Content(typeof(IClassificationEnsembleSolution))]
-  public partial class ClassificationEnsembleSolutionConfidenceAccuracyDependence : DataAnalysisSolutionEvaluationView {
-    private const string CONFIDENCE = "Confidence";
-    private const string ACCURACY = "Accuracy";
-    private const string COVEREDPERCENTAGE = "Covered percentage";
-
-    private const string SamplesComboBoxAllSamples = "All Samples";
-    private const string SamplesComboBoxTrainingSamples = "Training Samples";
-    private const string SamplesComboBoxTestSamples = "Test Samples";
-
-    // zero is also a point
-    private const int maxPoints = 101;
-
-    public new ClassificationEnsembleSolution Content {
-      get { return (ClassificationEnsembleSolution)base.Content; }
-      set { base.Content = value; }
-    }
-
-    public ClassificationEnsembleSolutionConfidenceAccuracyDependence()
-      : base() {
-      InitializeComponent();
-
-      SamplesComboBox.Items.AddRange(new string[] { SamplesComboBoxAllSamples, SamplesComboBoxTrainingSamples, SamplesComboBoxTestSamples });
-      SamplesComboBox.SelectedIndex = 0;
-      //configure axis
-      this.chart.CustomizeAllChartAreas();
-      this.chart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true;
-      this.chart.ChartAreas[0].AxisX.ScaleView.Zoomable = true;
-      this.chart.ChartAreas[0].AxisX.IsStartedFromZero = true;
-      this.chart.ChartAreas[0].AxisX.Minimum = 0;
-      this.chart.ChartAreas[0].AxisX.Maximum = 1;
-
-      this.chart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true;
-      this.chart.ChartAreas[0].AxisY.ScaleView.Zoomable = true;
-      this.chart.ChartAreas[0].AxisY.IsStartedFromZero = true;
-      this.chart.ChartAreas[0].AxisY.Minimum = 0;
-      this.chart.ChartAreas[0].AxisY.Maximum = 1;
-    }
-
-    private void RedrawChart() {
-      this.chart.Series.Clear();
-      if (Content != null) {
-
-        Dictionary<string, double[]> points = new Dictionary<string, double[]>();
-        points.Add(CONFIDENCE, new double[maxPoints]);
-        points.Add(ACCURACY, new double[maxPoints]);
-        points.Add(COVEREDPERCENTAGE, new double[maxPoints]);
-
-        IClassificationEnsembleSolutionWeightCalculator weightCalc = Content.WeightCalculator;
-        var solutions = Content.ClassificationSolutions;
-        double[] estimatedClassValues;
-        double[] classValues;
-        OnlineAccuracyCalculator accuracyCalc = new OnlineAccuracyCalculator();
-
-        int rows;
-        double[] confidences;
-
-        if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxAllSamples)) {
-          rows = Content.ProblemData.Dataset.Rows;
-          estimatedClassValues = Content.EstimatedClassValues.ToArray();
-          classValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
-          confidences = weightCalc.GetConfidence(solutions, Enumerable.Range(0, rows), estimatedClassValues).ToArray();
-        } else {
-          IntRange range;
-          if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxTrainingSamples)) {
-            range = Content.ProblemData.TrainingPartition;
-            estimatedClassValues = Content.EstimatedTrainingClassValues.ToArray();
-          } else if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxTestSamples)) {
-            range = Content.ProblemData.TestPartition;
-            estimatedClassValues = Content.EstimatedTestClassValues.ToArray();
-          } else {
-            return;
-          }
-          rows = range.End - range.Start;
-          classValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable)
-                                      .Skip(range.Start).Take(range.End - range.Start).ToArray();
-          confidences = new double[rows];
-          int index;
-          for (int i = 0; i < rows; i++) {
-            index = range.Start + i;
-            confidences[i] = weightCalc.GetConfidence(GetRelevantSolutions(SamplesComboBox.SelectedItem.ToString(), solutions, index),
-                                                      index, estimatedClassValues[i]);
-          }
-        }
-
-        for (int i = 0; i < maxPoints; i++) {
-          double confidenceValue = (1.0 / (maxPoints - 1)) * i;
-          int notCovered = 0;
-
-          for (int j = 0; j < rows; j++) {
-            if (confidences[j] >= confidenceValue) {
-              accuracyCalc.Add(classValues[j], estimatedClassValues[j]);
-            } else {
-              notCovered++;
-            }
-          }
-
-          points[CONFIDENCE][i] = confidenceValue;
-          points[ACCURACY][i] = accuracyCalc.Accuracy;
-          points[COVEREDPERCENTAGE][i] = (double)notCovered / (double)rows;
-          accuracyCalc.Reset();
-        }
-
-        this.chart.Series.Add(CONFIDENCE);
-        this.chart.Series[CONFIDENCE].LegendText = CONFIDENCE;
-        this.chart.Series[CONFIDENCE].ChartType = SeriesChartType.FastLine;
-        this.chart.Series[CONFIDENCE].Points.DataBindXY(points[CONFIDENCE], points[CONFIDENCE]);
-
-        this.chart.Series.Add(ACCURACY);
-        this.chart.Series[ACCURACY].LegendText = ACCURACY;
-        this.chart.Series[ACCURACY].ChartType = SeriesChartType.FastLine;
-        this.chart.Series[ACCURACY].Points.DataBindXY(points[CONFIDENCE], points[ACCURACY]);
-
-        this.chart.Series.Add(COVEREDPERCENTAGE);
-        this.chart.Series[COVEREDPERCENTAGE].LegendText = COVEREDPERCENTAGE;
-        this.chart.Series[COVEREDPERCENTAGE].ChartType = SeriesChartType.FastLine;
-        this.chart.Series[COVEREDPERCENTAGE].Points.DataBindXY(points[CONFIDENCE], points[COVEREDPERCENTAGE]);
-      }
-    }
-
-    protected IEnumerable<IClassificationSolution> GetRelevantSolutions(string samplesSelection, IEnumerable<IClassificationSolution> solutions, int curRow) {
-      if (samplesSelection == SamplesComboBoxAllSamples)
-        return solutions;
-      else if (samplesSelection == SamplesComboBoxTrainingSamples)
-        return solutions.Where(s => s.ProblemData.IsTrainingSample(curRow));
-      else if (samplesSelection == SamplesComboBoxTestSamples)
-        return solutions.Where(s => s.ProblemData.IsTestSample(curRow));
-      else
-        return new List<IClassificationSolution>();
-    }
-
-    #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 SamplesComboBox_SelectedIndexChanged(object sender, EventArgs e) {
-      RedrawChart();
-    }
-    #endregion
-  }
-}
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs	(revision 8814)
@@ -112,6 +112,20 @@
 
       double[] confidences = null;
-      if (SamplesComboBox.SelectedItem.ToString() == SamplesComboBoxAllSamples) {
-        confidences = weightCalc.GetConfidence(solutions, indizes, estimatedClassValues).ToArray();
+
+      if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxAllSamples)) {
+        confidences = weightCalc.GetConfidence(solutions,
+                                               indizes,
+                                               estimatedClassValues,
+                                               weightCalc.GetAllClassDelegate()).ToArray();
+      } else if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxTrainingSamples)) {
+        confidences = weightCalc.GetConfidence(solutions,
+                                               indizes,
+                                               estimatedClassValues,
+                                               weightCalc.GetTrainingClassDelegate()).ToArray();
+      } else if (SamplesComboBox.SelectedItem.ToString().Equals(SamplesComboBoxTestSamples)) {
+        confidences = weightCalc.GetConfidence(solutions,
+                                               indizes,
+                                               estimatedClassValues,
+                                               weightCalc.GetTestClassDelegate()).ToArray();
       }
 
@@ -125,10 +139,5 @@
           correctClassified = target[i].IsAlmost(estimatedClassValues[i]);
           values[i, 3] = correctClassified.ToString();
-          if (SamplesComboBox.SelectedItem.ToString() == SamplesComboBoxAllSamples) {
-            curConfidence = confidences[i];
-          } else {
-            curConfidence = weightCalc.GetConfidence(GetRelevantSolutions(SamplesComboBox.SelectedItem.ToString(), solutions, row),
-                                                     indizes[i], estimatedClassValues[i]);
-          }
+          curConfidence = confidences[i];
           if (correctClassified) {
             confidence[0] += curConfidence;
@@ -167,24 +176,4 @@
       matrix.SortableView = true;
       matrixView.Content = matrix;
-    }
-
-    protected IEnumerable<IClassificationSolution> GetRelevantSolutions(string samplesSelection, IEnumerable<IClassificationSolution> solutions, int curRow) {
-      if (samplesSelection == SamplesComboBoxAllSamples)
-        return solutions;
-      else if (samplesSelection == SamplesComboBoxTrainingSamples)
-        return solutions.Where(s => s.ProblemData.IsTrainingSample(curRow));
-      else if (samplesSelection == SamplesComboBoxTestSamples)
-        return solutions.Where(s => s.ProblemData.IsTestSample(curRow));
-      else
-        return new List<IClassificationSolution>();
-    }
-
-    private IEnumerable<int> FindAllIndices(List<double?> list, double value) {
-      List<int> indices = new List<int>();
-      for (int i = 0; i < list.Count; i++) {
-        if (list[i].Equals(value))
-          indices.Add(i);
-      }
-      return indices;
     }
 
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj	(revision 8814)
@@ -214,10 +214,4 @@
     <Compile Include="FeatureCorrelation\AbstractFeatureCorrelationView.Designer.cs">
       <DependentUpon>AbstractFeatureCorrelationView.cs</DependentUpon>
-    </Compile>
-    <Compile Include="Classification\ClassificationEnsembleSolutionConfidenceAccuracyDependence.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="Classification\ClassificationEnsembleSolutionConfidenceAccuracyDependence.Designer.cs">
-      <DependentUpon>ClassificationEnsembleSolutionConfidenceAccuracyDependence.cs</DependentUpon>
     </Compile>
     <Compile Include="Classification\ClassificationEnsembleSolutionAccuracyToCoveredSamples.cs">
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj	(revision 8814)
@@ -94,9 +94,9 @@
   <ItemGroup>
     <Reference Include="ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <HintPath>>..\..\..\..\trunk\sources\bin\ALGLIB-3.6.0.dll</HintPath>
+      <HintPath>&gt;..\..\..\..\trunk\sources\bin\ALGLIB-3.6.0.dll</HintPath>
       <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <HintPath>>..\..\..\..\trunk\sources\bin\HeuristicLab.ALGLIB-3.6.0.dll</HintPath>
+      <HintPath>&gt;..\..\..\..\trunk\sources\bin\HeuristicLab.ALGLIB-3.6.0.dll</HintPath>
       <Private>False</Private>
     </Reference>
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AverageThresholdCalculator.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AverageThresholdCalculator.cs	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AverageThresholdCalculator.cs	(revision 8814)
@@ -57,7 +57,7 @@
     }
 
-    protected override double GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, int index, double estimatedClassValue) {
+    protected override double GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, int index, double estimatedClassValue, CheckPoint handler) {
       Dataset dataset = solutions.First().ProblemData.Dataset;
-      IList<double> values = solutions.Select(s => s.Model.GetEstimatedValues(dataset, Enumerable.Repeat(index, 1)).First()).ToList();
+      IList<double> values = solutions.Where(s => handler(s.ProblemData, index)).Select(s => s.Model.GetEstimatedValues(dataset, Enumerable.Repeat(index, 1)).First()).ToList();
       if (values.Count <= 0)
         return double.NaN;
@@ -66,13 +66,19 @@
     }
 
-    public override IEnumerable<double> GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue) {
+    public override IEnumerable<double> GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue, CheckPoint handler) {
       Dataset dataset = solutions.First().ProblemData.Dataset;
-      double[][] values = solutions.Select(s => s.Model.GetEstimatedValues(dataset, indices).ToArray()).ToArray();
+      List<int> indicesList = indices.ToList();
+      var solValues = solutions.ToDictionary(x => x, x => x.Model.GetEstimatedValues(dataset, indicesList).ToArray());
       double[] confidences = new double[indices.Count()];
       double[] estimatedClassValueArr = estimatedClassValue.ToArray();
 
-      for (int i = 0; i < indices.Count(); i++) {
-        double avg = values.Select(x => x[i]).Average();
-        confidences[i] = GetAverageConfidence(avg, estimatedClassValueArr[i]);
+      for (int i = 0; i < indicesList.Count; i++) {
+        var values = solValues.Where(x => handler(x.Key.ProblemData, indicesList[i])).Select(x => x.Value[i]);
+        if (values.Count() <= 0) {
+          confidences[i] = double.NaN;
+        } else {
+          double avg = values.Average();
+          confidences[i] = GetAverageConfidence(avg, estimatedClassValueArr[i]);
+        }
       }
 
@@ -84,5 +90,5 @@
         if (estimatedClassValue.Equals(classValues[i])) {
           //special case: avgerage is higher than value of highest class
-          if (i == classValues.Length - 1 && avg > estimatedClassValue) {
+          if (i == classValues.Length - 1 && avg >= estimatedClassValue) {
             return 1;
           }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/ClassificationWeightCalculator.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/ClassificationWeightCalculator.cs	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/ClassificationWeightCalculator.cs	(revision 8814)
@@ -24,5 +24,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Data;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
@@ -112,10 +111,10 @@
     }
 
-    public virtual double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue) {
+    public virtual double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue, CheckPoint handler) {
       if (solutions.Count() < 1)
         return double.NaN;
       Dataset dataset = solutions.First().ProblemData.Dataset;
       var correctSolutions = solutions.Select(s => new { Solution = s, Values = s.Model.GetEstimatedClassValues(dataset, Enumerable.Repeat(index, 1)).First() })
-                                      .Where(a => a.Values.Equals(estimatedClassValue))
+                                      .Where(a => handler(a.Solution.ProblemData, index) && a.Values.Equals(estimatedClassValue))
                                       .Select(a => a.Solution);
       return (from sol in correctSolutions
@@ -123,16 +122,19 @@
     }
 
-    public virtual IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue) {
+    public virtual IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue, CheckPoint handler) {
       if (solutions.Count() < 1)
         return Enumerable.Repeat(double.NaN, indices.Count());
 
+      List<int> indicesList = indices.ToList();
+
       Dataset dataset = solutions.First().ProblemData.Dataset;
-      Dictionary<IClassificationSolution, double[]> solValues = solutions.ToDictionary(x => x, x => x.Model.GetEstimatedClassValues(dataset, indices).ToArray());
+      Dictionary<IClassificationSolution, double[]> solValues = solutions.ToDictionary(x => x, x => x.Model.GetEstimatedClassValues(dataset, indicesList).ToArray());
       double[] estimatedClassValueArr = estimatedClassValue.ToArray();
-      double[] confidences = new double[indices.Count()];
+      double[] confidences = new double[indicesList.Count];
 
-      for (int i = 0; i < indices.Count(); i++) {
+      for (int i = 0; i < indicesList.Count; i++) {
         var correctSolutions = solValues.Where(x => DoubleExtensions.IsAlmost(x.Value[i], estimatedClassValueArr[i]));
         confidences[i] = (from sol in correctSolutions
+                          where handler(sol.Key.ProblemData, indicesList[i])
                           select weights[sol.Key]).Sum();
       }
@@ -142,17 +144,9 @@
 
     #region Helper
-    protected IEnumerable<double> GetValues(IList<double> targetValues, IEnumerable<int> indizes) {
-      return from i in indizes
-             select targetValues[i];
-    }
     protected bool PointInTraining(IClassificationProblemData problemData, int point) {
-      IntRange trainingPartition = problemData.TrainingPartition;
-      IntRange testPartition = problemData.TestPartition;
-      return (trainingPartition.Start <= point && point < trainingPartition.End)
-        && !(testPartition.Start <= point && point < testPartition.End);
+      return problemData.IsTrainingSample(point);
     }
     protected bool PointInTest(IClassificationProblemData problemData, int point) {
-      IntRange testPartition = problemData.TestPartition;
-      return testPartition.Start <= point && point < testPartition.End;
+      return problemData.IsTestSample(point);
     }
     protected bool AllPoints(IClassificationProblemData problemData, int point) {
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/DiscriminantClassificationWeightCalculator.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/DiscriminantClassificationWeightCalculator.cs	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/DiscriminantClassificationWeightCalculator.cs	(revision 8814)
@@ -82,5 +82,5 @@
     }
 
-    public sealed override double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue) {
+    public sealed override double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue, CheckPoint handler) {
       if (solutions.Count() < 1 || !solutions.All(x => x is IDiscriminantFunctionClassificationSolution))
         return double.NaN;
@@ -88,12 +88,12 @@
       IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions = solutions.Cast<IDiscriminantFunctionClassificationSolution>();
 
-      return GetDiscriminantConfidence(discriminantSolutions, index, estimatedClassValue);
+      return GetDiscriminantConfidence(discriminantSolutions, index, estimatedClassValue, handler);
     }
 
-    protected virtual double GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, int index, double estimatedClassValue) {
-      return base.GetConfidence(solutions, index, estimatedClassValue);
+    protected virtual double GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, int index, double estimatedClassValue, CheckPoint handler) {
+      return base.GetConfidence(solutions, index, estimatedClassValue, handler);
     }
 
-    public sealed override IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue) {
+    public sealed override IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue, CheckPoint handler) {
       if (solutions.Count() < 1 || !solutions.All(x => x is IDiscriminantFunctionClassificationSolution))
         return Enumerable.Repeat(double.NaN, indices.Count());
@@ -101,9 +101,9 @@
       IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions = solutions.Cast<IDiscriminantFunctionClassificationSolution>();
 
-      return GetDiscriminantConfidence(discriminantSolutions, indices, estimatedClassValue);
+      return GetDiscriminantConfidence(discriminantSolutions, indices, estimatedClassValue, handler);
     }
 
-    public virtual IEnumerable<double> GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue) {
-      return base.GetConfidence(solutions, indices, estimatedClassValue);
+    public virtual IEnumerable<double> GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue, CheckPoint handler) {
+      return base.GetConfidence(solutions, indices, estimatedClassValue, handler);
     }
   }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MajorityVoteWeightCalculator.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MajorityVoteWeightCalculator.cs	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MajorityVoteWeightCalculator.cs	(revision 8814)
@@ -52,26 +52,32 @@
     }
 
-    public override double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue) {
+    public override double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue, CheckPoint handler) {
       if (solutions.Count() < 1)
         return double.NaN;
-      Dataset dataset = solutions.First().ProblemData.Dataset;
-      int correctEstimated = solutions.Select(s => s.Model.GetEstimatedClassValues(dataset, Enumerable.Repeat(index, 1)).First())
+      var votingSolutions = solutions.Where(s => handler(s.ProblemData, index));
+      if (votingSolutions.Count() < 1)
+        return double.NaN;
+      Dataset dataset = votingSolutions.First().ProblemData.Dataset;
+      int correctEstimated = votingSolutions.Select(s => s.Model.GetEstimatedClassValues(dataset, Enumerable.Repeat(index, 1)).First())
                                       .Where(x => x.Equals(estimatedClassValue))
                                       .Count();
-      return ((double)correctEstimated / (double)solutions.Count() - 0.5) * 2;
+      return ((double)correctEstimated / (double)votingSolutions.Count() - 0.5) * 2;
     }
 
-    public override IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue) {
+    public override IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue, CheckPoint handler) {
       if (solutions.Count() < 1)
         return Enumerable.Repeat(double.NaN, indices.Count());
+
+      List<int> indicesList = indices.ToList();
       Dataset dataset = solutions.First().ProblemData.Dataset;
-      var estimationsPerSolution = solutions.Select(s => s.Model.GetEstimatedClassValues(dataset, indices).ToArray()).ToArray();
+      var solValues = solutions.ToDictionary(x => x, x => x.Model.GetEstimatedClassValues(dataset, indicesList).ToArray());
       double[] estimatedClassValueArr = estimatedClassValue.ToArray();
       double correctEstimated;
       double[] confidences = new double[indices.Count()];
 
-      for (int i = 0; i < indices.Count(); i++) {
-        correctEstimated = estimationsPerSolution.Where(x => DoubleExtensions.IsAlmost(x[i], estimatedClassValueArr[i])).Count();
-        confidences[i] = (correctEstimated / (double)solutions.Count() - 0.5) * 2;
+      for (int i = 0; i < indicesList.Count; i++) {
+        var votingSolutions = solValues.Where(x => handler(x.Key.ProblemData, indicesList[i]));
+        correctEstimated = votingSolutions.Where(x => DoubleExtensions.IsAlmost(x.Value[i], estimatedClassValueArr[i])).Count();
+        confidences[i] = (correctEstimated / (double)votingSolutions.Count() - 0.5) * 2;
       }
 
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MedianThresholdCalculator.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MedianThresholdCalculator.cs	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MedianThresholdCalculator.cs	(revision 8814)
@@ -57,8 +57,7 @@
     }
 
-    protected override double GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, int index, double estimatedClassValue) {
-
+    protected override double GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, int index, double estimatedClassValue, CheckPoint handler) {
       Dataset dataset = solutions.First().ProblemData.Dataset;
-      IList<double> values = solutions.Select(s => s.Model.GetEstimatedValues(dataset, Enumerable.Repeat(index, 1)).First()).ToList();
+      IList<double> values = solutions.Where(s => handler(s.ProblemData, index)).Select(s => s.Model.GetEstimatedValues(dataset, Enumerable.Repeat(index, 1)).First()).ToList();
       if (values.Count <= 0)
         return double.NaN;
@@ -67,14 +66,20 @@
     }
 
-    public override IEnumerable<double> GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue) {
+    public override IEnumerable<double> GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue, CheckPoint handler) {
 
       Dataset dataset = solutions.First().ProblemData.Dataset;
-      double[][] values = solutions.Select(s => s.Model.GetEstimatedValues(dataset, indices).ToArray()).ToArray();
+      List<int> indicesList = indices.ToList();
+      var solValues = solutions.ToDictionary(x => x, x => x.Model.GetEstimatedValues(dataset, indicesList).ToArray());
       double[] confidences = new double[indices.Count()];
       double[] estimatedClassValueArr = estimatedClassValue.ToArray();
 
-      for (int i = 0; i < indices.Count(); i++) {
-        double avg = values.Select(x => x[i]).Average();
-        confidences[i] = GetMedianConfidence(avg, estimatedClassValueArr[i]);
+      for (int i = 0; i < indicesList.Count; i++) {
+        var values = solValues.Where(x => handler(x.Key.ProblemData, indicesList[i])).Select(x => x.Value[i]).ToList();
+        if (values.Count <= 0) {
+          confidences[i] = double.NaN;
+        } else {
+          double median = GetMedian(values);
+          confidences[i] = GetMedianConfidence(median, estimatedClassValueArr[i]);
+        }
       }
 
@@ -85,26 +90,26 @@
       for (int i = 0; i < classValues.Length; i++) {
         if (estimatedClassValue.Equals(classValues[i])) {
-          //special case: avgerage is higher than value of highest class
-          if (i == classValues.Length - 1 && median > estimatedClassValue) {
+          //special case: median is higher than value of highest class
+          if (i == classValues.Length - 1 && median >= estimatedClassValue) {
             return 1;
           }
-          //special case: average is lower than value of lowest class
+          //special case: median is lower than value of lowest class
           if (i == 0 && median < estimatedClassValue) {
             return 1;
           }
-          //special case: average is not between threshold of estimated class value
+          //special case: median is not between threshold of estimated class value
           if ((i < classValues.Length - 1 && median >= threshold[i + 1]) || median <= threshold[i]) {
             return 0;
           }
 
-          double thresholdToClassDistance, thresholdToAverageValueDistance;
+          double thresholdToClassDistance, thresholdToMedianValueDistance;
           if (median >= classValues[i]) {
             thresholdToClassDistance = threshold[i + 1] - classValues[i];
-            thresholdToAverageValueDistance = threshold[i + 1] - median;
+            thresholdToMedianValueDistance = threshold[i + 1] - median;
           } else {
             thresholdToClassDistance = classValues[i] - threshold[i];
-            thresholdToAverageValueDistance = median - threshold[i];
+            thresholdToMedianValueDistance = median - threshold[i];
           }
-          return (1 / thresholdToClassDistance) * thresholdToAverageValueDistance;
+          return (1 / thresholdToClassDistance) * thresholdToMedianValueDistance;
         }
       }
Index: /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolutionWeightCalculator.cs
===================================================================
--- /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolutionWeightCalculator.cs	(revision 8813)
+++ /branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolutionWeightCalculator.cs	(revision 8814)
@@ -29,6 +29,6 @@
     void CalculateNormalizedWeights(IEnumerable<IClassificationSolution> classificationSolutions);
     IEnumerable<double> AggregateEstimatedClassValues(IEnumerable<IClassificationSolution> solutions, Dataset dataset, IEnumerable<int> rows, CheckPoint handler);
-    double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue);
-    IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue);
+    double GetConfidence(IEnumerable<IClassificationSolution> solutions, int index, double estimatedClassValue, CheckPoint handler);
+    IEnumerable<double> GetConfidence(IEnumerable<IClassificationSolution> solutions, IEnumerable<int> indices, IEnumerable<double> estimatedClassValue, CheckPoint handler);
 
     CheckPoint GetTestClassDelegate();
