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.

kfoldMargin

Class: ClassificationPartitionedModel

Classification margins for observations not used for training

Syntax

M = kfoldMargin(obj)

Description

M = kfoldMargin(obj) returns classification margins obtained by cross-validated classification model obj. For every fold, this method computes classification margins for in-fold observations using a model trained on out-of-fold observations.

Input Arguments

obj

A partitioned classification model of type ClassificationPartitionedModel or ClassificationPartitionedEnsemble.

Output Arguments

M

The classification margin.

Examples

expand all

Find the k-fold margins for an ensemble that classifies the ionosphere data.

Load the ionosphere data set.

load ionosphere

Train a classification ensemble of decision trees.

Mdl = fitensemble(X,Y,'AdaBoostM1',100,'Tree');

Cross validate the classifier using 10-fold cross validation.

cvens = crossval(Mdl);

Compute the _k_fold margins. Disaply summary statistics for the margins.

m = kfoldMargin(cvens);
marginStats = table(min(m),mean(m),max(m),...
    'VariableNames',{'Min','Mean','Max'})
marginStats =

  1×3 table

      Min       Mean      Max  
    _______    ______    ______

    -11.312    7.3236    23.517

Definitions

expand all

Was this topic helpful?