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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

HistGradientBoostingClassifier not working #84

Open
ciberger opened this issue Jul 21, 2020 · 2 comments
Open

HistGradientBoostingClassifier not working #84

ciberger opened this issue Jul 21, 2020 · 2 comments

Comments

@ciberger
Copy link

Hi 馃憢

in the documentation says boruta implements all scikit-learn ensemble methods, but it doesn't work with HistGradientBoostingClassifier. Other methods described on the ensemble documentation (such as adaboost and gradient tree boosting) work as expected.

Thanks

Reprex

from boruta import BorutaPy

from sklearn.experimental import enable_hist_gradient_boosting
from sklearn.ensemble import HistGradientBoostingClassifier

clf = HistGradientBoostingClassifier()

boruta = BorutaPy(
   estimator=clf, 
   n_estimators='auto',
   max_iter=10)

boruta.fit(np.array(X_train), np.array(y_train))

Error message

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
 in 
---> 18 boruta.fit(np.array(X_train), np.array(y_train))

~/.pyenv/versions/python-3.7.4/lib/python3.7/site-packages/boruta/boruta_py.py in fit(self, X, y)
    199         """
    200 
--> 201         return self._fit(X, y)
    202 
    203     def transform(self, X, weak=False):

~/.pyenv/versions/python-3.7.4/lib/python3.7/site-packages/boruta/boruta_py.py in _fit(self, X, y)
    268         # set n_estimators
    269         if self.n_estimators != 'auto':
--> 270             self.estimator.set_params(n_estimators=self.n_estimators)
    271 
    272         # main feature selection loop

~/.pyenv/versions/python-3.7.4/lib/python3.7/site-packages/sklearn/base.py in set_params(self, **params)
    250                                  'Check the list of available parameters '
    251                                  'with `estimator.get_params().keys()`.' %
--> 252                                  (key, self))
    253 
    254             if delim:

ValueError: Invalid parameter n_estimators for estimator HistGradientBoostingClassifier(). Check the list of available parameters with `estimator.get_params().keys()`.
@WhiteLedAnn
Copy link

Also 'HistGradientBoostingClassifier' object has no attribute 'tree_'

@WhiteLedAnn
Copy link

Also they say : "we use max_iter instead n_estimators" but i dont get how can I receive my list of trees by int number of iterations

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

2 participants