resume

Resume training ensemble

Syntax

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

Description

ens1= resume(ens,nlearn)trainsensfornlearnmore cycles.resumeuses the same training optionsfitcensembleused to createens.

Note

You cannotresumetraining whenensis aSubspaceensemble created with'AllPredictorCombinations'number of learners.

ens1= resume(ens,nlearn,Name,Value)trainsenswith additional options specified by one or moreName,Valuepair arguments.

Input Arguments

ens

A classification ensemble, created withfitcensemble.

nlearn

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

Name-Value Pair Arguments

Specify optional comma-separated pairs ofName,Valuearguments.Nameis the argument name andValueis the corresponding value.Namemust appear inside quotes. You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN.

'nprint'

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

ens1

The classification ensembleens, augmented with additional training.

Examples

expand all

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

Load theionospheredata set.

loadionosphere

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