Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GaussianMixtureModel in linfa-clustering #56

Merged
merged 11 commits into from
Nov 13, 2020

Conversation

relf
Copy link
Member

@relf relf commented Nov 6, 2020

This is a port of the Gaussian Mixture Model.
Some limitations wrt to the original:

  • only full covariance type is implemented,
  • gaussian parameters can not be initialized by the user,

I am fairly new to Rust programming, so feedback is welcome.

Copy link
Member

@bytesnake bytesnake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work, I added some small comments.

  • we should move away from implicit error handling with panics, I know that we do panic in a lot of places at the moment, but returning an error is much more flexible
  • GmmHyperParams::fit should implicitly build the parameter set
  • can you add at least a second test for the algorithm?

otherwise the code is really clean and easy to read 👍 you have to rebase the PR to the latest commit with #55 merged

linfa-clustering/src/gaussian_mixture/algorithm.rs Outdated Show resolved Hide resolved
linfa-clustering/src/gaussian_mixture/algorithm.rs Outdated Show resolved Hide resolved
linfa-clustering/src/gaussian_mixture/algorithm.rs Outdated Show resolved Hide resolved
linfa-clustering/src/gaussian_mixture/algorithm.rs Outdated Show resolved Hide resolved
linfa-clustering/src/gaussian_mixture/algorithm.rs Outdated Show resolved Hide resolved
linfa-clustering/src/gaussian_mixture/algorithm.rs Outdated Show resolved Hide resolved
linfa-clustering/src/gaussian_mixture/algorithm.rs Outdated Show resolved Hide resolved
linfa-clustering/src/gaussian_mixture/algorithm.rs Outdated Show resolved Hide resolved
Copy link
Member

@bytesnake bytesnake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good to me, do you want to add anything before merging?

@relf
Copy link
Member Author

relf commented Nov 13, 2020

Nope, it is ok for me as well.

@bytesnake bytesnake merged commit 60a36b6 into rust-ml:master Nov 13, 2020
@relf relf deleted the ft_gaussian_mixture branch November 13, 2020 16:07
@bytesnake bytesnake mentioned this pull request Nov 13, 2020
24 tasks
VasanthakumarV pushed a commit to VasanthakumarV/linfa that referenced this pull request Dec 8, 2020
* Add GaussianMixtureModel clustering algorithm (rebase)

* Add ndarray-linalg dependency

* Add test-openblas-system feature

* Fix from review

* Return errors instead of panicking

* Fix error management

* Revert unwanted change

* Add covariance, precisions getters and add another test

* Add with_rng(), remove params_with_rng()

* Use Lapack + Scalar bounds to get cholesky working

* Remove GmmHyperParamsBuilder, add hyperparams invalid value tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants