Skip to content

Instantly share code, notes, and snippets.

@ogyalcin
Created June 24, 2021 08:55
Show Gist options
  • Save ogyalcin/69b97de6fe6c5757f25033a38dc5fbb6 to your computer and use it in GitHub Desktop.
Save ogyalcin/69b97de6fe6c5757f25033a38dc5fbb6 to your computer and use it in GitHub Desktop.
# If you are using Colab, you need to install rulefit library
!pip install rulefit
from rulefit import RuleFit
# Create and Train RuleFit Model
rulefit = RuleFit(tree_generator=RandomForestRegressor(n_estimators = 100))
rulefit.fit(X.values, y, feature_names=X.columns)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment