Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs	(revision 7459)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs	(revision 7464)
@@ -51,4 +51,8 @@
     }
 
+    public IEnumerable<double> Weights {
+      get { return new List<double>(weights); }
+    }
+
     [Storable]
     private Dictionary<IClassificationModel, IntRange> trainingPartitions;
@@ -56,5 +60,18 @@
     private Dictionary<IClassificationModel, IntRange> testPartitions;
 
+    private IEnumerable<double> weights;
+
     private IClassificationEnsembleSolutionWeightCalculator weightCalculator;
+
+    public IClassificationEnsembleSolutionWeightCalculator WeightCalculator {
+      set {
+        if (value != null) {
+          weightCalculator = value;
+          weights = weights = weightCalculator.CalculateWeights(classificationSolutions);
+          if (!ProblemData.IsEmpty)
+            RecalculateResults();
+        }
+      }
+    }
 
     [StorableConstructor]
@@ -98,5 +115,5 @@
       classificationSolutions = new ItemCollection<IClassificationSolution>();
 
-      weightCalculator = new AccuracyWeightCalculator();
+      weightCalculator = new MajorityVoteWeightCalculator();
 
       RegisterClassificationSolutionsEventHandler();
@@ -158,5 +175,4 @@
                                          .ToList();
         var rowsEnumerator = rows.GetEnumerator();
-        IEnumerable<double> weights = weightCalculator.CalculateWeights(classificationSolutions);
         // aggregate to make sure that MoveNext is called for all enumerators 
         while (rowsEnumerator.MoveNext() & estimatedValuesEnumerators.Select(en => en.EstimatedValuesEnumerator.MoveNext()).Aggregate(true, (acc, b) => acc & b)) {
@@ -178,5 +194,4 @@
                                          .ToList();
         var rowsEnumerator = ProblemData.TestIndizes.GetEnumerator();
-        IEnumerable<double> weights = weightCalculator.CalculateWeights(classificationSolutions);
         // aggregate to make sure that MoveNext is called for all enumerators 
         while (rowsEnumerator.MoveNext() & estimatedValuesEnumerators.Select(en => en.EstimatedValuesEnumerator.MoveNext()).Aggregate(true, (acc, b) => acc & b)) {
@@ -203,5 +218,4 @@
 
     public override IEnumerable<double> GetEstimatedClassValues(IEnumerable<int> rows) {
-      IEnumerable<double> weights = weightCalculator.CalculateWeights(classificationSolutions);
       return from xs in GetEstimatedClassValueVectors(ProblemData.Dataset, rows)
              select AggregateEstimatedClassValues(xs, weights);
@@ -302,4 +316,5 @@
       trainingPartitions[solution.Model] = solution.ProblemData.TrainingPartition;
       testPartitions[solution.Model] = solution.ProblemData.TestPartition;
+      weights = weightCalculator.CalculateWeights(classificationSolutions);
     }
 
@@ -309,4 +324,5 @@
       trainingPartitions.Remove(solution.Model);
       testPartitions.Remove(solution.Model);
+      weights = weightCalculator.CalculateWeights(classificationSolutions);
     }
   }
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 7459)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AccuracyWeightCalculator.cs	(revision 7464)
@@ -28,5 +28,5 @@
 namespace HeuristicLab.Problems.DataAnalysis {
   /// <summary>
-  /// Represents a weight calculator that gives every classification solution a weight based on the accuracy..
+  /// Represents a weight calculator that gives every classification solution a weight based on the accuracy.
   /// </summary>
   [StorableClass]
Index: branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AdaBoostWeightCalculator.cs
===================================================================
--- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AdaBoostWeightCalculator.cs	(revision 7464)
+++ branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AdaBoostWeightCalculator.cs	(revision 7464)
@@ -0,0 +1,94 @@
+﻿#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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis {
+  /// <summary>
+  /// Represents a weight calculator that gives every classification solution a weight based on the AdaBoost algorithm.
+  /// </summary>
+  [StorableClass]
+  [Item("AdaBoostWeightCalculator", "Represents a weight calculator that gives every classification solution a weight based on the AdaBoost algorithm.")]
+  public class AdaBoostWeightCalculator : WeightCalculator {
+
+    public AdaBoostWeightCalculator()
+      : base() {
+    }
+
+    [StorableConstructor]
+    protected AdaBoostWeightCalculator(bool deserializing) : base(deserializing) { }
+    protected AdaBoostWeightCalculator(AdaBoostWeightCalculator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new AdaBoostWeightCalculator(this, cloner);
+    }
+
+    public override IEnumerable<double> CalculateWeights(ItemCollection<IClassificationSolution> classificationSolutions) {
+      if (classificationSolutions.Count <= 0)
+        return new List<double>();
+      IClassificationProblemData problemData = classificationSolutions.ElementAt(0).ProblemData;
+      double normalize = problemData.TrainingIndizes.Count() + problemData.TestIndizes.Count();
+      List<double> distribution = Enumerable.Repeat(1.0 / normalize, Convert.ToInt32(normalize)).ToList();
+      IEnumerable<double> targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable);
+
+      List<double> weights = new List<double>();
+      foreach (var solution in classificationSolutions) {
+        double error = 0.0;
+        //calculate the error
+
+        //TODO: only works if training and test partition are not overlapping (has to be changed)
+        IEnumerable<double> training = targetValues.Skip(problemData.TrainingPartition.Start).Take(problemData.TrainingIndizes.Count());
+        IEnumerable<double> test = targetValues.Skip(problemData.TestPartition.Start).Take(problemData.TestIndizes.Count());
+
+        IList<double> original = training.Concat(test).ToList();
+        IList<double> estimated = solution.EstimatedTrainingClassValues.Concat(solution.EstimatedTestClassValues).ToList();
+
+        for (int i = 0; i < original.Count; i++) {
+          if (!original[i].Equals(estimated[i]))
+            error += distribution[i];
+        }
+        //if the error is too big, the solution is not taken into account (weight would be negative)
+        if (error > 0.5) {
+          weights.Add(0);
+          continue;
+        }
+        double beta = error / (1 - error);
+        weights.Add(Math.Log(1 / beta));
+        //Update the distribution
+        normalize = 0.0;
+        for (int i = 0; i < original.Count; i++) {
+          if (original[i].Equals(estimated[i]))
+            distribution[i] *= beta;
+          normalize += distribution[i];
+        }
+        distribution = distribution.Select(x => x / normalize).ToList();
+      }
+      return weights;
+    }
+  }
+}
