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

X

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

clusters

vector: A vector of cluster labels.

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)

trevorki/kmeaningfulR documentation built on Dec. 23, 2021, 12:04 p.m.