Learn R Programming

knncat (version 1.2.2)

predict.knncat: Prediict on a knncat classifier

Description

Produce predictions for a knncat classifier

Usage

"predict"(object, train, newdata, train.classcol=1, newdata.classcol=1, return.classes=TRUE, more=FALSE, verbose = 0, ...)

Arguments

object
Knncat object, from knncat
train
Training set used to build classifier
newdata
New data on which to make predictions
train.classcol
Column number for classification in training set. Default: 1
newdata.classcol
Column number for classification in newdata set. Default: 1. If
return.classes
Logical; if TRUE, return a vector of classifications of the newdata set. Default: TRUE
more
Logical; if TRUE, also print error rate. Default: FALSE
verbose
Level of verbosity for debugging. Default: 0
...
Other arguments, currently ignored

Value

Details

This prints the misclassification rate from the knncat classifier, together with an indication as to whether it was based on a training or test set.