cluster_pam: PAM

View source: R/clu_pam.R

cluster_pamR Documentation

PAM

Description

Creates a clusterer object that uses the Partition Around Medoids (PAM) method It wraps the cluster library.

Usage

cluster_pam(k = 1)

Arguments

k

the number of clusters to generate.

Value

returns PAM object.

Examples

# setup clustering
model <- cluster_pam(k = 3)

#load dataset
data(iris)

# build model
model <- fit(model, iris[,1:4])
clu <- cluster(model, iris[,1:4])
table(clu)

# evaluate model using external metric
eval <- evaluate(model, clu, iris$Species)
eval

daltoolbox documentation built on Nov. 3, 2024, 9:06 a.m.