avg_sil_score: avg_sil_score This function takes in a vector of cluster...

Description Usage Arguments Value Examples

View source: R/find_elbow.R

Description

avg_sil_score This function takes in a vector of cluster labels and a corresponding array of points and calculates the average silhouette score across all clusters. It returns the value of the average silhouette score.

Usage

1

Arguments

labels

vector: A vector of cluster labels.

X

matrix: A (n_points x n_features) matrix of points.

Value

numeric: The average silhouette score.

Examples

1
2
3
helper_data <- array(c(c(0, 10, 10), c(0, 10, 11)), dim = c(3,2))
helper_clusters <- c(1, 2, 2)
avg_sil_score(helper_clusters, helper_data)

UBC-MDS/kmeaningfulR documentation built on March 29, 2021, 7:55 a.m.