% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/unsupervised-validation.R
\name{tidy_silhouette}
\alias{tidy_silhouette}
\title{Tidy Silhouette Analysis}
\usage{
tidy_silhouette(clusters, dist_mat)
}
\arguments{
\item{clusters}{Vector of cluster assignments}

\item{dist_mat}{Distance matrix (dist object)}
}
\value{
A list of class "tidy_silhouette" containing:
\itemize{
\item silhouette_data: tibble with silhouette values for each observation
\item avg_width: average silhouette width
\item cluster_avg: average silhouette width by cluster
}
}
\description{
Compute silhouette statistics for cluster validation
}
\examples{
\donttest{
km <- kmeans(iris[, 1:4], centers = 3, nstart = 25)
d <- dist(iris[, 1:4])
sil <- tidy_silhouette(km$cluster, d)
}

}
