Appendix A: Bayesian Deep Learning
Handling uncertainty is what Bayesian networks are good at. Bayesian Gaussian mixture models use the BayesianGaussianMixture class, which is capable of giving weights equal (or close) to zero to remove unnecessary clusters, rather than your manually searching for the optimal number of clusters. This appendix provides a crash course on the essentials of Bayesian networks.
Bayesian Networks at a Glance
Set the number of clusters n_components to a value that you have good reason to believe is greater than the optimal number of clusters (this assumes some minimal knowledge about the problem at hand), and the algorithm will eliminate the unnecessary clusters automatically.
For example, let’s set the number of clusters ...