Learn R Programming

MAIT (version 1.6.0)

selectK: Looks for the optimum number of nearest neighbours to be considered for the KNN

Description

Function selectK finds the optimum number of nearest neighbours for the K-Nearest Neighbours (KNN) algorithm.

Usage

selectK(data, class, max.k)

Arguments

data
A numerical matrix containing the data
class
Vector containing the class label of each sample.
max.k
Maximum number of nearest neighbours to be considered.

Value

A numeric value of the optimal number of neighbours to be considered in a KNN run.

See Also

Validation