Wraps stats::kmeans with Hartigan-Wong (the default).
Examples
set.seed(1)
morie_kmeans_clustering(x = rnorm(50))
#> $estimate
#> [1] 5.315168
#>
#> $labels
#> [1] 1 1 1 2 2 1 2 2 2 1 2 2 1 0 2 1 1 2 2 2 2 2 1 0 2 1 1 0 1 2 2 1 2 1 0 1 1 1
#> [39] 2 2 1 1 2 2 1 1 2 2 1 2
#>
#> $centers
#> [,1]
#> 1 -1.7629659
#> 2 -0.3024474
#> 3 0.7803383
#>
#> $inertia
#> [1] 5.315168
#>
#> $n_iter
#> [1] 2
#>
#> $n_clusters
#> [1] 3
#>
#> $n
#> [1] 50
#>
#> $method
#> [1] "K-means (Hartigan-Wong)"
#>
