predict.pam: Predict function for PAM

predict.pamR Documentation

Predict function for PAM

Description

Returns the cluster of the closest medoid, for a new dataset.

Usage

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

Arguments

object

The clustering (created by PAM).

newdata

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

...

Other parameters.

Value

A vector of cluster numbers.

See Also

PAM, predict.kmeans

Examples

require (datasets)
data (iris)
d = splitdata (iris, 5)
model = PAM (d$train.x, 3)
table (predict (model, d$test.x), d$test.y)

fdm2id documentation built on Aug. 28, 2026, 9:07 a.m.