Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/29/11 11:38:02 (13 years ago)
Author:
abeham
Message:

#1605

  • updated QAPAlgorithms branch
Location:
branches/QAPAlgorithms
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/QAPAlgorithms

  • branches/QAPAlgorithms/HeuristicLab.Problems.DataAnalysis

  • branches/QAPAlgorithms/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs

    r6569 r6611  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     27using HeuristicLab.Data;
    2628using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using System;
    28 using HeuristicLab.Data;
    2929
    3030namespace HeuristicLab.Problems.DataAnalysis {
     
    3535  [Item("Regression Ensemble Solution", "A regression solution that contains an ensemble of multiple regression models")]
    3636  // [Creatable("Data Analysis")]
    37   public class RegressionEnsembleSolution : RegressionSolution, IRegressionEnsembleSolution {
     37  public sealed class RegressionEnsembleSolution : RegressionSolution, IRegressionEnsembleSolution {
    3838    public new IRegressionEnsembleModel Model {
    3939      get { return (IRegressionEnsembleModel)base.Model; }
     
    4646
    4747    [StorableConstructor]
    48     protected RegressionEnsembleSolution(bool deserializing) : base(deserializing) { }
    49     protected RegressionEnsembleSolution(RegressionEnsembleSolution original, Cloner cloner)
     48    private RegressionEnsembleSolution(bool deserializing) : base(deserializing) { }
     49    private RegressionEnsembleSolution(RegressionEnsembleSolution original, Cloner cloner)
    5050      : base(original, cloner) {
    5151      trainingPartitions = new Dictionary<IRegressionModel, IntRange>();
     
    6464      trainingPartitions = new Dictionary<IRegressionModel, IntRange>();
    6565      testPartitions = new Dictionary<IRegressionModel, IntRange>();
    66       AddModelsAndParitions(models,
     66      AddModelsAndPartitions(models,
    6767        from m in models select (IntRange)problemData.TrainingPartition.Clone(),
    6868        from m in models select (IntRange)problemData.TestPartition.Clone());
     
    7474      this.trainingPartitions = new Dictionary<IRegressionModel, IntRange>();
    7575      this.testPartitions = new Dictionary<IRegressionModel, IntRange>();
    76       AddModelsAndParitions(models, trainingPartitions, testPartitions);
     76      AddModelsAndPartitions(models, trainingPartitions, testPartitions);
    7777      RecalculateResults();
    7878    }
     
    8080    public override IDeepCloneable Clone(Cloner cloner) {
    8181      return new RegressionEnsembleSolution(this, cloner);
     82    }
     83
     84    protected override void RecalculateResults() {
     85      CalculateResults();
    8286    }
    8387
     
    152156
    153157
    154     public void AddModelsAndParitions(IEnumerable<IRegressionSolution> solutions) {
     158    public void AddModelsAndPartitions(IEnumerable<IRegressionSolution> solutions) {
    155159      foreach (var solution in solutions) {
    156160        var ensembleSolution = solution as RegressionEnsembleSolution;
     
    176180    }
    177181
    178     private void AddModelsAndParitions(IEnumerable<IRegressionModel> models, IEnumerable<IntRange> trainingPartitions, IEnumerable<IntRange> testPartitions) {
     182    private void AddModelsAndPartitions(IEnumerable<IRegressionModel> models, IEnumerable<IntRange> trainingPartitions, IEnumerable<IntRange> testPartitions) {
    179183      var modelEnumerator = models.GetEnumerator();
    180184      var trainingPartitionEnumerator = trainingPartitions.GetEnumerator();
Note: See TracChangeset for help on using the changeset viewer.