Correction to the source code of Figure 4.2

36 views
Skip to first unread message

Ramon Crehuet

unread,
Apr 28, 2016, 6:41:56 AM4/28/16
to astroML-general
Dear all,
The source code for figure 4.2 from: http://www.astroml.org/book_figures/chapter4/fig_GMM_1D.html does not work with sklearn 0.17.1 This is because the methods of GMM have changed. To make it work I had to make the following changes:
Line 86:
logprob, responsibilities = M_best.score_samples(x[:, np.newaxis])

(eval is no longer a valid method)

Line 110:
p = M_best.predict_proba(x[:, np.newaxis])

(x should hive the same dimensions as X)

Hope this helps!

Ramon

Reply all
Reply to author
Forward
0 new messages