Problem with GMM library from sklear.mixture?

The newer versions of scikit-learn don't have that module. From looking at the versions it was deprecated in v 0.18 and removed in v 0.20. Here is the link to the OLD 0.18 module, which is the first instance i could find that shows a deprecation warning. https://scikit-learn.org/0.18/modules/generated/sklearn.mixture.GMM.html#sklearn.mixture.GMM if you want you can install an older version pip install -Iv scikit-learn==0.15, or if you want to use the newer version, adapt the parameters of your GaussianMixture to reflect their new names (e.g. in GaussianMixture, max_iter is the number of iterations, instead of n_iter).


sklearn Gaussian Mixture implementation

Old (outdated, not supported in newer sklearn versions):

from sklearn.mixture import GMM     
model = GMM(n_components=3,covariance_type='full')

New and supported

from sklearn import mixture
model = mixture.GaussianMixture(n_components=3, covariance_type='full')

n_components default value is 1, choose what you want. That's number of mixture components.

Tags:

Python