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
7af85cee
"include/vscode:/vscode.git/clone" did not exist on "25d149d8ceb92838dbf2f7331f9dc0dec701ffd8"
Unverified
Commit
7af85cee
authored
Jan 19, 2023
by
IdoKendo
Committed by
GitHub
Jan 18, 2023
Browse files
[python-package] Fix mypy errors for predict() method (#5678)
parent
3c3f79e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
3 deletions
+51
-3
python-package/lightgbm/dask.py
python-package/lightgbm/dask.py
+51
-3
No files found.
python-package/lightgbm/dask.py
View file @
7af85cee
...
...
@@ -1221,13 +1221,29 @@ class DaskLGBMClassifier(LGBMClassifier, _DaskLGBMModel):
{
_lgbmmodel_doc_custom_eval_note
}
"""
def
predict
(
self
,
X
:
_DaskMatrixLike
,
**
kwargs
:
Any
)
->
dask_Array
:
def
predict
(
self
,
X
:
_DaskMatrixLike
,
raw_score
:
bool
=
False
,
start_iteration
:
int
=
0
,
num_iteration
:
Optional
[
int
]
=
None
,
pred_leaf
:
bool
=
False
,
pred_contrib
:
bool
=
False
,
validate_features
:
bool
=
False
,
**
kwargs
:
Any
)
->
dask_Array
:
"""Docstring is inherited from the lightgbm.LGBMClassifier.predict."""
return
_predict
(
model
=
self
.
to_local
(),
data
=
X
,
dtype
=
self
.
classes_
.
dtype
,
client
=
_get_dask_client
(
self
.
client
),
raw_score
=
raw_score
,
start_iteration
=
start_iteration
,
num_iteration
=
num_iteration
,
pred_leaf
=
pred_leaf
,
pred_contrib
=
pred_contrib
,
validate_features
=
validate_features
,
**
kwargs
)
...
...
@@ -1394,12 +1410,28 @@ class DaskLGBMRegressor(LGBMRegressor, _DaskLGBMModel):
{
_lgbmmodel_doc_custom_eval_note
}
"""
def
predict
(
self
,
X
:
_DaskMatrixLike
,
**
kwargs
)
->
dask_Array
:
def
predict
(
self
,
X
:
_DaskMatrixLike
,
raw_score
:
bool
=
False
,
start_iteration
:
int
=
0
,
num_iteration
:
Optional
[
int
]
=
None
,
pred_leaf
:
bool
=
False
,
pred_contrib
:
bool
=
False
,
validate_features
:
bool
=
False
,
**
kwargs
:
Any
)
->
dask_Array
:
"""Docstring is inherited from the lightgbm.LGBMRegressor.predict."""
return
_predict
(
model
=
self
.
to_local
(),
data
=
X
,
client
=
_get_dask_client
(
self
.
client
),
raw_score
=
raw_score
,
start_iteration
=
start_iteration
,
num_iteration
=
num_iteration
,
pred_leaf
=
pred_leaf
,
pred_contrib
=
pred_contrib
,
validate_features
=
validate_features
,
**
kwargs
)
...
...
@@ -1552,12 +1584,28 @@ class DaskLGBMRanker(LGBMRanker, _DaskLGBMModel):
{
_lgbmmodel_doc_custom_eval_note
}
"""
def
predict
(
self
,
X
:
_DaskMatrixLike
,
**
kwargs
:
Any
)
->
dask_Array
:
def
predict
(
self
,
X
:
_DaskMatrixLike
,
raw_score
:
bool
=
False
,
start_iteration
:
int
=
0
,
num_iteration
:
Optional
[
int
]
=
None
,
pred_leaf
:
bool
=
False
,
pred_contrib
:
bool
=
False
,
validate_features
:
bool
=
False
,
**
kwargs
:
Any
)
->
dask_Array
:
"""Docstring is inherited from the lightgbm.LGBMRanker.predict."""
return
_predict
(
model
=
self
.
to_local
(),
data
=
X
,
client
=
_get_dask_client
(
self
.
client
),
raw_score
=
raw_score
,
start_iteration
=
start_iteration
,
num_iteration
=
num_iteration
,
pred_leaf
=
pred_leaf
,
pred_contrib
=
pred_contrib
,
validate_features
=
validate_features
,
**
kwargs
)
...
...
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