The following options are supported.
Option name |
Type |
Default |
Description |
Constraints |
|---|---|---|---|---|
algorithm |
string |
\(s=\) lloyd |
Choice of underlying k-means algorithm. |
\(s=\) elkan, hartigan-wong, lloyd, or macqueen. |
initialization method |
string |
\(s=\) random |
How to determine the initial cluster centres. |
\(s=\) k-means++, random, random partitions, or supplied. |
convergence tolerance |
real |
\(r=10^{-4}\) |
Convergence tolerance. |
\(0 \le r\) |
seed |
integer |
\(i=0\) |
Seed for random number generation; set to -1 for non-deterministic results. |
\(-1 \le i\) |
max_iter |
integer |
\(i=300\) |
Maximum number of iterations. |
\(1 \le i\) |
n_clusters |
integer |
\(i=1\) |
Number of clusters required. |
\(1 \le i\) |
check data |
string |
\(s=\) no |
Check input data for NaNs prior to performing computation. |
\(s=\) no, or yes. |
n_init |
integer |
\(i=10\) |
Number of runs with different random seeds (ignored if you have specified initial cluster centres). |
\(1 \le i\) |
storage order |
string |
\(s=\) column-major |
Whether data is supplied and returned in row- or column-major order. |
\(s=\) c, column-major, f, fortran, or row-major. |