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

Overwrites model's random state #67

Open
MichaelRFox opened this issue Nov 13, 2019 · 2 comments
Open

Overwrites model's random state #67

MichaelRFox opened this issue Nov 13, 2019 · 2 comments

Comments

@MichaelRFox
Copy link

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)'

@DreHar
Copy link

DreHar commented Nov 14, 2019

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.

@sskarkhanis
Copy link

I kept wondering what I was doing wrong with using xgboost & boruta. I hope there is a fix soon.

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

No branches or pull requests

3 participants