PRTools Contents

PRTools User Guide

knnc

KNNC

K-Nearest Neighbor Classifier

    [W,K,E] = KNNC(A,K)
    [W,K,E] = KNNC(A)

Input
 A Dataset
 K Number of the nearest neighbors (optional; default: K is  optimised with respect to the leave-one-out error on A)

Output
 W k-NN classifier
 K Number of the nearest neighbors used
 E The leave-one-out error of the KNNC

Description

Computation of the K-nearest neighbor classifier for the dataset A.  The resulting classifier W is automatically evaluated by KNN_MAP.

For multi-class problems with many classes (e.g. > 100) evaluation is  slow if K = 1. For that situation the use of FNNC may be considered.

Warning: class prior probabilities in A are neglected.

See also

mappings, datasets, knn_map, fnnc,

PRTools Contents

PRTools User Guide

This file has been automatically generated. If badly readable, use the help-command in Matlab.