clusterOptimalK | R Documentation |
Visualize cluster data for assorted values of k and methods such as
WSS, Silhouette and Gap Statistic. See factoextra::fviz_nbclust
for more.
clusterOptimalK(
df,
method = c("wss", "silhouette", "gap_stat"),
drop_na = TRUE,
ohse = TRUE,
norm = TRUE,
quiet = TRUE,
...
)
df |
Dataframe |
method |
Character vector. |
drop_na |
Boolean. Should NA rows be removed? |
ohse |
Boolean. Do you wish to automatically run one hot encoding to non-numerical columns? |
norm |
Boolean. Should the data be normalized? |
quiet |
Boolean. Keep quiet? If not, print messages. |
... |
Additional parameters passed to |
Plot. Optimal number of clusters of df
data.frame given a
selected method
.
Other Clusters:
clusterKmeans()
,
clusterVisualK()
,
reduce_pca()
,
reduce_tsne()
# You must have "factoextra" library to use this auxiliary function:
## Not run:
data("iris")
df <- subset(iris, select = c(-Species))
# Calculate and plot optimal k clusters
clusterOptimalK(df)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.