manifoldai / merf

Mixed Effects Random Forest
MIT License
219 stars 52 forks source link

Add options #22

Closed cunningjames closed 5 years ago

cunningjames commented 5 years ago

Add ability to specify additional parameters to RandomForestRegressor, with some minor error checking and two additional tests.

Options are passed in as dictionary argument rf_opts. n_estimators is ignored in favor of the argument to the constructor; oob_score is ignored and always set to True; warm_start is ignored (assumed to be False).

Two reasons this is helpful for me, at least: the random forest fit is often faster (particularly on my laptop) with n_jobs set to 1. I'm also hoping to investigate the shap interpretability package, but the underlying algorithms perform extremely poorly on deep trees, so the ability to specify max_depth would make that a bit easier.

This is a repeat of another pull request, closed by me, attempting to fix formatting issues that cause continuous integration to fail.

resdntalien commented 5 years ago

@cunningjames This just has some lint errors that need to be fixed. I can take a look at reviewing this tomorrow as well. Thanks for contributing!

resdntalien commented 5 years ago

@cunningjames I merged another PR with the same feature. I'm gonna go ahead and close this one. v0.3 (which I'm about to release now) will have this change.