Skip to Content
R in a Nutshell
book

R in a Nutshell

by Joseph Adler
January 2010
Beginner
634 pages
19h 50m
English
O'Reilly Media, Inc.
Content preview from R in a Nutshell

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, 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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R in a Nutshell, 2nd Edition

R in a Nutshell, 2nd Edition

Joseph Adler
The Big R-Book

The Big R-Book

Philippe J. S. De Brouwer
R Packages

R Packages

Hadley Wickham

Publisher Resources

ISBN: 9781449377502Supplemental ContentErrata Page