1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cluster_performance.R
\name{cluster_performance}
\alias{cluster_performance}
\alias{cluster_performance.hclust}
\title{Performance of clustering models}
\usage{
cluster_performance(model, ...)
\method{cluster_performance}{hclust}(model, data, clusters, ...)
}
\arguments{
\item{model}{Cluster model.}
\item{...}{Arguments passed to or from other methods.}
\item{data}{A data frame.}
\item{clusters}{A vector with clusters assignments (must be same length as
rows in data).}
}
\description{
Compute performance indices for clustering solutions.
}
\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)
}
|