AtheMathmo / rusty-machine

Machine Learning library for Rust
https://crates.io/crates/rusty-machine/
MIT License
1.25k stars 153 forks source link

Implemented the poisson, binomial and multinomial distributions #173

Closed dyule closed 7 years ago

dyule commented 7 years ago

Basically, as it says. It also implements the gamma function for Rust, since I could not find any other implementations. After some refining here, I may try to submit that part to the main Rust library, since they link it from C when available (i.e. not on Windows).

A great deal of the sampling code is pretty dense, and algorithmic. This is because it is based on previous implementations, which are themselves based directly on some academic papers with obtuse notation (references and such are noted in the comments)

Let me know what you think, and I can continue to iterate.

AtheMathmo commented 7 years ago

I am happy to review and merge this, I can see you have put a lot of effort in and it looks great!

But I had planned on removing this section of rusty-machine at some point. I discovered statrs which offers much of this functionality in a dedicated fashion. I plan to incorporate this into rusty-machine rather than reimplementing everything.

With that said I haven't spent too much time thinking about this, what is your opinion?

dyule commented 7 years ago

I hadn't seen statrs when I started on this, or I wouldn't have. I looked for something similar, but I guess my search skills were weak. Anyways, I can't see much value in including this here when it's already implemented much cleaner elsewhere.