simulation {kknn}R Documentation

Crossvalidation procedure to test prediction accuracy

Description

simulation tests prediction accuracy of regression and/or classification techniques via simulation of different test sets.

Usage

simulation(formula, data, runs = 10, train = TRUE, k = 11, ...)

Arguments

formula A formula object.
data Matrix or data frame.
runs Number of crossvalidation runs.
train A logical value. If TRUE the training procedure for selecting optimal values of k and kernel is performed.
k Number or maximal number of neighbors considered, dependent of choice for train.
... Further arguments passed to or from other methods.

Value

A matrix, containing the mean and variance of the misclassification error, the absolute and the squared distances.

Author(s)

Klaus P. Schliep K.P.Schliep@massey.ac.nz

References

Hechenbichler K. and Schliep K.P. (2004) Weighted k-Nearest-Neighbor Techniques and Ordinal Classification, Discussion Paper 399, SFB 386, Ludwig-Maximilians University Munich (http://www.stat.uni-muenchen.de/sfb386/papers/dsp/paper399.ps)

See Also

kknn and train.kknn

Examples

library(kknn)
data(miete)
simulation(nmqm ~ wfl + bjkat + zh, data = miete, runs = 5, kernel = "triangular", k = 15)
simulation(wflkat ~ nm + bjkat + zh, data = miete, runs = 5)
simulation(zh ~ wfl + bjkat + nmqm, data = miete, runs = 5)


[Package kknn version 1.0-6 Index]