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

Can't run examples because lack of .fit() method #15

Closed
lccatala opened this issue Jan 17, 2024 · 2 comments · Fixed by #16
Closed

Can't run examples because lack of .fit() method #15

lccatala opened this issue Jan 17, 2024 · 2 comments · Fixed by #16

Comments

@lccatala
Copy link

When running the example, I run into the following error

Traceback (most recent call last): File "/home/luis/Projects/toys/main.py", line 12, in <module> reg.fit(X, y) File "/home/luis/Projects/toys/.venv/lib/python3.10/site-packages/m5py/main.py", line 214, in fit super(M5Base, self).fit(X, y, sample_weight=sample_weight, check_input=check_input) AttributeError: 'super' object has no attribute 'fit'

It seems the class BaseDecisionTree doesn't have a fit() method, however replacing it with _fit() it seems to work. I'm not sure if I should simply replace it or if the class should inherit from something like DecisionTreeRegressor (which would necessitate changing the criterion).

@smarie
Copy link
Owner

smarie commented Jan 17, 2024

Thanks for reporting this @lccatala ! Most probably this is a change due to a newer sklearn version. Could you please find out at which version this BaseDecisionTree.fit disappeared ? We'll then be able to implement a legacy-compliant PR to fix this.
Thanks!

@lccatala
Copy link
Author

lccatala commented Jan 17, 2024

Hi @smarie it seems it was in version 1.3
Version 1.2.2
Version 1.3.0

I've opened a PR with a quick fix, though I'm not sure if it's the best way of implementing it

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

Successfully merging a pull request may close this issue.

2 participants