find_elbow: find_elbow This function takes in unlabeled, scaled data and...

Description Usage Arguments Value Examples

View source: R/find_elbow.R

Description

find_elbow This function takes in unlabeled, scaled data and performs clustering using the KMeans clustering algorithm values of K up to the min(10, n_samples - 1). It returns the value for K which maximizes the mean silhouette scores across all clusters.

Usage

1

Arguments

X

matrix: unlabeled data with appropriate preprocessing steps applied.

Value

numeric: The optimal choice of K in the K-means algorithm according to silhouette score.

Examples

1
2
3
X <- array(c(c(0, 1, 10, 10, 10, 10), c(0, 1, 10, 11, 0, 1)), dim = c(6,2))
X_scaled <- preprocess(X)
optimal_K <- find_elbow(X_scaled)

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