Main Content

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 Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

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'

UseParallel

Indication to perform inference in parallel, specified as false (compute serially) or true (compute in parallel). Parallel computation requires Parallel Computing Toolbox™. Parallel inference can be faster than serial inference, especially for large datasets. Parallel computation is supported only for tree learners.

Default: false

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

Extended Capabilities

Version History

expand all

Behavior changed in R2022a