predict.kmeans: Predict function for K-means

predict.kmeansR 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)

fdm2id documentation built on July 9, 2023, 6:05 p.m.