Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

kfoldEdge

Class: ClassificationPartitionedModel

Classification edge for observations not used for training

Syntax

E = kfoldEdge(obj)
E = kfoldEdge(obj,Name,Value)

Description

E = kfoldEdge(obj) returns classification edge (average classification margin) obtained by cross-validated classification model obj. For every fold, this method computes classification edge for in-fold observations using an ensemble trained on out-of-fold observations.

E = kfoldEdge(obj,Name,Value) calculates 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

obj

Object of class ClassificationPartitionedModel.

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 single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'folds'

Indices of folds ranging from 1 to obj.KFold. Use only these folds for predictions.

Default: 1:obj.KFold

'mode'

Character vector representing the meaning of the output edge:

  • 'average'edge is a scalar value, the average over all folds.

  • 'individual'edge is a vector of length obj.KFold with one element per fold.

Default: 'average'

Output Arguments

E

The average classification margin. E is a scalar or vector, depending on the setting of the mode name-value pair.

Examples

expand all

Compute the k-fold edge for a model trained on Fisher's iris data.

Load Fisher's iris data set.

load fisheriris

Train a classification tree classifier.

tree = fitctree(meas,species);

Cross validate the classifier using 10-fold cross validation.

cvtree = crossval(tree);

Compute the k-fold edge.

edge = kfoldEdge(cvtree)
edge =

    0.8578

Definitions

expand all

Was this topic helpful?