December 2017
Intermediate to advanced
536 pages
14h 23m
English
We will use TensorFlow KmeansClustering Estimator class to implement k-means. It is defined in https://github.com/tensorflow/tensorflow/blob/r1.3/tensorflow/contrib/learn/python/learn/estimators/kmeans.py. It creates a model to run k-means and inference. According to the TensorFlow docs, once a KmeansClustering class object is created, it is instantiated with the following __init__ method:
__init__(num_clusters,model_dir=None,initial_clusters=RANDOM_INIT,distance_metric=SQUARED_EUCLIDEAN_DISTANCE,random_seed=0,use_mini_batch=True,mini_batch_steps_per_iteration=1,kmeans_plus_plus_num_retries=2,relative_tolerance=None,config=None)
TensorFlow Docs define these arguments as follows:
Read now
Unlock full access