class

This package provides functions for classification.

Functions

FunctionDescription
SOM, batchSOMKohonen’s self-organizing maps (SOMs) are a crude form of multidimensional scaling.
condenseCondenses training set for k-nearest-neighbor (k-NN) classifier.
knnk-nearest-neighbor classification for test set from training set. For each row of the test set, the k-nearest (in Euclidean distance) training set vectors are found, and the classification is decided by majority vote, with ties broken at random. If there are ties for the kth nearest vector, then all candidates are included in the vote.
knn.cvk-nearest-neighbor cross-validatory classification from training set.
knn1Nearest-neighbor classification for test set from training set. For each row of the test set, the nearest neighbor (by Euclidean distance) training set vector is found, and its classification used. If there is more than one nearest neighbor, a majority vote is used, with ties broken at random.
lvq1, lvq2, lvq3Moves examples in a codebook to better represent the training set.
lvqinitConstructs an initial codebook for learning vector quantization (LVQ) methods.
lvqtestClassifies a test set by 1-NN from a specified LVQ codebook.
multieditMultiedit for k-NN classifier.
olvq1Moves examples in a codebook to better represent the training set.
reduce.nnReduces training set for a k-NN classifier. Used after condense.
somgridPlotting functions for SOM results.

Get R in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.