Skip to content

Commit

Permalink
[python-package] add hint on dtypes in Dataset.set_field() (#5787)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Mar 16, 2023
1 parent 1787892 commit 2fe2bf0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2356,6 +2356,7 @@ def set_field(
ctypes.c_int(0),
ctypes.c_int(_FIELD_TYPE_MAPPER[field_name])))
return self
dtype: "np.typing.DTypeLike"
if field_name == 'init_score':
dtype = np.float64
if _is_1d_collection(data):
Expand Down

0 comments on commit 2fe2bf0

Please sign in to comment.