powered by
Visualize cluster data for assorted values of k and methods such as WSS, Silhouette and Gap Statistic. See factoextra::fviz_nbclust for more.
factoextra::fviz_nbclust
clusterOptimalK( df, method = c("wss", "silhouette", "gap_stat"), drop_na = TRUE, ohse = TRUE, norm = TRUE, quiet = TRUE, ... )
Plot. Optimal number of clusters of df data.frame given a selected method.
df
method
Dataframe
Character vector.
Boolean. Should NA rows be removed?
Boolean. Do you wish to automatically run one hot encoding to non-numerical columns?
Boolean. Should the data be normalized?
Boolean. Keep quiet? If not, print messages.
Additional parameters passed to factoextra::fviz_nbclust
Other Clusters: clusterKmeans(), clusterVisualK(), reduce_pca(), reduce_tsne()
clusterKmeans()
clusterVisualK()
reduce_pca()
reduce_tsne()
# You must have "factoextra" library to use this auxiliary function: if (FALSE) { data("iris") df <- subset(iris, select = c(-Species)) # Calculate and plot optimal k clusters clusterOptimalK(df) }
Run the code above in your browser using DataLab