-
Notifications
You must be signed in to change notification settings - Fork 4
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
Select between ._fit() of .fit() depending on the sklearn version used #16
Conversation
# (1) Build the initial tree as usual | ||
super(M5Base, self).fit(X, y, sample_weight=sample_weight, check_input=check_input) | ||
fit_method = getattr(super(M5Base, self), fit_method_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: readability: please move all new lines after the comment, or all lines before the comment.
Thanks @lccatala ! Although your code does the trick, it would probably be more readable/maintainable to rely on from packaging.version import Version
SKLEARN_VERSION = Version(sklearn.__version__)
SKLEARN13_OR_GREATER = SKLEARN_VERSION >= Version("1.3.0") Then you can use Thanks ! |
Also, can you please add a new changelog section |
Didn't know that existed, thanks! |
All set, thanks @lccatala ! Release 0.3.2 should be available in a few minutes |
Release is now available. Thanks a lot ! |
Fixes #15
Scikit-learn changed their API between versions 1.2.2 and 1.3.0, replacing BaseDecisionTree.fit() with BaseDecisionTree._fit().
I check the sklearn.version field before calling one or the other.