0

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 ?

4

3 回答 3

1

From the docs of an older scikit-learn version you can read the following:

DEPRECATED: GMM.eval was renamed to GMM.score_samples in 0.14 and will be removed in 0.16.

So I think you should use score_samples().

于 2018-08-09T11:24:21.327 回答
1

Eval(X)

Parameters :

X: array_like, shape (n_samples, n_features) : List of n_features-dimensional data points. Each row corresponds to a single data point.

Returns :

logprob: array_like, shape (n_samples,) : Log probabilities of each data point in X

responsibilities: array_like, shape (n_samples, n_components) :

Posterior probabilities of each mixture component for each observation

Clearly , there is no workaround in the newer definition , it is the same and quite concise definition

于 2018-08-09T11:40:38.973 回答
0

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.

于 2018-08-09T12:23:11.800 回答