KMeansTF(n_clusters=8, init='k-means++', n_init: int = 10, max_iter=300, tol=0.0001, verbose=0, random_state=None)¶
For full desription of methods see base class
- n_clusters (int) – The number of clusters to form as well as the number of centroids to generate.
- init ('k-means++','random' or array) – method of initialization
- n_init (int) – number of runs with different initializations (default 10)
- max_iter (int) – Maximum number of Lloyd iterations for a single run of the k-means algorithm.
- tol (float) – Relative tolerance with regards to inertia to declare convergence.
- verbose (int) – Verbosity mode.
- random_state (int) – None, or integer to seed the random number generators of python, numpy and tensorflow
- cluster_centers (array, [n_clusters, n_features]) – Coordinates of cluster centers. If the algorithm stops before fully converging (see tol and max_iter), these will not be consistent with labels_.
- labels (array, shape(n_samples)) – Labels of each point, i.e. index of closest centroid
- inertia (float) – Sum of squared distances of samples to their closest cluster center.
- n_iter (int) – Number of iterations run.
__init__(n_clusters=8, init='k-means++', n_init: int = 10, max_iter=300, tol=0.0001, verbose=0, random_state=None)¶
Initialize self. See help(type(self)) for accurate signature.
__init__([n_clusters, init, max_iter, tol, …])
Compute k-means clustering.
Compute cluster centers and predict cluster index for each sample.
Get error and utility values wrt.
get_gaussian_mixture([n, d, g, sigma])
generate test data from Gaussian mixture distribution
Get collected history data of performed run of fit().
Get statistics of performed run of fit()
Get params used to define class
print tensorflow version and availability of GPUs.
Predict the closest cluster each sample in X belongs to.
self_test([X, n_clusters, n_init, n, d, g, …])
setting random seed for tensorflow, python and numpy