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
595c10ab
Commit
595c10ab
authored
Nov 27, 2016
by
Guolin Ke
Browse files
some naming fix
parent
27624755
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+4
-3
python-package/lightgbm/engine.py
python-package/lightgbm/engine.py
+4
-4
No files found.
python-package/lightgbm/basic.py
View file @
595c10ab
...
@@ -898,9 +898,10 @@ class Booster(object):
...
@@ -898,9 +898,10 @@ class Booster(object):
if
'metric'
in
params
:
if
'metric'
in
params
:
self
.
__need_reload_eval_info
=
True
self
.
__need_reload_eval_info
=
True
params_str
=
param_dict_to_str
(
params
)
params_str
=
param_dict_to_str
(
params
)
_safe_call
(
_LIB
.
LGBM_BoosterResetParameter
(
if
params_str
:
self
.
handle
,
_safe_call
(
_LIB
.
LGBM_BoosterResetParameter
(
c_str
(
params_str
)))
self
.
handle
,
c_str
(
params_str
)))
def
update
(
self
,
train_set
=
None
,
fobj
=
None
):
def
update
(
self
,
train_set
=
None
,
fobj
=
None
):
"""
"""
...
...
python-package/lightgbm/engine.py
View file @
595c10ab
...
@@ -166,7 +166,7 @@ def train(params, train_data, num_boost_round=100,
...
@@ -166,7 +166,7 @@ def train(params, train_data, num_boost_round=100,
"""start training"""
"""start training"""
for
i
in
range
(
num_boost_round
):
for
i
in
range
(
num_boost_round
):
for
cb
in
callbacks_before_iter
:
for
cb
in
callbacks_before_iter
:
cb
(
CallbackEnv
(
model
=
booster
,
cb
(
callback
.
CallbackEnv
(
model
=
booster
,
cvfolds
=
None
,
cvfolds
=
None
,
iteration
=
i
,
iteration
=
i
,
begin_iteration
=
0
,
begin_iteration
=
0
,
...
@@ -183,16 +183,16 @@ def train(params, train_data, num_boost_round=100,
...
@@ -183,16 +183,16 @@ def train(params, train_data, num_boost_round=100,
evaluation_result_list
.
extend
(
booster
.
eval_valid
(
feval
))
evaluation_result_list
.
extend
(
booster
.
eval_valid
(
feval
))
try
:
try
:
for
cb
in
callbacks_after_iter
:
for
cb
in
callbacks_after_iter
:
cb
(
CallbackEnv
(
model
=
booster
,
cb
(
callback
.
CallbackEnv
(
model
=
booster
,
cvfolds
=
None
,
cvfolds
=
None
,
iteration
=
i
,
iteration
=
i
,
begin_iteration
=
0
,
begin_iteration
=
0
,
end_iteration
=
num_boost_round
,
end_iteration
=
num_boost_round
,
evaluation_result_list
=
evaluation_result_list
))
evaluation_result_list
=
evaluation_result_list
))
except
EarlyStopException
:
except
callback
.
EarlyStopException
:
break
break
if
booster
.
attr
(
'best_iteration'
)
is
not
None
:
if
booster
.
attr
(
'best_iteration'
)
is
not
None
:
booster
.
best_iteration
=
int
(
booster
.
attr
(
'best_iteration'
))
booster
.
best_iteration
=
int
(
booster
.
attr
(
'best_iteration'
))
else
:
else
:
booster
.
best_iteration
=
num_boost_round
-
1
booster
.
best_iteration
=
num_boost_round
-
1
return
num_boost_round
return
num_boost_round
\ No newline at end of file
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