oobEdge

Out-of-bag classification edge

Syntax

edge = oobEdge(ens)
edge = oobEdge(ens,Name,Value)

Description

edge = oobEdge(ens) returns out-of-bag classification edge for ens.

edge = oobEdge(ens,Name,Value) computes classification edge with additional options specified by one or more Name,Value pair arguments. You can specify several name-value pair arguments in any order as Name1,Value1,…,NameN,ValueN.

Input Arguments

ens

A classification bagged ensemble, constructed with fitcensemble.

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.

'learners'

Indices of weak learners in the ensemble ranging from 1 to ens.NumTrained. oobEdge uses only these learners for calculating loss.

Default: 1:NumTrained

'mode'

Character vector or string scalar representing the meaning of the output L:

  • 'ensemble'L is a scalar value, the loss for the entire ensemble.

  • 'individual'L is a vector with one element per trained learner.

  • 'cumulative'L is a vector in which element J is obtained by using learners 1:J from the input list of learners.

Default: 'ensemble'

Output Arguments

edge

Classification edge, a weighted average of the classification margin.

Examples

expand all

Load Fisher's iris data set.

load fisheriris

Train an ensemble of 100 bagged classification trees using the entire data set.

Mdl = fitcensemble(meas,species,'Method','Bag');

Estimate the out-of-bag edge.

edge = oobEdge(Mdl)
edge = 0.8767

More About

expand all