Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs	(revision 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs	(revision 7549)
@@ -46,13 +46,13 @@
     }
 
-    private readonly ItemCollection<IClassificationSolution> classificationSolutions;
-    public IItemCollection<IClassificationSolution> ClassificationSolutions {
+    private readonly CheckedItemCollection<IClassificationSolution> classificationSolutions;
+    public ICheckedItemCollection<IClassificationSolution> ClassificationSolutions {
       get { return classificationSolutions; }
     }
 
-    [Storable]
-    private Dictionary<IClassificationModel, IntRange> trainingPartitions;
-    [Storable]
-    private Dictionary<IClassificationModel, IntRange> testPartitions;
+    //[Storable]
+    //private Dictionary<IClassificationModel, IntRange> trainingPartitions;
+    //[Storable]
+    //private Dictionary<IClassificationModel, IntRange> testPartitions;
 
     private IClassificationEnsembleSolutionWeightCalculator weightCalculator;
@@ -62,5 +62,4 @@
         if (value != null) {
           weightCalculator = value;
-          weightCalculator.CalculateNormalizedWeights(classificationSolutions);
           if (!ProblemData.IsEmpty)
             RecalculateResults();
@@ -72,5 +71,5 @@
     private ClassificationEnsembleSolution(bool deserializing)
       : base(deserializing) {
-      classificationSolutions = new ItemCollection<IClassificationSolution>();
+      classificationSolutions = new CheckedItemCollection<IClassificationSolution>();
     }
     [StorableHook(HookType.AfterDeserialization)]
@@ -78,8 +77,8 @@
       foreach (var model in Model.Models) {
         IClassificationProblemData problemData = (IClassificationProblemData)ProblemData.Clone();
-        problemData.TrainingPartition.Start = trainingPartitions[model].Start;
-        problemData.TrainingPartition.End = trainingPartitions[model].End;
-        problemData.TestPartition.Start = testPartitions[model].Start;
-        problemData.TestPartition.End = testPartitions[model].End;
+        //problemData.TrainingPartition.Start = trainingPartitions[model].Start;
+        //problemData.TrainingPartition.End = trainingPartitions[model].End;
+        //problemData.TestPartition.Start = testPartitions[model].Start;
+        //problemData.TestPartition.End = testPartitions[model].End;
 
         classificationSolutions.Add(model.CreateClassificationSolution(problemData));
@@ -90,12 +89,12 @@
     private ClassificationEnsembleSolution(ClassificationEnsembleSolution original, Cloner cloner)
       : base(original, cloner) {
-      trainingPartitions = new Dictionary<IClassificationModel, IntRange>();
-      testPartitions = new Dictionary<IClassificationModel, IntRange>();
-      foreach (var pair in original.trainingPartitions) {
-        trainingPartitions[cloner.Clone(pair.Key)] = cloner.Clone(pair.Value);
-      }
-      foreach (var pair in original.testPartitions) {
-        testPartitions[cloner.Clone(pair.Key)] = cloner.Clone(pair.Value);
-      }
+      //trainingPartitions = new Dictionary<IClassificationModel, IntRange>();
+      //testPartitions = new Dictionary<IClassificationModel, IntRange>();
+      //foreach (var pair in original.trainingPartitions) {
+      //  trainingPartitions[cloner.Clone(pair.Key)] = cloner.Clone(pair.Value);
+      //}
+      //foreach (var pair in original.testPartitions) {
+      //  testPartitions[cloner.Clone(pair.Key)] = cloner.Clone(pair.Value);
+      //}
 
       classificationSolutions = cloner.Clone(original.classificationSolutions);
@@ -105,7 +104,7 @@
     public ClassificationEnsembleSolution()
       : base(new ClassificationEnsembleModel(), ClassificationEnsembleProblemData.EmptyProblemData) {
-      trainingPartitions = new Dictionary<IClassificationModel, IntRange>();
-      testPartitions = new Dictionary<IClassificationModel, IntRange>();
-      classificationSolutions = new ItemCollection<IClassificationSolution>();
+      //trainingPartitions = new Dictionary<IClassificationModel, IntRange>();
+      //testPartitions = new Dictionary<IClassificationModel, IntRange>();
+      classificationSolutions = new CheckedItemCollection<IClassificationSolution>();
 
       weightCalculator = new MajorityVoteWeightCalculator();
@@ -122,7 +121,7 @@
     public ClassificationEnsembleSolution(IEnumerable<IClassificationModel> models, IClassificationProblemData problemData, IEnumerable<IntRange> trainingPartitions, IEnumerable<IntRange> testPartitions)
       : base(new ClassificationEnsembleModel(Enumerable.Empty<IClassificationModel>()), new ClassificationEnsembleProblemData(problemData)) {
-      this.trainingPartitions = new Dictionary<IClassificationModel, IntRange>();
-      this.testPartitions = new Dictionary<IClassificationModel, IntRange>();
-      this.classificationSolutions = new ItemCollection<IClassificationSolution>();
+      //this.trainingPartitions = new Dictionary<IClassificationModel, IntRange>();
+      //this.testPartitions = new Dictionary<IClassificationModel, IntRange>();
+      this.classificationSolutions = new CheckedItemCollection<IClassificationSolution>();
 
       List<IClassificationSolution> solutions = new List<IClassificationSolution>();
@@ -155,7 +154,9 @@
       classificationSolutions.ItemsRemoved += new CollectionItemsChangedEventHandler<IClassificationSolution>(classificationSolutions_ItemsRemoved);
       classificationSolutions.CollectionReset += new CollectionItemsChangedEventHandler<IClassificationSolution>(classificationSolutions_CollectionReset);
+      classificationSolutions.CheckedItemsChanged += new CollectionItemsChangedEventHandler<IClassificationSolution>(classificationSolutions_CheckedItemsChanged);
     }
 
     protected override void RecalculateResults() {
+      weightCalculator.CalculateNormalizedWeights(classificationSolutions.CheckedItems);
       CalculateResults();
     }
@@ -163,28 +164,32 @@
     #region Evaluation
     public override IEnumerable<double> EstimatedTrainingClassValues {
-      get { return weightCalculator.AggregateEstimatedClassValues(Model.Models, ProblemData.Dataset, ProblemData.TrainingIndizes); }
+      get {
+        return weightCalculator.AggregateEstimatedClassValues(classificationSolutions.CheckedItems,
+                                                              ProblemData.Dataset,
+                                                              ProblemData.TrainingIndizes,
+                                                              weightCalculator.GetTrainingClassDelegate());
+      }
     }
 
     public override IEnumerable<double> EstimatedTestClassValues {
-      get { return weightCalculator.AggregateEstimatedClassValues(Model.Models, ProblemData.Dataset, ProblemData.TestIndizes); }
-    }
-
-    private bool RowIsTrainingForModel(int currentRow, IClassificationModel model) {
-      return trainingPartitions == null || !trainingPartitions.ContainsKey(model) ||
-              (trainingPartitions[model].Start <= currentRow && currentRow < trainingPartitions[model].End);
-    }
-
-    private bool RowIsTestForModel(int currentRow, IClassificationModel model) {
-      return testPartitions == null || !testPartitions.ContainsKey(model) ||
-              (testPartitions[model].Start <= currentRow && currentRow < testPartitions[model].End);
+      get {
+        return weightCalculator.AggregateEstimatedClassValues(classificationSolutions.CheckedItems,
+                                                              ProblemData.Dataset,
+                                                              ProblemData.TestIndizes,
+                                                              weightCalculator.GetTestClassDelegate());
+      }
     }
 
     public override IEnumerable<double> GetEstimatedClassValues(IEnumerable<int> rows) {
-      return weightCalculator.AggregateEstimatedClassValues(Model.Models, ProblemData.Dataset, rows);
+      return weightCalculator.AggregateEstimatedClassValues(classificationSolutions.CheckedItems,
+                                                            ProblemData.Dataset,
+                                                            rows,
+                                                            weightCalculator.GetAllClassDelegate());
     }
 
     public IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors(Dataset dataset, IEnumerable<int> rows) {
-      if (!Model.Models.Any()) yield break;
-      var estimatedValuesEnumerators = (from model in Model.Models
+      IEnumerable<IClassificationModel> models = classificationSolutions.CheckedItems.Select(sol => sol.Model);
+      if (!models.Any()) yield break;
+      var estimatedValuesEnumerators = (from model in models
                                         select model.GetEstimatedClassValues(dataset, rows).GetEnumerator())
                                        .ToList();
@@ -212,12 +217,12 @@
           solution.ProblemData = problemData;
       }
-      foreach (var trainingPartition in trainingPartitions.Values) {
-        trainingPartition.Start = ProblemData.TrainingPartition.Start;
-        trainingPartition.End = ProblemData.TrainingPartition.End;
-      }
-      foreach (var testPartition in testPartitions.Values) {
-        testPartition.Start = ProblemData.TestPartition.Start;
-        testPartition.End = ProblemData.TestPartition.End;
-      }
+      //foreach (var trainingPartition in trainingPartitions.Values) {
+      //  trainingPartition.Start = ProblemData.TrainingPartition.Start;
+      //  trainingPartition.End = ProblemData.TrainingPartition.End;
+      //}
+      //foreach (var testPartition in testPartitions.Values) {
+      //  testPartition.Start = ProblemData.TestPartition.Start;
+      //  testPartition.End = ProblemData.TestPartition.End;
+      //}
 
       base.OnProblemDataChanged();
@@ -244,11 +249,13 @@
       RecalculateResults();
     }
+    private void classificationSolutions_CheckedItemsChanged(object sender, CollectionItemsChangedEventArgs<IClassificationSolution> e) {
+      RecalculateResults();
+    }
 
     private void AddClassificationSolution(IClassificationSolution solution) {
       if (Model.Models.Contains(solution.Model)) throw new ArgumentException();
       Model.Add(solution.Model);
-      trainingPartitions[solution.Model] = solution.ProblemData.TrainingPartition;
-      testPartitions[solution.Model] = solution.ProblemData.TestPartition;
-      weightCalculator.CalculateNormalizedWeights(classificationSolutions);
+      //trainingPartitions[solution.Model] = solution.ProblemData.TrainingPartition;
+      //testPartitions[solution.Model] = solution.ProblemData.TestPartition;
     }
 
@@ -256,7 +263,6 @@
       if (!Model.Models.Contains(solution.Model)) throw new ArgumentException();
       Model.Remove(solution.Model);
-      trainingPartitions.Remove(solution.Model);
-      testPartitions.Remove(solution.Model);
-      weightCalculator.CalculateNormalizedWeights(classificationSolutions);
+      //trainingPartitions.Remove(solution.Model);
+      //testPartitions.Remove(solution.Model);
     }
   }
Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AccuracyWeightCalculator.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AccuracyWeightCalculator.cs	(revision 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AccuracyWeightCalculator.cs	(revision 7549)
@@ -46,5 +46,5 @@
     }
 
-    protected override IEnumerable<double> CalculateWeights(ItemCollection<IClassificationSolution> classificationSolutions) {
+    protected override IEnumerable<double> CalculateWeights(IEnumerable<IClassificationSolution> classificationSolutions) {
       return classificationSolutions.Select(s => s.TrainingAccuracy);
     }
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 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/ClassificationWeightCalculator.cs	(revision 7549)
@@ -20,9 +20,9 @@
 #endregion
 
-using System;
 using System.Collections.Generic;
 using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Data;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.DataAnalysis.Interfaces.Classification;
@@ -45,5 +45,5 @@
     }
 
-    private IEnumerable<double> weights;
+    private IDictionary<IClassificationSolution, double> weights;
 
     /// <summary>
@@ -52,29 +52,40 @@
     /// <param name="classificationSolutions"></param>
     /// <returns>weights which are equal or bigger than zero</returns>
-    public void CalculateNormalizedWeights(ItemCollection<IClassificationSolution> classificationSolutions) {
+    public void CalculateNormalizedWeights(IEnumerable<IClassificationSolution> classificationSolutions) {
       List<double> weights = new List<double>();
-      if (classificationSolutions.Count > 0) {
+      if (classificationSolutions.Count() > 0) {
         foreach (var weight in CalculateWeights(classificationSolutions)) {
           weights.Add(weight >= 0 ? weight : 0);
         }
       }
-      this.weights = weights.Select(x => x / weights.Sum());
+      double sum = weights.Sum();
+      this.weights = classificationSolutions.Zip(weights, (sol, wei) => new { sol, wei }).ToDictionary(x => x.sol, x => x.wei / sum);
     }
 
-    protected abstract IEnumerable<double> CalculateWeights(ItemCollection<IClassificationSolution> classificationSolutions);
+    protected abstract IEnumerable<double> CalculateWeights(IEnumerable<IClassificationSolution> classificationSolutions);
 
-    public virtual IEnumerable<double> AggregateEstimatedClassValues(IEnumerable<IClassificationModel> models, Dataset dataset, IEnumerable<int> rows) {
-      return from xs in ClassificationWeightCalculator.GetEstimatedClassValues(models, dataset, rows)
+    #region delegate CheckPoint
+    public CheckPoint GetTestClassDelegate() {
+      return PointInTest;
+    }
+    public CheckPoint GetTrainingClassDelegate() {
+      return PointInTraining;
+    }
+    public CheckPoint GetAllClassDelegate() {
+      return AllPoints;
+    }
+    #endregion
+
+    public virtual IEnumerable<double> AggregateEstimatedClassValues(IEnumerable<IClassificationSolution> solutions, Dataset dataset, IEnumerable<int> rows, CheckPoint handler) {
+      return from xs in GetEstimatedClassValues(solutions, dataset, rows, handler)
              select AggregateEstimatedClassValues(xs);
     }
 
-    protected double AggregateEstimatedClassValues(IEnumerable<double> estimatedClassValues) {
-      if (!estimatedClassValues.Count().Equals(weights.Count()))
-        throw new ArgumentException("'estimatedClassValues' has " + estimatedClassValues.Count() + " elements, while 'weights' has" + weights.Count());
+    protected double AggregateEstimatedClassValues(IDictionary<IClassificationSolution, double> estimatedClassValues) {
       IDictionary<double, double> weightSum = new Dictionary<double, double>();
-      for (int i = 0; i < estimatedClassValues.Count(); i++) {
-        if (!weightSum.ContainsKey(estimatedClassValues.ElementAt(i)))
-          weightSum[estimatedClassValues.ElementAt(i)] = 0.0;
-        weightSum[estimatedClassValues.ElementAt(i)] += weights.ElementAt(i);
+      foreach (var item in estimatedClassValues) {
+        if (!weightSum.ContainsKey(item.Value))
+          weightSum[item.Value] = 0.0;
+        weightSum[item.Value] += weights[item.Key];
       }
       if (weightSum.Count <= 0)
@@ -88,13 +99,16 @@
     }
 
-    protected static IEnumerable<IEnumerable<double>> GetEstimatedClassValues(IEnumerable<IClassificationModel> models, Dataset dataset, IEnumerable<int> rows) {
-      if (!models.Any()) yield break;
-      var estimatedValuesEnumerators = (from model in models
-                                        select model.GetEstimatedClassValues(dataset, rows).GetEnumerator())
+    protected IEnumerable<IDictionary<IClassificationSolution, double>> GetEstimatedClassValues(IEnumerable<IClassificationSolution> solutions, Dataset dataset, IEnumerable<int> rows, CheckPoint handler) {
+      if (!solutions.Any()) yield break;
+      var estimatedValuesEnumerators = (from solution in solutions
+                                        select new { Solution = solution, EstimatedValuesEnumerator = solution.Model.GetEstimatedClassValues(dataset, rows).GetEnumerator() })
                                        .ToList();
 
-      while (estimatedValuesEnumerators.All(en => en.MoveNext())) {
-        yield return from enumerator in estimatedValuesEnumerators
-                     select enumerator.Current;
+      var rowEnumerator = rows.GetEnumerator();
+      while (rowEnumerator.MoveNext() & estimatedValuesEnumerators.All(x => x.EstimatedValuesEnumerator.MoveNext())) {
+        yield return (from enumerator in estimatedValuesEnumerators
+                      where handler(enumerator.Solution.ProblemData, rowEnumerator.Current)
+                      select enumerator)
+                     .ToDictionary(x => x.Solution, x => x.EstimatedValuesEnumerator.Current);
       }
     }
@@ -105,4 +119,17 @@
              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);
+    }
+    protected bool PointInTest(IClassificationProblemData problemData, int point) {
+      IntRange testPartition = problemData.TestPartition;
+      return testPartition.Start <= point && point < testPartition.End;
+    }
+    protected bool AllPoints(IClassificationProblemData problemData, int point) {
+      return true;
+    }
     #endregion
   }
Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/ContinuousPointCertaintyWeightCalculator.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/ContinuousPointCertaintyWeightCalculator.cs	(revision 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/ContinuousPointCertaintyWeightCalculator.cs	(revision 7549)
@@ -49,13 +49,13 @@
     }
 
-    protected override IEnumerable<double> DiscriminantCalculateWeights(ItemCollection<IDiscriminantFunctionClassificationSolution> discriminantSolutions) {
+    protected override IEnumerable<double> DiscriminantCalculateWeights(IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions) {
       List<double> weights = new List<double>();
       IClassificationProblemData problemData = discriminantSolutions.ElementAt(0).ProblemData;
-      IEnumerable<double> targetValues = GetValues(problemData.Dataset.GetDoubleValues(problemData.TargetVariable).ToList(), problemData.TrainingIndizes);
+      IEnumerable<double> targetValues;
       IEnumerator<double> trainingValues;
 
       //only works for binary classification
       if (!problemData.ClassValues.Count().Equals(2))
-        return Enumerable.Repeat<double>(1, discriminantSolutions.Count);
+        return Enumerable.Repeat<double>(1, discriminantSolutions.Count());
 
       double maxClass = problemData.ClassValues.Max();
@@ -64,11 +64,13 @@
 
       foreach (var solution in discriminantSolutions) {
+        problemData = solution.ProblemData;
+        targetValues = GetValues(problemData.Dataset.GetDoubleValues(problemData.TargetVariable).ToList(), problemData.TrainingIndizes);
+        trainingValues = targetValues.GetEnumerator();
+
         IEnumerator<double> estimatedTrainingVal = solution.EstimatedTrainingValues.GetEnumerator();
         IEnumerator<double> estimatedTrainingClassVal = solution.EstimatedTrainingClassValues.GetEnumerator();
 
-        trainingValues = targetValues.GetEnumerator();
         double curWeight = 0.0;
         while (estimatedTrainingVal.MoveNext() && estimatedTrainingClassVal.MoveNext() && trainingValues.MoveNext()) {
-          //if (estimatedTrainingClassVal.Current.Equals(trainingValues.Current)) {
           if (trainingValues.Current.Equals(maxClass)) {
             if (estimatedTrainingVal.Current >= maxClass)
@@ -86,7 +88,7 @@
             }
           }
-          //}
         }
-        weights.Add(curWeight);
+        // normalize the weight (otherwise a model with a bigger training partition would probably be better)
+        weights.Add(curWeight / targetValues.Count());
       }
       return weights;
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 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/DiscriminantClassificationWeightCalculator.cs	(revision 7549)
@@ -23,6 +23,6 @@
 using System.Linq;
 using HeuristicLab.Common;
-using HeuristicLab.Core;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis.Interfaces.Classification;
 
 namespace HeuristicLab.Problems.DataAnalysis {
@@ -41,26 +41,23 @@
     }
 
-    protected override IEnumerable<double> CalculateWeights(ItemCollection<IClassificationSolution> classificationSolutions) {
+    protected override IEnumerable<double> CalculateWeights(IEnumerable<IClassificationSolution> classificationSolutions) {
       if (!classificationSolutions.All(x => x is IDiscriminantFunctionClassificationSolution))
-        return Enumerable.Repeat<double>(1.0, classificationSolutions.Count);
+        return Enumerable.Repeat<double>(1.0, classificationSolutions.Count());
 
-      ItemCollection<IDiscriminantFunctionClassificationSolution> discriminantSolutions = new ItemCollection<IDiscriminantFunctionClassificationSolution>();
-      foreach (var solution in classificationSolutions) {
-        discriminantSolutions.Add((IDiscriminantFunctionClassificationSolution)solution);
-      }
+      IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions = classificationSolutions.Cast<IDiscriminantFunctionClassificationSolution>();
 
       return DiscriminantCalculateWeights(discriminantSolutions);
     }
 
-    protected abstract IEnumerable<double> DiscriminantCalculateWeights(ItemCollection<IDiscriminantFunctionClassificationSolution> discriminantSolutions);
+    protected abstract IEnumerable<double> DiscriminantCalculateWeights(IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions);
 
-    public override IEnumerable<double> AggregateEstimatedClassValues(IEnumerable<IClassificationModel> models, Dataset dataset, IEnumerable<int> rows) {
-      if (!models.All(x => x is IDiscriminantFunctionClassificationModel))
+    public override IEnumerable<double> AggregateEstimatedClassValues(IEnumerable<IClassificationSolution> solutions, Dataset dataset, IEnumerable<int> rows, CheckPoint handler) {
+      if (!solutions.All(x => x is IDiscriminantFunctionClassificationSolution))
         return Enumerable.Repeat<double>(0.0, rows.Count());
 
-      IEnumerable<IDiscriminantFunctionClassificationModel> discriminantModels = models.Cast<IDiscriminantFunctionClassificationModel>();
+      IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions = solutions.Cast<IDiscriminantFunctionClassificationSolution>();
 
-      IEnumerable<IEnumerable<double>> estimatedClassValues = ClassificationWeightCalculator.GetEstimatedClassValues(models, dataset, rows);
-      IEnumerable<IEnumerable<double>> estimatedValues = DiscriminantClassificationWeightCalculator.GetEstimatedValues(discriminantModels, dataset, rows);
+      IEnumerable<IDictionary<IClassificationSolution, double>> estimatedClassValues = GetEstimatedClassValues(solutions, dataset, rows, handler);
+      IEnumerable<IDictionary<IClassificationSolution, double>> estimatedValues = GetEstimatedValues(discriminantSolutions, dataset, rows, handler);
 
       return from zip in estimatedClassValues.Zip(estimatedValues, (classValues, values) => new { ClassValues = classValues, Values = values })
@@ -68,17 +65,20 @@
     }
 
-    protected virtual double DiscriminantAggregateEstimatedClassValues(IEnumerable<double> estimatedClassValues, IEnumerable<double> estimatedValues) {
+    protected virtual double DiscriminantAggregateEstimatedClassValues(IDictionary<IClassificationSolution, double> estimatedClassValues, IDictionary<IClassificationSolution, double> estimatedValues) {
       return AggregateEstimatedClassValues(estimatedClassValues);
     }
 
-    protected static IEnumerable<IEnumerable<double>> GetEstimatedValues(IEnumerable<IDiscriminantFunctionClassificationModel> models, Dataset dataset, IEnumerable<int> rows) {
-      if (!models.Any()) yield break;
-      var estimatedValuesEnumerators = (from model in models
-                                        select model.GetEstimatedValues(dataset, rows).GetEnumerator())
-                                       .ToList();
+    protected IEnumerable<IDictionary<IClassificationSolution, double>> GetEstimatedValues(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, Dataset dataset, IEnumerable<int> rows, CheckPoint handler) {
+      if (!solutions.Any()) yield break;
+      var estimatedValuesEnumerators = (from solution in solutions
+                                        select new { Solution = solution, EstimatedValuesEnumerator = solution.Model.GetEstimatedClassValues(dataset, rows).GetEnumerator() })
+                                        .ToList();
 
-      while (estimatedValuesEnumerators.All(en => en.MoveNext())) {
-        yield return from enumerator in estimatedValuesEnumerators
-                     select enumerator.Current;
+      var rowEnumerator = rows.GetEnumerator();
+      while (rowEnumerator.MoveNext() && estimatedValuesEnumerators.All(x => x.EstimatedValuesEnumerator.MoveNext())) {
+        yield return (from enumerator in estimatedValuesEnumerators
+                      where handler(enumerator.Solution.ProblemData, rowEnumerator.Current)
+                      select enumerator)
+                      .ToDictionary(x => (IClassificationSolution)x.Solution, x => x.EstimatedValuesEnumerator.Current);
       }
     }
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 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MajorityVoteWeightCalculator.cs	(revision 7549)
@@ -48,6 +48,6 @@
     }
 
-    protected override IEnumerable<double> CalculateWeights(ItemCollection<IClassificationSolution> classificationSolutions) {
-      return Enumerable.Repeat<double>(1, classificationSolutions.Count);
+    protected override IEnumerable<double> CalculateWeights(IEnumerable<IClassificationSolution> classificationSolutions) {
+      return Enumerable.Repeat<double>(1, classificationSolutions.Count());
     }
   }
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 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MedianThresholdCalculator.cs	(revision 7549)
@@ -46,33 +46,51 @@
     protected double[] classValues;
 
-    protected override IEnumerable<double> DiscriminantCalculateWeights(ItemCollection<IDiscriminantFunctionClassificationSolution> discriminantSolutions) {
-      List<List<double>> estimatedTrainingValEnumerators = new List<List<double>>();
-      List<List<double>> estimatedTrainingClassValEnumerators = new List<List<double>>();
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="discriminantSolutions"></param>
+    /// <returns>median instead of weights, because it doesn't use any weights</returns>
+    protected override IEnumerable<double> DiscriminantCalculateWeights(IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions) {
+      List<List<double>> estimatedValues = new List<List<double>>();
+      List<List<double>> estimatedClassValues = new List<List<double>>();
+
+      List<IClassificationProblemData> solutionProblemData = discriminantSolutions.Select(sol => sol.ProblemData).ToList();
+      Dataset dataSet = solutionProblemData[0].Dataset;
+      IEnumerable<int> rows = Enumerable.Range(0, dataSet.Rows);
       foreach (var solution in discriminantSolutions) {
-        estimatedTrainingValEnumerators.Add(solution.EstimatedTrainingValues.ToList());
-        estimatedTrainingClassValEnumerators.Add(solution.EstimatedTrainingClassValues.ToList());
+        estimatedValues.Add(solution.Model.GetEstimatedValues(dataSet, rows).ToList());
+        estimatedClassValues.Add(solution.Model.GetEstimatedValues(dataSet, rows).ToList());
       }
 
       List<double> median = new List<double>();
-
-      IClassificationProblemData problemData = discriminantSolutions.ElementAt(0).ProblemData;
-      List<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable).ToList();
-      IEnumerable<double> trainingVal = GetValues(targetValues, problemData.TrainingIndizes);
-
-      for (int i = 0; i < estimatedTrainingClassValEnumerators.First().Count; i++) {
-        var points = (from solution in estimatedTrainingValEnumerators
-                      select solution[i])
-                      .OrderBy(p => p)
-                      .ToList();
-
-        median.Add(GetMedian(points));
+      List<double> targetValues = dataSet.GetDoubleValues(solutionProblemData[0].TargetVariable).ToList();
+      IList<double> curTrainingpoints = new List<double>();
+      int removed = 0;
+      int count = targetValues.Count;
+      for (int point = 0; point < count; point++) {
+        curTrainingpoints.Clear();
+        for (int solutionPos = 0; solutionPos < solutionProblemData.Count; solutionPos++) {
+          if (PointInTraining(solutionProblemData[solutionPos], point)) {
+            curTrainingpoints.Add(estimatedValues[solutionPos][point]);
+          }
+        }
+        if (curTrainingpoints.Count > 0)
+          median.Add(GetMedian(curTrainingpoints.OrderBy(p => p).ToList()));
+        else {
+          //remove not used points
+          targetValues.RemoveAt(point - removed);
+          removed++;
+        }
       }
-      AccuracyMaximizationThresholdCalculator.CalculateThresholds(problemData, median, trainingVal, out classValues, out threshold);
+      AccuracyMaximizationThresholdCalculator.CalculateThresholds(solutionProblemData[0], median, targetValues, out classValues, out threshold);
       return median;
     }
 
-    protected override double DiscriminantAggregateEstimatedClassValues(IEnumerable<double> estimatedClassValues, IEnumerable<double> estimatedValues) {
+    protected override double DiscriminantAggregateEstimatedClassValues(IDictionary<IClassificationSolution, double> estimatedClassValues, IDictionary<IClassificationSolution, double> estimatedValues) {
       double classValue = classValues.First();
-      double median = GetMedian(estimatedValues.ToList());
+      IList<double> values = estimatedValues.Select(x => x.Value).ToList();
+      if (values.Count <= 0)
+        return double.NaN;
+      double median = GetMedian(values);
       for (int i = 0; i < classValues.Count(); i++) {
         if (median > threshold[i])
@@ -87,7 +105,7 @@
       int count = estimatedValues.Count;
       if (count % 2 == 0)
-        return 0.5 * (estimatedValues[count / 2] + estimatedValues[count / 2 + 1]);
+        return 0.5 * (estimatedValues[count / 2 - 1] + estimatedValues[count / 2]);
       else
-        return estimatedValues[(count + 1) / 2];
+        return estimatedValues[count / 2];
     }
   }
Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/NeighbourhoodWeightCalculator.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/NeighbourhoodWeightCalculator.cs	(revision 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/NeighbourhoodWeightCalculator.cs	(revision 7549)
@@ -49,37 +49,44 @@
     }
 
-    protected override IEnumerable<double> DiscriminantCalculateWeights(ItemCollection<IDiscriminantFunctionClassificationSolution> discriminantSolutions) {
-      List<List<double>> estimatedTrainingValEnumerators = new List<List<double>>();
-      List<List<double>> estimatedTrainingClassValEnumerators = new List<List<double>>();
+    protected override IEnumerable<double> DiscriminantCalculateWeights(IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions) {
+      List<List<double>> estimatedValues = new List<List<double>>();
+      List<List<double>> estimatedClassValues = new List<List<double>>();
+
+      List<IClassificationProblemData> solutionProblemData = discriminantSolutions.Select(sol => sol.ProblemData).ToList();
+      Dataset dataSet = solutionProblemData[0].Dataset;
+      IEnumerable<int> rows = Enumerable.Range(0, dataSet.Rows);
       foreach (var solution in discriminantSolutions) {
-        estimatedTrainingValEnumerators.Add(solution.EstimatedTrainingValues.ToList());
-        estimatedTrainingClassValEnumerators.Add(solution.EstimatedTrainingClassValues.ToList());
+        estimatedValues.Add(solution.Model.GetEstimatedValues(dataSet, rows).ToList());
+        estimatedClassValues.Add(solution.Model.GetEstimatedValues(dataSet, rows).ToList());
       }
 
-      List<double> weights = Enumerable.Repeat<double>(0, discriminantSolutions.Count()).ToList<double>();
-
-      IClassificationProblemData problemData = discriminantSolutions.ElementAt(0).ProblemData;
-      List<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable).ToList();
-      List<double> trainingVal = GetValues(targetValues, problemData.TrainingIndizes).ToList();
+      List<double> weights = Enumerable.Repeat<double>(0, solutionProblemData.Count).ToList<double>();
+      List<double> targetValues = dataSet.GetDoubleValues(solutionProblemData[0].TargetVariable).ToList();
 
       double pointAvg, help;
       int count;
-      for (int point = 0; point < estimatedTrainingClassValEnumerators.First().Count; point++) {
+      for (int point = 0; point < targetValues.Count; point++) {
         pointAvg = 0.0;
         count = 0;
-        for (int solution = 0; solution < estimatedTrainingClassValEnumerators.Count; solution++) {
-          if (estimatedTrainingClassValEnumerators[solution][point].Equals(targetValues[point])) {
-            pointAvg += estimatedTrainingValEnumerators[solution][point];
+        for (int solutionPos = 0; solutionPos < estimatedClassValues.Count; solutionPos++) {
+          if (PointInTraining(solutionProblemData[solutionPos], point)
+              && estimatedClassValues[solutionPos][point].Equals(targetValues[point])) {
+            pointAvg += estimatedValues[solutionPos][point];
             count++;
           }
         }
         pointAvg /= (double)count;
-        for (int solution = 0; solution < estimatedTrainingClassValEnumerators.Count; solution++) {
-          if (estimatedTrainingClassValEnumerators[solution][point].Equals(targetValues[point])) {
-            weights[solution] += 0.5;
-            help = Math.Abs(estimatedTrainingValEnumerators[solution][point] - 0.5);
-            weights[solution] += help < 0.5 ? 0.5 - help : 0.0;
+        for (int solutionPos = 0; solutionPos < estimatedClassValues.Count; solutionPos++) {
+          if (PointInTraining(solutionProblemData[solutionPos], point)
+              && estimatedClassValues[solutionPos][point].Equals(targetValues[point])) {
+            weights[solutionPos] += 0.5;
+            help = Math.Abs(estimatedValues[solutionPos][point] - 0.5);
+            weights[solutionPos] += help < 0.5 ? 0.5 - help : 0.0;
           }
         }
+      }
+      // normalize the weight (otherwise a model with a bigger training partition would probably be better)
+      for (int i = 0; i < weights.Count; i++) {
+        weights[i] = weights[i] / solutionProblemData[i].TrainingIndizes.Count();
       }
       return weights;
Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/PointCertaintyWeightCalculator.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/PointCertaintyWeightCalculator.cs	(revision 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/PointCertaintyWeightCalculator.cs	(revision 7549)
@@ -44,16 +44,21 @@
     }
 
-    protected override IEnumerable<double> DiscriminantCalculateWeights(ItemCollection<IDiscriminantFunctionClassificationSolution> discriminantSolutions) {
+    protected override IEnumerable<double> DiscriminantCalculateWeights(IEnumerable<IDiscriminantFunctionClassificationSolution> discriminantSolutions) {
       List<double> weights = new List<double>();
       IClassificationProblemData problemData = discriminantSolutions.ElementAt(0).ProblemData;
-      IEnumerable<double> targetValues = GetValues(problemData.Dataset.GetDoubleValues(problemData.TargetVariable).ToList(), problemData.TrainingIndizes);
-      IEnumerator<double> trainingValues;
+      // class Values are the same in all problem data sets
       double avg = problemData.ClassValues.Average();
 
+      IEnumerable<double> targetValues;
+      IEnumerator<double> trainingValues;
+
       foreach (var solution in discriminantSolutions) {
+        problemData = solution.ProblemData;
+        targetValues = GetValues(problemData.Dataset.GetDoubleValues(problemData.TargetVariable).ToList(), problemData.TrainingIndizes);
+        trainingValues = targetValues.GetEnumerator();
+
         IEnumerator<double> estimatedTrainingVal = solution.EstimatedTrainingValues.GetEnumerator();
         IEnumerator<double> estimatedTrainingClassVal = solution.EstimatedTrainingClassValues.GetEnumerator();
 
-        trainingValues = targetValues.GetEnumerator();
         double curWeight = 0.0;
         while (estimatedTrainingVal.MoveNext() && estimatedTrainingClassVal.MoveNext() && trainingValues.MoveNext()) {
@@ -67,5 +72,6 @@
           }
         }
-        weights.Add(curWeight);
+        // normalize the weight (otherwise a model with a bigger training partition would probably be better)
+        weights.Add(curWeight / targetValues.Count());
       }
       return weights;
Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolution.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolution.cs	(revision 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolution.cs	(revision 7549)
@@ -25,5 +25,5 @@
   public interface IClassificationEnsembleSolution : IClassificationSolution {
     new IClassificationEnsembleModel Model { get; }
-    IItemCollection<IClassificationSolution> ClassificationSolutions { get; }
+    ICheckedItemCollection<IClassificationSolution> ClassificationSolutions { get; }
     IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors(Dataset dataset, IEnumerable<int> rows);
   }
Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolutionWeightCalculator.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolutionWeightCalculator.cs	(revision 7531)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolutionWeightCalculator.cs	(revision 7549)
@@ -24,7 +24,11 @@
 
 namespace HeuristicLab.Problems.DataAnalysis.Interfaces.Classification {
+  public delegate bool CheckPoint(IClassificationProblemData problemData, int point);
   public interface IClassificationEnsembleSolutionWeightCalculator : INamedItem {
-    void CalculateNormalizedWeights(ItemCollection<IClassificationSolution> classificationSolutions);
-    IEnumerable<double> AggregateEstimatedClassValues(IEnumerable<IClassificationModel> models, Dataset dataset, IEnumerable<int> rows);
+    void CalculateNormalizedWeights(IEnumerable<IClassificationSolution> classificationSolutions);
+    IEnumerable<double> AggregateEstimatedClassValues(IEnumerable<IClassificationSolution> solutions, Dataset dataset, IEnumerable<int> rows, CheckPoint handler);
+    CheckPoint GetTestClassDelegate();
+    CheckPoint GetTrainingClassDelegate();
+    CheckPoint GetAllClassDelegate();
   }
 }
