-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Adapt to scikit-learn 1.6 estimator tag changes #11021
Changes from 1 commit
79ed32c
3106cf1
3af44be
a9e30b4
6a12576
52e6d83
816667a
abfc6a6
ef725c1
d845922
b7564a1
8364e92
a511848
27a1bcc
18c602f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,23 +76,15 @@ def lazy_isinstance(instance: Any, module: str, name: str) -> bool: | |
class XGBModelBase: # type: ignore[no-redef] | ||
"""Dummy class for sklearn.base.BaseEstimator.""" | ||
|
||
pass | ||
|
||
class XGBClassifierBase: # type: ignore[no-redef] | ||
"""Dummy class for sklearn.base.ClassifierMixin.""" | ||
|
||
pass | ||
|
||
class XGBRegressorBase: # type: ignore[no-redef] | ||
"""Dummy class for sklearn.base.RegressorMixin.""" | ||
|
||
pass | ||
|
||
class LabelEncoder: # type: ignore[no-redef] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove the label encoder for now. It's not used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh great! I just removed that in a511848 Noticed that |
||
"""Dummy class for sklearn.preprocessing.LabelEncoder.""" | ||
|
||
pass | ||
|
||
XGBKFold = None | ||
XGBStratifiedKFold = None | ||
|
||
|
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.
Switching the placeholder classes in the scikit-learn-is-not-available branch of
compat.py
to be individual, differently-named, empty classes (instead of all usingobject
), led to these several of thesepylint
errors, insklearn.py
anddask.py
:(build link)
It seems that there are already many other places in this codebase where those warnings are being suppressed with
# pylint: disable
comments. So instead of adding more such comments (some of which would have to share a line with# type: ignore
comments formypy
), I'm proposing:pylint
warnings for the whole project# pylint: disable
comments about themI don't feel that strongly... if you'd prefer to keep suppressing individual cases of these, please let me know and I'll happily switch back to
#pylint: disable
comments.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.
Looks good to me.
@RAMitchell find the pylint checks helpful. I myself prefer mypy checks and think the pylint is not particularly suitable for ML libraries like XGBoost. In general, I don't have a strong opinion about these "structural" or naming warnings and care mostly about warnings like unused imports or use before definition.