Skip to contents

Batch draws via the shared LCG stream, not numpy PCG64 choice.

Usage

morie_geron_minibatch_kmeans(X, n_clusters, batch_size, seed = 0, n_iter = 100)

Arguments

X

Data.

n_clusters

Clusters.

batch_size

Points sampled per iteration.

seed

Seed.

n_iter

Iterations.

Value

List with labels, centers, inertia, counts, n_iter, estimate, n, method.

Examples

X <- matrix(c(1, 2, 3, 4), ncol = 1)
morie_geron_minibatch_kmeans(X, n_clusters = 2, batch_size = 2,
    seed = 0, n_iter = 200)
#> $labels
#> [1] 0 0 1 1
#> 
#> $centers
#>       [,1]
#> [1,] 1.490
#> [2,] 3.495
#> 
#> $inertia
#> [1] 1.00025
#> 
#> $counts
#> [1] 200 200
#> 
#> $n_iter
#> [1] 200
#> 
#> $estimate
#> [1] 1.00025
#> 
#> $n
#> [1] 4
#> 
#> $method
#> [1] "Mini-batch k-means"
#>