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
6ae96c96
Unverified
Commit
6ae96c96
authored
Feb 27, 2023
by
James Lamb
Committed by
GitHub
Feb 27, 2023
Browse files
[python-package] add type hints on fit() return and callbacks in sklearn.py (#5748)
parent
426dfcca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
python-package/lightgbm/sklearn.py
python-package/lightgbm/sklearn.py
+8
-8
No files found.
python-package/lightgbm/sklearn.py
View file @
6ae96c96
...
...
@@ -710,9 +710,9 @@ class LGBMModel(_LGBMModelBase):
eval_metric
:
Optional
[
_LGBM_ScikitEvalMetricType
]
=
None
,
feature_name
=
'auto'
,
categorical_feature
=
'auto'
,
callbacks
=
None
,
callbacks
:
Optional
[
List
[
Callable
]]
=
None
,
init_model
:
Optional
[
Union
[
str
,
Path
,
Booster
,
"LGBMModel"
]]
=
None
):
)
->
"LGBMModel"
:
"""Docstring is set after definition, using a template."""
params
=
self
.
_process_params
(
stage
=
"fit"
)
...
...
@@ -1001,9 +1001,9 @@ class LGBMRegressor(_LGBMRegressorBase, LGBMModel):
eval_metric
:
Optional
[
_LGBM_ScikitEvalMetricType
]
=
None
,
feature_name
=
'auto'
,
categorical_feature
=
'auto'
,
callbacks
=
None
,
callbacks
:
Optional
[
List
[
Callable
]]
=
None
,
init_model
:
Optional
[
Union
[
str
,
Path
,
Booster
,
LGBMModel
]]
=
None
):
)
->
"LGBMRegressor"
:
"""Docstring is inherited from the LGBMModel."""
super
().
fit
(
X
,
...
...
@@ -1048,9 +1048,9 @@ class LGBMClassifier(_LGBMClassifierBase, LGBMModel):
eval_metric
:
Optional
[
_LGBM_ScikitEvalMetricType
]
=
None
,
feature_name
=
'auto'
,
categorical_feature
=
'auto'
,
callbacks
=
None
,
callbacks
:
Optional
[
List
[
Callable
]]
=
None
,
init_model
:
Optional
[
Union
[
str
,
Path
,
Booster
,
LGBMModel
]]
=
None
):
)
->
"LGBMClassifier"
:
"""Docstring is inherited from the LGBMModel."""
_LGBMAssertAllFinite
(
y
)
_LGBMCheckClassificationTargets
(
y
)
...
...
@@ -1218,9 +1218,9 @@ class LGBMRanker(LGBMModel):
eval_at
:
Union
[
List
[
int
],
Tuple
[
int
,
...]]
=
(
1
,
2
,
3
,
4
,
5
),
feature_name
=
'auto'
,
categorical_feature
=
'auto'
,
callbacks
=
None
,
callbacks
:
Optional
[
List
[
Callable
]]
=
None
,
init_model
:
Optional
[
Union
[
str
,
Path
,
Booster
,
LGBMModel
]]
=
None
):
)
->
"LGBMRanker"
:
"""Docstring is inherited from the LGBMModel."""
# check group data
if
group
is
None
:
...
...
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