[ top | up ]

k-Nearest Neighbour Cross-Validatory Classification

Usage

knn.cv(train, class, k=1, l=1, prob=F)

Arguments

train matrix or data frame of training set cases.
class factor of true classifications of training set
k number of neighbours considered.
l minimum vote for definite decision, otherwise doubt. (More precisely, less than k-l dissenting votes are allowed, even if k is increased by ties.)
prob If this is true, the proportion of the votes for the winning class are returned as attribute prob.
use.all controls handling of ties. If true, all distances equal to the kth largest are included. If false, a random selection of distances equal to the kth is chosen to use exactly k neighbours.

Value

factor of classifications of training set. doubt will be returned as NA.

See Also

knn