Skip to content

k_means() defines a model that fits clusters based on distances to a number of centers.

Usage

k_means(mode = "partition", engine = "stats", num_clusters = NULL)

Arguments

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 "stats".

num_clusters

Positive integer, number of clusters in model.

Value

A k_means cluster specification.

Examples

# Show all engines
modelenv::get_from_env("k_means")
#> # A tibble: 2 × 2
#>   engine   mode     
#>   <chr>    <chr>    
#> 1 stats    partition
#> 2 ClusterR partition

k_means()
#> K Means Cluster Specification (partition)
#> 
#> Computational engine: stats 
#>