from sklearn.datasets import make_blobs
from sklearn.mixture import GaussianMixture
X, _ = make_blobs(n_samples=180, centers=3, cluster_std=1.2, random_state=42)
modelo = GaussianMixture(n_components=3, covariance_type="full", reg_covar=1e-5, random_state=42)
modelo.fit(X)
pertencimento = modelo.predict_proba(X[:3])
print("Responsabilidades:", pertencimento.round(3))
print("BIC:", round(modelo.bic(X), 2))
