Skip to contents

Assign new data to existing clusters without re-fitting

Usage

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

Arguments

object

A morie_cluster.

newdata

New numeric data with the training columns.

...

Unused.

Value

Integer cluster labels for the new rows (named by row name).

Examples

cl <- morie_cluster(iris[1:4], k = 3)
#> Warning: input has no row names; using positional labels
predict(cl, iris[1:5, 1:4])
#> 1 2 3 4 5 
#> 2 2 2 2 2