This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Resume training ensemble


ens1 = resume(ens,nlearn)
ens1 = resume(ens,nlearn,Name,Value)


ens1 = resume(ens,nlearn) trains ens for nlearn more cycles. resume uses the same training options fitcensemble used to create ens.


You cannot resume training when ens is a Subspace ensemble created with 'AllPredictorCombinations' number of learners.

ens1 = resume(ens,nlearn,Name,Value) trains ens with additional options specified by one or more Name,Value pair arguments.

Input Arguments


A classification ensemble, created with fitcensemble.


A positive integer, the number of cycles for additional training of ens.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.


Printout frequency, a positive integer scalar or 'off' (no printouts). Returns to the command line the number of weak learners trained so far. Useful when you train ensembles with many learners on large data sets.

Default: 'off'

Output Arguments


The classification ensemble ens, augmented with additional training.


expand all

Train a classification ensemble for three cycles, and compare the resubstitution error obtained after training the ensemble for more cycles.

Load the ionosphere data set.

load ionosphere

Train a classification ensemble for three cycles and examine the resubstitution error.

ens = fitcensemble(X,Y,'Method','GentleBoost','NumLearningCycles',3);
L = resubLoss(ens)
L = 0.0114

Train for three more cycles and examine the new resubstitution error.

ens1 = resume(ens,3);
L = resubLoss(ens1)
L = 0

The resubstitution error is much lower in the new ensemble than the original.

See Also