Changeset 6614


Ignore:
Timestamp:
07/29/11 14:48:54 (8 years ago)
Author:
mkommend
Message:

#1592: Prevented nested ensemble solutions, during ensemble creation by menu item.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/CreateEnsembleMenuItem.cs

    r6613 r6614  
    7575            var ensemble = new RegressionEnsembleSolution(Enumerable.Empty<IRegressionModel>(), problemData);
    7676            ensemble.Name = group.Key + " ensemble";
    77             ensemble.AddRegressionSolutions(group.OfType<IRegressionSolution>());
     77            var nestedSolutions = group.OfType<RegressionEnsembleSolution>().SelectMany(e => e.RegressionSolutions);
     78            var solutions = group.Where(s => !(s is RegressionEnsembleSolution)).OfType<IRegressionSolution>();
     79            ensemble.AddRegressionSolutions(nestedSolutions.Concat(solutions));
    7880            MainFormManager.MainForm.ShowContent(ensemble);
    7981          } else if (group.All(s => s is IClassificationSolution)) {
     
    8587            var ensemble = new ClassificationEnsembleSolution(Enumerable.Empty<IClassificationModel>(), problemData);
    8688            ensemble.Name = group.Key + " ensemble";
    87             ensemble.AddClassificationSolutions(group.OfType<IClassificationSolution>());
     89            var nestedSolutions = group.OfType<ClassificationEnsembleSolution>().SelectMany(e => e.ClassificationSolutions);
     90            var solutions = group.Where(s => !(s is ClassificationEnsembleSolution)).OfType<IClassificationSolution>();
     91            ensemble.AddClassificationSolutions(nestedSolutions.Concat(solutions));
    8892            MainFormManager.MainForm.ShowContent(ensemble);
    8993          }
Note: See TracChangeset for help on using the changeset viewer.