Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13702 for trunk


Ignore:
Timestamp:
03/15/16 11:39:21 (9 years ago)
Author:
mkommend
Message:

#2590: Fixed bugs in RegressionEnsembleSolution when adding new solutions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs

    r13698 r13702  
    124124      testEvaluationCache = new Dictionary<int, double>(problemData.TestIndices.Count());
    125125
    126       RegisterRegressionSolutionsEventHandler();
     126
    127127      var solutions = model.Models.Select(m => m.CreateRegressionSolution((IRegressionProblemData)problemData.Clone()));
    128       regressionSolutions.AddRange(solutions);
     128      foreach (var solution in solutions) {
     129        regressionSolutions.Add(solution);
     130        trainingPartitions.Add(solution.Model, solution.ProblemData.TrainingPartition);
     131        testPartitions.Add(solution.Model, solution.ProblemData.TestPartition);
     132      }
     133
     134      RecalculateResults();
     135      RegisterRegressionSolutionsEventHandler();
    129136    }
    130137
     
    261268      if (Model.Models.Contains(solution.Model)) throw new ArgumentException();
    262269      Model.Add(solution.Model);
     270
    263271      trainingPartitions[solution.Model] = solution.ProblemData.TrainingPartition;
    264272      testPartitions[solution.Model] = solution.ProblemData.TestPartition;
     
    272280      if (!Model.Models.Contains(solution.Model)) throw new ArgumentException();
    273281      Model.Remove(solution.Model);
     282
    274283      trainingPartitions.Remove(solution.Model);
    275284      testPartitions.Remove(solution.Model);
Note: See TracChangeset for help on using the changeset viewer.