boruta_py
boruta_py copied to clipboard
Overwrites model's random state
It seems that boruta passes RandomState(MT19937) to the model it is fitting regardless of the model's parameters. This doesn't bother a random forest model, but causes an xgBoost model to fail with the following error:
ValueError: Please check your X and y variable. The provided estimator cannot be fitted to your data. Invalid Parameter format for seed expect int but value='RandomState(MT19937)'
Try changing line 283 in boruta/boruta_py.py to something like:
self.estimator.set_params(random_state=self.random_state.random_integers(1e9))
If you are concerned with the seed you could pass something nicer.. this is just a hack.
I'm not sure if this is the best way to do it but maybe boruta should instead of passing the seed object it should take a seeded integer like this so it's compatible with more models (xgboost). I would suggest it taking either a seed integer, or if it's a seed object to generate the first integer from that object.
I kept wondering what I was doing wrong with using xgboost & boruta. I hope there is a fix soon.