示例#1
0
 /// <summary>
 /// Classification model selecting EnsembleLearner.
 /// Trains several models and selects the best subset of models for the ensemble.
 /// The selection of the best set of models is based on cross validation.
 /// http://www.cs.cornell.edu/~alexn/papers/shotgun.icml04.revised.rev2.pdf
 /// </summary>
 /// <param name="learners">Learners in the ensemble</param>
 /// <param name="crossValidation">Cross validation method</param>
 /// <param name="ensembleStrategy">Strategy on how to combine the models</param>
 /// <param name="ensembleSelection">Ensemble selection method used to find the beset subset of models</param>
 public ClassificationModelSelectingEnsembleLearner(
     IIndexedLearner <ProbabilityPrediction>[] learners,
     ICrossValidation <ProbabilityPrediction> crossValidation,
     IClassificationEnsembleStrategy ensembleStrategy,
     IClassificationEnsembleSelection ensembleSelection)
     : this(learners, crossValidation, () => ensembleStrategy, ensembleSelection)
 {
 }
示例#2
0
 /// <summary>
 /// Classification model selecting EnsembleLearner.
 /// Trains several models and selects the best subset of models for the ensemble.
 /// The selection of the best set of models is based on cross validation.
 /// http://www.cs.cornell.edu/~alexn/papers/shotgun.icml04.revised.rev2.pdf
 /// </summary>
 /// <param name="learners">Learners in the ensemble</param>
 /// <param name="crossValidation">Cross validation method</param>
 /// <param name="ensembleStrategy">Strategy on how to combine the models</param>
 /// <param name="ensembleSelection">Ensemble selection method used to find the beset subset of models</param>
 public ClassificationModelSelectingEnsembleLearner(
     IIndexedLearner <ProbabilityPrediction>[] learners,
     ICrossValidation <ProbabilityPrediction> crossValidation,
     Func <IClassificationEnsembleStrategy> ensembleStrategy,
     IClassificationEnsembleSelection ensembleSelection)
 {
     m_learners          = learners ?? throw new ArgumentNullException(nameof(learners));
     m_crossValidation   = crossValidation ?? throw new ArgumentNullException(nameof(crossValidation));
     m_ensembleStrategy  = ensembleStrategy ?? throw new ArgumentNullException(nameof(ensembleStrategy));
     m_ensembleSelection = ensembleSelection ?? throw new ArgumentNullException(nameof(ensembleSelection));
 }
 /// <summary>
 /// Classification model selecting EnsembleLearner.
 /// Trains several models and selects the best subset of models for the ensemble.
 /// The selection of the best set of models is based on cross validation.
 /// http://www.cs.cornell.edu/~alexn/papers/shotgun.icml04.revised.rev2.pdf
 /// </summary>
 /// <param name="learners">Learners in the ensemble</param>
 /// <param name="crossValidation">Cross validation method</param>
 /// <param name="ensembleStrategy">Strategy on how to combine the models</param>
 /// <param name="ensembleSelection">Ensemble selection method used to find the beset subset of models</param>
 public ClassificationModelSelectingEnsembleLearner(IIndexedLearner <ProbabilityPrediction>[] learners, ICrossValidation <ProbabilityPrediction> crossValidation,
                                                    Func <IClassificationEnsembleStrategy> ensembleStrategy, IClassificationEnsembleSelection ensembleSelection)
 {
     if (learners == null)
     {
         throw new ArgumentNullException("learners");
     }
     if (crossValidation == null)
     {
         throw new ArgumentNullException("crossValidation");
     }
     if (ensembleStrategy == null)
     {
         throw new ArgumentNullException("ensembleStrategy");
     }
     if (ensembleSelection == null)
     {
         throw new ArgumentNullException("ensembleSelection");
     }
     m_learners          = learners;
     m_crossValidation   = crossValidation;
     m_ensembleStrategy  = ensembleStrategy;
     m_ensembleSelection = ensembleSelection;
 }