Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
2a5e33b7
Unverified
Commit
2a5e33b7
authored
Jul 29, 2025
by
Oliver Borchert
Committed by
GitHub
Jul 28, 2025
Browse files
[python-package] Fix mypy checks in `compat.py` (#6898)
Co-authored-by:
James Lamb
<
jaylamb20@gmail.com
>
parent
c73a21b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
python-package/lightgbm/compat.py
python-package/lightgbm/compat.py
+5
-5
No files found.
python-package/lightgbm/compat.py
View file @
2a5e33b7
...
@@ -36,16 +36,16 @@ try:
...
@@ -36,16 +36,16 @@ try:
# validate_data() was added in scikit-learn 1.6, this function roughly imitates it for older versions.
# validate_data() was added in scikit-learn 1.6, this function roughly imitates it for older versions.
# It can be removed when lightgbm's minimum scikit-learn version is at least 1.6.
# It can be removed when lightgbm's minimum scikit-learn version is at least 1.6.
def
validate_data
(
def
validate_data
(
_estimator
,
_estimator
:
Any
,
X
,
X
:
Any
,
y
=
"no_validation"
,
y
:
Any
=
"no_validation"
,
accept_sparse
:
bool
=
True
,
accept_sparse
:
bool
=
True
,
# 'force_all_finite' was renamed to 'ensure_all_finite' in scikit-learn 1.6
# 'force_all_finite' was renamed to 'ensure_all_finite' in scikit-learn 1.6
ensure_all_finite
:
bool
=
False
,
ensure_all_finite
:
bool
=
False
,
ensure_min_samples
:
int
=
1
,
ensure_min_samples
:
int
=
1
,
# trap other keyword arguments that only work on scikit-learn >=1.6, like 'reset'
# trap other keyword arguments that only work on scikit-learn >=1.6, like 'reset'
**
ignored_kwargs
,
**
ignored_kwargs
:
Any
,
):
)
->
Any
:
# it's safe to import _num_features unconditionally because:
# it's safe to import _num_features unconditionally because:
#
#
# * it was first added in scikit-learn 0.24.2
# * it was first added in scikit-learn 0.24.2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment