An example of Gaussian Mixtures using Scikit-Learn

We can now implement the Gaussian mixture algorithm using the Scikit-Learn implementation. The direct approach has already been shown in Chapter 2, Introduction to Semi-Supervised Learning. The dataset is generated to have three cluster centers and a moderate overlap due to a standard deviation equal to 1.5:

from sklearn.datasets import make_blobsnb_samples = 1000X, Y = make_blobs(n_samples=nb_samples, n_features=2, centers=3, cluster_std=1.5, random_state=1000)

The corresponding plot is shown in the following diagram:

The Scikit-Learn implementation is based on the GaussianMixture class

Get Mastering Machine Learning Algorithms now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.