Esta página aún no se ha traducido para esta versión. Puede ver la versión más reciente de esta página en inglés.

resubEdge

Edge of k-nearest neighbor classifier by resubstitution

Sintaxis

E = resubEdge(mdl)

Descripción

ejemplo

E = resubEdge(mdl) returns the classification edge for mdl with the data used to train mdl.

The classification edge (E) is a scalar value that represents the mean of the classification margins.

Ejemplos

contraer todo

Create a k-nearest neighbor classifier for the Fisher iris data, where = 5.

Load the Fisher iris data set.

load fisheriris
X = meas;
Y = species;

Create a classifier for five nearest neighbors.

mdl = fitcknn(X,Y,'NumNeighbors',5);

Examine the resubstitution edge of the classifier.

E = resubEdge(mdl)
E = 0.9253

E is the mean of the training sample margins.

Argumentos de entrada

contraer todo

k-nearest neighbor classifier model, specified as a ClassificationKNN object.

Más acerca de

contraer todo

Margin

The classification margin for each observation is the difference between the classification score for the true class and the maximal classification score for the false classes.

The classification margins form a column vector with the same number of rows as in the training data.

Score

The score of a classification is the posterior probability of the classification. The posterior probability is the number of neighbors with that classification divided by the number of neighbors. For a more detailed definition that includes weights and prior probabilities, see Posterior Probability.

Introducido en R2012a