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
6c210209
Unverified
Commit
6c210209
authored
Jul 31, 2019
by
Guolin Ke
Committed by
GitHub
Jul 31, 2019
Browse files
change the priority of init_score and init_model. (#2291)
parent
04a56010
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+5
-6
No files found.
python-package/lightgbm/basic.py
View file @
6c210209
...
...
@@ -848,13 +848,12 @@ class Dataset(object):
self
.
set_weight
(
weight
)
if
group
is
not
None
:
self
.
set_group
(
group
)
# load init score
if
init_score
is
not
None
:
self
.
set_init_score
(
init_score
)
if
predictor
is
not
None
:
warnings
.
warn
(
"The prediction of init_model will be overridden by init_score."
)
elif
isinstance
(
predictor
,
_InnerPredictor
):
if
isinstance
(
predictor
,
_InnerPredictor
):
if
self
.
_predictor
is
None
and
init_score
is
not
None
:
warnings
.
warn
(
"The init_score will be overridden by the prediction of init_model."
)
self
.
_set_init_score_by_predictor
(
predictor
,
data
)
elif
init_score
is
not
None
:
self
.
set_init_score
(
init_score
)
elif
predictor
is
not
None
:
raise
TypeError
(
'Wrong predictor type {}'
.
format
(
type
(
predictor
).
__name__
))
# set feature names
...
...
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