predict.kmeans {fdm2id}R Documentation

Predict function for K-means

Description

Return the closest K-means cluster for a new dataset.

Usage

## S3 method for class 'kmeans'
predict(object, newdata, ...)

Arguments

object

The classification model (created by KMEANS).

newdata

A new dataset (a data.frame), with same variables as the learning dataset.

...

Other parameters.

See Also

KMEANS

Examples

require (datasets)
data (iris)
d = splitdata (iris, 5)
model = KMEANS (d$train.x, k = 3)
predict (model, d$test.x)

[Package fdm2id version 0.9.9 Index]