Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs	(revision 13703)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs	(revision 13704)
@@ -46,4 +46,15 @@
     }
 
+    private List<double> modelWeights;
+    public IEnumerable<double> ModelWeights {
+      get { return modelWeights; }
+    }
+
+    [Storable(Name = "ModelWeights")]
+    private IEnumerable<double> StorableModelWeights {
+      get { return modelWeights; }
+      set { modelWeights = value.ToList(); }
+    }
+
     [Storable]
     private bool averageModelEstimates = true;
@@ -53,5 +64,5 @@
         if (averageModelEstimates != value) {
           averageModelEstimates = value;
-          OnAverageModelEstimatesChanged();
+          OnChanged();
         }
       }
@@ -64,4 +75,13 @@
     }
     #endregion
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility 3.3.14
+      #region Backwards compatible code, remove with 3.4
+      if (modelWeights == null || !modelWeights.Any())
+        modelWeights = new List<double>(models.Select(m => 1.0));
+      #endregion
+    }
 
     [StorableConstructor]
@@ -70,4 +90,5 @@
       : base(original, cloner) {
       this.models = original.Models.Select(cloner.Clone).ToList();
+      this.modelWeights = new List<double>(original.ModelWeights);
       this.averageModelEstimates = original.averageModelEstimates;
     }
@@ -77,18 +98,57 @@
 
     public RegressionEnsembleModel() : this(Enumerable.Empty<IRegressionModel>()) { }
-    public RegressionEnsembleModel(IEnumerable<IRegressionModel> models)
+    public RegressionEnsembleModel(IEnumerable<IRegressionModel> models) : this(models, models.Select(m => 1.0)) { }
+    public RegressionEnsembleModel(IEnumerable<IRegressionModel> models, IEnumerable<double> modelWeights)
       : base() {
       this.name = ItemName;
       this.description = ItemDescription;
+
+
       this.models = new List<IRegressionModel>(models);
+      this.modelWeights = new List<double>(modelWeights);
     }
 
     #region IRegressionEnsembleModel Members
     public void Add(IRegressionModel model) {
+      Add(model, 1.0);
+    }
+    public void Add(IRegressionModel model, double weight) {
       models.Add(model);
+      modelWeights.Add(weight);
+      OnChanged();
+    }
+
+    public void AddRange(IEnumerable<IRegressionModel> models) {
+      AddRange(models, models.Select(m => 1.0));
+    }
+    public void AddRange(IEnumerable<IRegressionModel> models, IEnumerable<double> weights) {
+      this.models.AddRange(models);
+      modelWeights.AddRange(weights);
+      OnChanged();
     }
 
     public void Remove(IRegressionModel model) {
-      models.Remove(model);
+      var index = models.IndexOf(model);
+      models.RemoveAt(index);
+      modelWeights.RemoveAt(index);
+      OnChanged();
+    }
+    public void RemoveRange(IEnumerable<IRegressionModel> models) {
+      foreach (var model in models) {
+        var index = this.models.IndexOf(model);
+        this.models.RemoveAt(index);
+        modelWeights.RemoveAt(index);
+      }
+      OnChanged();
+    }
+
+    public double GetModelWeight(IRegressionModel model) {
+      var index = models.IndexOf(model);
+      return modelWeights[index];
+    }
+    public void SetModelWeight(IRegressionModel model, double weight) {
+      var index = models.IndexOf(model);
+      modelWeights[index] = weight;
+      OnChanged();
     }
 
@@ -127,7 +187,7 @@
     }
 
-    public event EventHandler AverageModelEstimatesChanged;
-    private void OnAverageModelEstimatesChanged() {
-      var handler = AverageModelEstimatesChanged;
+    public event EventHandler Changed;
+    private void OnChanged() {
+      var handler = Changed;
       if (handler != null)
         handler(this, EventArgs.Empty);
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs	(revision 13703)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs	(revision 13704)
@@ -79,4 +79,6 @@
         }
       }
+
+      RegisterModelEvents();
       RegisterRegressionSolutionsEventHandler();
     }
@@ -98,4 +100,5 @@
 
       regressionSolutions = cloner.Clone(original.regressionSolutions);
+      RegisterModelEvents();
       RegisterRegressionSolutionsEventHandler();
     }
@@ -107,4 +110,5 @@
       regressionSolutions = new ItemCollection<IRegressionSolution>();
 
+      RegisterModelEvents();
       RegisterRegressionSolutionsEventHandler();
     }
@@ -133,4 +137,5 @@
 
       RecalculateResults();
+      RegisterModelEvents();
       RegisterRegressionSolutionsEventHandler();
     }
@@ -139,4 +144,8 @@
     public override IDeepCloneable Clone(Cloner cloner) {
       return new RegressionEnsembleSolution(this, cloner);
+    }
+
+    private void RegisterModelEvents() {
+      Model.Changed += Model_Changed;
     }
     private void RegisterRegressionSolutionsEventHandler() {
@@ -155,4 +164,5 @@
         var rows = ProblemData.TrainingIndices;
         var rowsToEvaluate = rows.Except(trainingEvaluationCache.Keys);
+
         var rowsEnumerator = rowsToEvaluate.GetEnumerator();
         var valuesEnumerator = Model.GetEstimatedValues(ProblemData.Dataset, rowsToEvaluate, (r, m) => RowIsTrainingForModel(r, m) && !RowIsTestForModel(r, m)).GetEnumerator();
@@ -236,55 +246,56 @@
     }
 
