cluster_performance: Performance of clustering models

View source: R/cluster_performance.R

cluster_performanceR Documentation

Performance of clustering models

Description

Compute performance indices for clustering solutions.

Usage

cluster_performance(model, ...)

## S3 method for class 'hclust'
cluster_performance(model, data, clusters, ...)

Arguments

model

Cluster model.

...

Arguments passed to or from other methods.

data

A data frame.

clusters

A vector with clusters assignments (must be same length as rows in data).

Examples

# kmeans
model <- kmeans(iris[1:4], 3)
cluster_performance(model)

# hclust
data <- iris[1:4]
model <- hclust(dist(data))
clusters <- cutree(model, 3)
cluster_performance(model, data, clusters)

# Retrieve performance from parameters
params <- model_parameters(kmeans(iris[1:4], 3))
cluster_performance(params)

easystats/parameters documentation built on Feb. 14, 2025, 9:35 a.m.