Search code examples
pythonscikit-learngmm

scikit-learn deprecated GMM.eval() replacement


The eval() method under sklearn.mixture.GMM from the scikit-learn version 0.11 is deprecated. Is there a similar method or a workaround in the newest version 0.19.2 ?


Solution

  • The current method to get the responsibilities is predict_proba()

    predict_proba(): Predict posterior probability of each component given the data.

    Now you may think that the description does not say responsibilities. But this is what you need.

    The move from GMM to GaussianMixture class has been discussed thoroughly here:

    And the answer you need is described here:

    You may see some difference in results as described by the author in this comment

    The old one had a pretty strong regularization, the new one does not (by default).

    You can check the source code too to verify that this indeed returns the responsibilities.