-    public void AddRegressionSolutions(IEnumerable<IRegressionSolution> solutions) {
-      regressionSolutions.AddRange(solutions);
+    private void Model_Changed(object sender, EventArgs e) {
+      var modelSet = new HashSet<IRegressionModel>(Model.Models);
+      foreach (var model in Model.Models) {
+        if (!trainingPartitions.ContainsKey(model)) trainingPartitions.Add(model, ProblemData.TrainingPartition);
+        if (!testPartitions.ContainsKey(model)) testPartitions.Add(model, ProblemData.TrainingPartition);
+      }
+      foreach (var model in trainingPartitions.Keys) {
+        if (modelSet.Contains(model)) continue;
+        trainingPartitions.Remove(model);
+        testPartitions.Remove(model);
+      }
 
       trainingEvaluationCache.Clear();
       testEvaluationCache.Clear();
       evaluationCache.Clear();
+
+      OnModelChanged();
+    }
+
+    public void AddRegressionSolutions(IEnumerable<IRegressionSolution> solutions) {
+      regressionSolutions.AddRange(solutions);
     }
     public void RemoveRegressionSolutions(IEnumerable<IRegressionSolution> solutions) {
       regressionSolutions.RemoveRange(solutions);
-
-      trainingEvaluationCache.Clear();
-      testEvaluationCache.Clear();
-      evaluationCache.Clear();
     }
 
     private void regressionSolutions_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) {
-      foreach (var solution in e.Items) AddRegressionSolution(solution);
-      RecalculateResults();
+      foreach (var solution in e.Items) {
+        trainingPartitions.Add(solution.Model, solution.ProblemData.TrainingPartition);
+        testPartitions.Add(solution.Model, solution.ProblemData.TestPartition);
+      }
+      Model.AddRange(e.Items.Select(s => s.Model));
     }
     private void regressionSolutions_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) {
-      foreach (var solution in e.Items) RemoveRegressionSolution(solution);
-      RecalculateResults();
+      foreach (var solution in e.Items) {
+        trainingPartitions.Remove(solution.Model);
+        testPartitions.Remove(solution.Model);
+      }
+      Model.RemoveRange(e.Items.Select(s => s.Model));
     }
     private void regressionSolutions_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) {
-      foreach (var solution in e.OldItems) RemoveRegressionSolution(solution);
-      foreach (var solution in e.Items) AddRegressionSolution(solution);
-      RecalculateResults();
-    }
-
-    private void AddRegressionSolution(IRegressionSolution 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;
-
-      trainingEvaluationCache.Clear();
-      testEvaluationCache.Clear();
-      evaluationCache.Clear();
-    }
-
-    private void RemoveRegressionSolution(IRegressionSolution solution) {
-      if (!Model.Models.Contains(solution.Model)) throw new ArgumentException();
-      Model.Remove(solution.Model);
-
-      trainingPartitions.Remove(solution.Model);
-      testPartitions.Remove(solution.Model);
-
-      trainingEvaluationCache.Clear();
-      testEvaluationCache.Clear();
-      evaluationCache.Clear();
+      foreach (var solution in e.OldItems) {
+        trainingPartitions.Remove(solution.Model);
+        testPartitions.Remove(solution.Model);
+      }
+      Model.RemoveRange(e.OldItems.Select(s => s.Model));
+
+      foreach (var solution in e.Items) {
+        trainingPartitions.Add(solution.Model, solution.ProblemData.TrainingPartition);
+        testPartitions.Add(solution.Model, solution.ProblemData.TestPartition);
+      }
+      Model.AddRange(e.Items.Select(s => s.Model));
     }
   }
Index: /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleModel.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleModel.cs	(revision 13703)
+++ /trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleModel.cs	(revision 13704)
@@ -25,10 +25,20 @@
   public interface IRegressionEnsembleModel : IRegressionModel {
     void Add(IRegressionModel model);
+    void Add(IRegressionModel model, double weight);
+    void AddRange(IEnumerable<IRegressionModel> models);
+    void AddRange(IEnumerable<IRegressionModel> models, IEnumerable<double> weights);
+
     void Remove(IRegressionModel model);
+    void RemoveRange(IEnumerable<IRegressionModel> models);
 
     IEnumerable<IRegressionModel> Models { get; }
+    IEnumerable<double> ModelWeights { get; }
+
+    double GetModelWeight(IRegressionModel model);
+    void SetModelWeight(IRegressionModel model, double weight);
 
     bool AverageModelEstimates { get; set; }
-    event EventHandler AverageModelEstimatesChanged;
+
+    event EventHandler Changed;
 
     IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(IDataset dataset, IEnumerable<int> rows);
