kLabUM / rrcf

🌲 Implementation of the Robust Random Cut Forest algorithm for anomaly detection on streams
https://klabum.github.io/rrcf/
MIT License
488 stars 111 forks source link

Added random state to the constructor of RCTree #55

Closed nikosgavalas closed 5 years ago

nikosgavalas commented 5 years ago

Added an optional parameter to the constructor of RCTree, called "random_state". It can be int, an np.random.RandomState instance of None (default), like in all sklearn modules.

This allows for optional generation of the same tree, if the same seed (int or RandomState) is provided, which is incredibly useful (for writing tests etc.)

mdbartos commented 5 years ago

Hi Nick,

Thanks for your contribution. Could you increase test coverage so that it's the same as it was before?

Thanks, MDB

mdbartos commented 5 years ago

Also, can you add a description of the random_state argument to the docstring?

Edit: Just realized I'm missing some descriptions for some of the other newer input arguments to init.

nikosgavalas commented 5 years ago

Hello,

I did the necessary changes.

Thanks, Nick

mdbartos commented 5 years ago

Looks good to me!