Skip to content

Latest commit

 

History

History
39 lines (34 loc) · 1.17 KB

README.md

File metadata and controls

39 lines (34 loc) · 1.17 KB

Estimation maximisation with gaussian mixture model (EM GMM)

EM GMM is an unsupervise learning algorithm by clustering data to different guassian model.

Package

You will need the following package to run the model

  • numpy
  • scipy
  • matplotlib

Usage

Import the model.

from EM_GMM import GMM_EM

Initialize the model and define the number of cluster.

model = GMM_EM(k)

Train the model with your data and also the number of iteration. You can also plot the training performance by setting plot = True. (Only for 2d data)

model.train(data, epoch, plot = True) # default is True


You can get the negative log likelihood (do not use the likelihood function).

model.li
#or get the final negative log likelihood
model.li[-1]

You can also plot the negative log likelihood in all training steps

model.plot_li()


Contribution

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.