Nearest Mean Classification
Function for nearest mean classification.
nm(x, ...) ## Default S3 method: nm(x, grouping, gamma = 0, ...) ## S3 method for class 'data.frame' nm(x, ...) ## S3 method for class 'matrix' nm(x, grouping, ..., subset, na.action = na.fail) ## S3 method for class 'formula' nm(formula, data = NULL, ..., subset, na.action = na.fail)
x |
matrix or data frame containing the explanatory variables
(required, if |
grouping |
factor specifying the class for each observation
(required, if |
formula |
formula of the form |
data |
Data frame from which variables specified in |
gamma |
gamma parameter for rbf weight of the distance to mean. If |
subset |
An index vector specifying the cases to be used in the training sample. (Note: If given, this argument must be named!) |
na.action |
specify the action to be taken if |
... |
further arguments passed to the underlying |
A list containing the function call and the class means (learn
)).
Karsten Luebke, karsten.luebke@fom.de
data(B3) x <- nm(PHASEN ~ ., data = B3) x$learn x <- nm(PHASEN ~ ., data = B3, gamma = 0.1) predict(x)$post
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.