I am trying to fit a GMM in sklearn and i see that the model converges at around epoch 3 but i cannot seems to access the log-likelihood score computed at each epoch.
from sklearn.mixture import GaussianMixture
gmm = GaussianMixture(n_components=4, tol=1e-8).fit(data)
Is there a way to do access the log-likelihood scores somehow for each epoch?
If you just want to look at the loglik scores, you can set
verbose=2
to print the change in loglik andverbose_interval=1
to capture it at every step:To actually capture this value, depending on what you are using, you either write it to a log using
logging
, or for example below, in a jupyter notebook, this might work:Then we pass it into a dataframe and try to back calculate the likelihood: