Skip to content

Misleading chart title in Gaussian Mixture Model Selection documentation example code #17408

@tbenjamin-pl

Description

@tbenjamin-pl

Hey folks,

I cut-and-pasted the GMM selection example from the current stable GMM selection example page

This example code selects the best model and number of components, however the title of the bottom chart has a hard coded value for model and number of components. The code is correct for the exact example given, but if people cut and paste the code they will be confused by the fact that the num components and model on the bottom chart title will not change regardless of the input data.

The code in question is:

plt.title('Selected GMM: full model, 2 components')

third line from the bottom of the example code. I recommend to replace that line with:

plt.title('Selected GMM: {}, {} components'.format(best_gmm.covariance_type,
        best_gmm.n_components))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions