k_means | R Documentation |
k_means()
defines a model that fits clusters based on distances to a number
of centers. This definition doesn't just include K-means, but includes
models like K-prototypes.
There are different ways to fit this model, and the method of estimation is chosen by setting the model engine. The engine-specific pages for this model are listed below.
stats: Classical K-means
ClusterR: Classical K-means
klaR: K-Modes
clustMixType: K-prototypes
k_means(mode = "partition", engine = "stats", num_clusters = NULL)
mode |
A single character string for the type of model. The only possible value for this model is "partition". |
engine |
A single character string specifying what computational engine
to use for fitting. Possible engines are listed below. The default for this
model is |
num_clusters |
Positive integer, number of clusters in model. |
For a K-means model, each cluster is defined by a location in the predictor space. Therefore, prediction in tidyclust is defined by calculating which cluster centroid an observation is closest too.
A k_means
cluster specification.
# Show all engines
modelenv::get_from_env("k_means")
k_means()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.