In this chapter, we learned that the clustering algorithm is a type of unsupervised learning and how the K-means and EM algorithms work. Since the EM algorithm is a general version of K-means, we are now capable of applying the EM algorithm to more extensive use cases. Practically, the EM algorithm requires intensive computation power, and so we tend to use K-means to estimate the structure of the data points roughly first and run the EM algorithm later. Combining these two algorithms is a common pattern to follow when we want to complete any clustering task.
We also demonstrated how K-means can be implemented using TensorFlow.js. We did this by showing a clustering example in a two-dimensional space. This example illustrated that data points from multiple Gaussian distributions can be segmented into clusters that are represented by centroids. While we implemented a K...