Skip to contents

RNG substitute via the shared LCG stream (not numpy PCG64).

Usage

morie_geron_kmeans_plus_plus(X, n_clusters, seed = 0)

Arguments

X

Data.

n_clusters

Centres.

seed

Seed.

Value

List with centers, indices, d2, min_pair_distance, estimate, n, method.

Examples

morie_geron_kmeans_plus_plus(X = c(1, 2, 3, 4, 5, 6, 7, 8), n_clusters = 5L)
#> $centers
#>      [,1]
#> [1,]    2
#> [2,]    6
#> [3,]    4
#> [4,]    5
#> [5,]    7
#> 
#> $indices
#> [1] 1 5 3 4 6
#> 
#> $d2
#> [1] 1 0 1 0 0 0 0 1
#> 
#> $min_pair_distance
#> [1] 1
#> 
#> $estimate
#> [1] 3
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "k-means++ seeding (D^2 sampling)"
#>