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
2f984f3a
Commit
2f984f3a
authored
Oct 29, 2016
by
Allard van Mossel
Committed by
Guolin Ke
Oct 29, 2016
Browse files
Fixed bug when num_iterations > early_stopping_round (#50)
parent
b24190a6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/boosting/gbdt.cpp
src/boosting/gbdt.cpp
+5
-5
No files found.
src/boosting/gbdt.cpp
View file @
2f984f3a
...
...
@@ -217,9 +217,9 @@ void GBDT::Train() {
}
}
// close file
i
f
(
early_stopping_round_
>
0
)
{
// save
remaining
models
for
(
int
iter
=
gbdt_config_
->
num_iterations
-
early_stopping_round_
;
iter
<
static_cast
<
int
>
(
models_
.
size
());
++
iter
){
i
nt
remaining_models
=
gbdt_config_
->
num_iterations
-
early_stopping_round_
;
if
(
early_stopping_round_
>
0
&&
remaining
_
models
>
0
)
{
for
(
int
iter
=
remaining_models
;
iter
<
static_cast
<
int
>
(
models_
.
size
());
++
iter
){
fprintf
(
output_model_file
,
"Tree=%d
\n
"
,
iter
);
fprintf
(
output_model_file
,
"%s
\n
"
,
models_
.
at
(
iter
)
->
ToString
().
c_str
());
}
...
...
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