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.


Class: ClassificationPartitionedModel

Classification margins for observations not used for training


M = kfoldMargin(obj)


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


A partitioned classification model of type ClassificationPartitionedModel or ClassificationPartitionedEnsemble.

Output Arguments


The classification margin.


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),...
marginStats =

  1x3 table

      Min       Mean      Max  
    _______    ______    ______

    -11.312    7.3236    23.517


expand all

Was this topic helpful?