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
465989f9
Unverified
Commit
465989f9
authored
Aug 29, 2022
by
James Lamb
Committed by
GitHub
Aug 29, 2022
Browse files
[python-package] fix mypy error about type change in Dataset.feature_num_bin() (#5447)
parent
be7f3213
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+4
-2
No files found.
python-package/lightgbm/basic.py
View file @
465989f9
...
...
@@ -2485,10 +2485,12 @@ class Dataset:
"""
if
self
.
handle
is
not
None
:
if
isinstance
(
feature
,
str
):
feature
=
self
.
feature_name
.
index
(
feature
)
feature_index
=
self
.
feature_name
.
index
(
feature
)
else
:
feature_index
=
feature
ret
=
ctypes
.
c_int
(
0
)
_safe_call
(
_LIB
.
LGBM_DatasetGetFeatureNumBin
(
self
.
handle
,
ctypes
.
c_int
(
feature
),
ctypes
.
c_int
(
feature
_index
),
ctypes
.
byref
(
ret
)))
return
ret
.
value
else
:
...
...
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