milia.cluster.models.gmm#
Gaussian mixture model.
Classes
|
Probabilistic clustering with a Gaussian mixture. |
|
Validated hyperparameters of the Gaussian mixture clusterer. |
- class milia.cluster.models.gmm.GMM(n_clusters=3, covariance_type='full', random_state=0)#
Bases:
BaseClustererProbabilistic clustering with a Gaussian mixture.
- Parameters:
Examples
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> X = np.repeat(np.array([[0.0, 0.0], [6.0, 6.0], [0.0, 6.0]]), 20, axis=0) + rng.normal( ... scale=0.4, size=(60, 2) ... ) >>> GMM(n_clusters=3).fit(X).n_clusters_ 3
- class milia.cluster.models.gmm.GMMConfig(*, name='gmm', kind='clusterer', space=SearchSpace(n_clusters=(2, 12), covariance_type=['full', 'diag']), n_clusters=3, covariance_type='full', random_state=0)#
Bases:
BaseModelConfigValidated hyperparameters of the Gaussian mixture clusterer.
Fields mirror
GMM’s constructor;spaceis the default Optuna search space. Build the clusterer withmake("clusterer", "gmm", ...)orGMM(**config.params()).Examples
>>> GMMConfig().name 'gmm'