powered by
Returns the cluster of the closest medoid, for a new dataset.
# S3 method for pam predict(object, newdata, ...)
A vector of cluster numbers.
The clustering (created by PAM).
PAM
A new dataset (a data.frame), with the same variables as the learning dataset.
data.frame
Other parameters.
PAM, predict.kmeans
predict.kmeans
require (datasets) data (iris) d = splitdata (iris, 5) model = PAM (d$train.x, 3) table (predict (model, d$test.x), d$test.y)
Run the code above in your browser using DataLab