We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In chapter 9's notebook cell 100:
resolution = 100 grid = np.arange(-10, 10, 1 / resolution) xx, yy = np.meshgrid(grid, grid) X_full = np.vstack([xx.ravel(), yy.ravel()]).T pdf = np.exp(gm.score_samples(X_full)) pdf_probas = pdf * (1 / resolution) ** 2 pdf_probas.sum()
You have used score_samples() as PDF, but Scikit-Learn's documentation says it's the likelihood. Also later in cell 109:
score_samples()
n_clusters = 3 n_dims = 2 n_params_for_weights = n_clusters - 1 n_params_for_means = n_clusters * n_dims n_params_for_covariance = n_clusters * n_dims * (n_dims + 1) // 2 n_params = n_params_for_weights + n_params_for_means + n_params_for_covariance max_log_likelihood = gm.score(X) * len(X) # log(L^) bic = np.log(len(X)) * n_params - 2 * max_log_likelihood aic = 2 * n_params - 2 * max_log_likelihood print(f"bic = {bic}") print(f"aic = {aic}") print(f"n_params = {n_params}")
You have used score() (which is the mean of score_samples()) as likelihood. I'm a little confused. Can you explain why?
score()
The text was updated successfully, but these errors were encountered:
@ageron 🤔
Sorry, something went wrong.
No branches or pull requests
In chapter 9's notebook cell 100:
You have used
score_samples()
as PDF, but Scikit-Learn's documentation says it's the likelihood. Also later in cell 109:You have used
score()
(which is the mean ofscore_samples()
) as likelihood. I'm a little confused. Can you explain why?The text was updated successfully, but these errors were encountered: