Model Pipeline - Gaussian Mixture Models
This pipeline uses Gaussian Mixture Models (GMM) to find groups in data by assuming each group looks like a bell curve. It learns the shape and position of these bell curves to best explain the data.
This pipeline uses Gaussian Mixture Models (GMM) to find groups in data by assuming each group looks like a bell curve. It learns the shape and position of these bell curves to best explain the data.
Log-likelihood
-500 |************
-460 |*********
-430 |******
-420 |*****
1 2 3 4 Epochs| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | N/A | Initial log-likelihood before EM steps | |
| 2 | N/A | Log-likelihood improved after first EM iteration | |
| 3 | N/A | Model parameters better fit data clusters | |
| 4 | N/A | Convergence reached; log-likelihood stabilizes |
from sklearn.mixture import GaussianMixture import numpy as np X = np.array([[1], [2], [3], [10], [11], [12]]) gmm = GaussianMixture(n_components=2, random_state=0) gmm.fit(X) labels = gmm.predict(X) print(labels.tolist())
from sklearn.mixture import GaussianMixture X = [[1, 2], [3, 4], [5, 6]] gmm = GaussianMixture(n_components=2) gmm.fit(X) labels = gmm.predict(X) print(labels)
Pass the test and this pattern moves unknown