predict.MLKNNmodel {utiml}R Documentation

Predict Method for ML-KNN

Description

This function predicts values based upon a model trained by mlknn. '

Usage

## S3 method for class 'MLKNNmodel'
predict(
  object,
  newdata,
  probability = getOption("utiml.use.probs", TRUE),
  ...,
  cores = getOption("utiml.cores", 1),
  seed = getOption("utiml.seed", NA)
)

Arguments

object

Object of class 'MLKNNmodel'.

newdata

An object containing the new input data. This must be a matrix, data.frame or a mldr object.

probability

Logical indicating whether class probabilities should be returned. (Default: getOption("utiml.use.probs", TRUE))

...

Not used.

cores

Ignored because this method does not support multi-core.

seed

Ignored because this method is deterministic.

Value

An object of type mlresult, based on the parameter probability.

See Also

ML-KNN

Examples

model <- mlknn(toyml)
pred <- predict(model, toyml)

[Package utiml version 0.1.7 Index]