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

Issues when using RandomForestRegressor as estimator in HSTreeRegressor #212

Open
facusapienza21 opened this issue Sep 20, 2024 · 0 comments

Comments

@facusapienza21
Copy link

Hi! I am trying to use the shrinkage algorithm in some tree-based ensemble methods I have (more precisely, Random Forrest). I know how to use imodels with decision trees, but I want to use the shrinkage in a ensemble of trees just as it is mentioned at the end of the docs. Here is the example for a regression problem:

from sklearn.ensemble import RandomForestRegressor 
from imodels import HSTreeRegressor
ensemble = RandomForestRegressor()
model_imodel = HSTreeRegressor(estimator_=ensemble)
model_imodel = model.fit(X, Y)

However, it seems that the HSTreeRegressor class just accept tree methods.

InvalidParameterError: The 'decision_tree' parameter of export_text must be an instance of 'sklearn.tree._classes.DecisionTreeClassifier' or an instance of 'sklearn.tree._classes.DecisionTreeRegressor'. Got RandomForestClassifier() instead.

Is this correct? Am I doing something wrong or something has changed in the API in recent versions?

Thank you so much!

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

1 participant