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
c45ec4f1
"...git@developer.sourcefind.cn:tianlh/lightgbm-dcu.git" did not exist on "d90a16d520fa12d84ecd983fba323727348616a4"
Unverified
Commit
c45ec4f1
authored
Apr 29, 2019
by
Guolin Ke
Committed by
GitHub
Apr 29, 2019
Browse files
dump_model() bug with num_leaves=1
parent
24ad35f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/io/tree.cpp
src/io/tree.cpp
+6
-6
No files found.
src/io/tree.cpp
View file @
c45ec4f1
...
...
@@ -506,6 +506,12 @@ Tree::Tree(const char* str, size_t* used_len) {
}
else
{
Log
::
Fatal
(
"Tree model string format error, should contain leaf_value field"
);
}
if
(
key_vals
.
count
(
"shrinkage"
))
{
Common
::
Atof
(
key_vals
[
"shrinkage"
].
c_str
(),
&
shrinkage_
);
}
else
{
shrinkage_
=
1.0
f
;
}
if
(
num_leaves_
<=
1
)
{
return
;
}
...
...
@@ -576,12 +582,6 @@ Tree::Tree(const char* str, size_t* used_len) {
Log
::
Fatal
(
"Tree model should contain cat_threshold field"
);
}
}
if
(
key_vals
.
count
(
"shrinkage"
))
{
Common
::
Atof
(
key_vals
[
"shrinkage"
].
c_str
(),
&
shrinkage_
);
}
else
{
shrinkage_
=
1.0
f
;
}
max_depth_
=
-
1
;
}
...
...
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