The following options are supported.
Option name |
Type |
Default |
Description |
Constraints |
|---|---|---|---|---|
low precision convergence tolerance |
real |
\(r=10^{-2}\) |
If mixed precision iterative refinement is enabled, convergence tolerance for the low precision phase. |
\(0 \le r\) |
convergence tolerance |
real |
\(r=10^{-4}\) |
Convergence tolerance. |
\(0 \le r\) |
normalize data |
string |
\(s=\) yes |
Whether to normalize the input data before clustering. This option is only used if distance is set to cosine. |
\(s=\) no, or yes. |
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. |
n_init |
integer |
\(i=10\) |
Number of runs with different random seeds (ignored if you have specified initial cluster centres). |
\(1 \le i\) |
low precision max_iter |
integer |
\(i=200\) |
If mixed precision iterative refinement is enabled, maximum number of iterations for the low precision phase. |
\(1 \le i\) |
check data |
string |
\(s=\) no |
Check input data for NaNs prior to performing computation. |
\(s=\) no, or yes. |
max_iter |
integer |
\(i=300\) |
Maximum number of iterations. |
\(1 \le i\) |
seed |
integer |
\(i=0\) |
Seed for random number generation; set to -1 for non-deterministic results. |
\(-1 \le i\) |
initialization method |
string |
\(s=\) k-means++ |
How to determine the initial cluster centres. |
\(s=\) afk-mc2, k-means++, random, random partitions, or supplied. |
algorithm |
string |
\(s=\) lloyd |
Choice of underlying k-means algorithm. |
\(s=\) elkan, hartigan-wong, lloyd, or macqueen. |
mixed precision |
string |
\(s=\) no |
Whether to use mixed precision iterative refinement, in which lower precision arithmetic is used before switching to the working precision for the final iterations. |
\(s=\) no, or yes. |
n_clusters |
integer |
\(i=1\) |
Number of clusters required. |
\(1 \le i\) |
afk-mc2 samples |
integer |
\(i=50\) |
Number of samples to take for the AFK-MC2 initialization method. |
\(1 \le i\) |
distance |
string |
\(s=\) euclidean |
Distance metric used for clustering. Use ‘euclidean’ for standard k-means or ‘cosine’ for spherical k-means (not compatible with Hartigan-Wong). |
\(s=\) cosine, or euclidean. |
empty clusters |
string |
\(s=\) ignore |
How to deal with empty clusters at the end of a k-means iteration. |
\(s=\) error, ignore, or split. |