cerlymarco / linear-tree

A python library to build Model Trees with Linear Models at the leaves.
MIT License
351 stars 54 forks source link

TypeError min_impurity_split #10

Closed 5xcor closed 3 years ago

5xcor commented 3 years ago

Hi,

I trying notebook usage-LinearBoost with collab.

in 3 cell: regr = LinearBoostRegressor(Ridge(), loss='linear') regr.fit(X, y)

I have a problem:

`TypeError Traceback (most recent call last)

in () 1 regr = LinearBoostRegressor(Ridge(), loss='linear') ----> 2 regr.fit(X, y) 1 frames /usr/local/lib/python3.7/dist-packages/lineartree/_classes.py in _fit(self, X, y, sample_weight) 943 min_impurity_decrease=self.min_impurity_decrease, 944 min_impurity_split=self.min_impurity_split, --> 945 ccp_alpha=self.ccp_alpha 946 ) 947 TypeError: __init__() got an unexpected keyword argument 'min_impurity_split'` linear-tree I install: %pip install linear-tree
cerlymarco commented 3 years ago

Hi, thanks for your feedback!

This is due to scikit-learn-1.0 where min_impurity_split has been deprecated in favor of min_impurity_decrease

I'll plan to make the adjustment in order to work with scikit-learn-1.0

If you support the project don't forget to leave a star ;-)