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
c62dcf73
Commit
c62dcf73
authored
Aug 18, 2017
by
Guolin Ke
Browse files
fix merge bugs.
parent
7a82ba4f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
875 additions
and
831 deletions
+875
-831
include/LightGBM/bin.h
include/LightGBM/bin.h
+435
-431
include/LightGBM/tree.h
include/LightGBM/tree.h
+2
-1
src/io/bin.cpp
src/io/bin.cpp
+437
-398
src/io/config.cpp
src/io/config.cpp
+1
-1
No files found.
include/LightGBM/bin.h
View file @
c62dcf73
This diff is collapsed.
Click to expand it.
include/LightGBM/tree.h
View file @
c62dcf73
...
@@ -409,7 +409,8 @@ inline void Tree::TreeSHAP(const double *feature_values, double *phi,
...
@@ -409,7 +409,8 @@ inline void Tree::TreeSHAP(const double *feature_values, double *phi,
// internal node
// internal node
}
else
{
}
else
{
const
int
hot_index
=
Decision
(
feature_values
[
split_index
],
node
);
const
int
hot_index
=
decision_funs
[
GetDecisionType
(
decision_type_
[
node
],
kCategoricalMask
)](
feature_values
[
split_index
],
threshold_
[
node
]);
const
int
cold_index
=
(
hot_index
==
left_child_
[
node
]
?
right_child_
[
node
]
:
left_child_
[
node
]);
const
int
cold_index
=
(
hot_index
==
left_child_
[
node
]
?
right_child_
[
node
]
:
left_child_
[
node
]);
const
double
w
=
data_count
(
node
);
const
double
w
=
data_count
(
node
);
const
double
hot_zero_fraction
=
data_count
(
hot_index
)
/
w
;
const
double
hot_zero_fraction
=
data_count
(
hot_index
)
/
w
;
...
...
src/io/bin.cpp
View file @
c62dcf73
This diff is collapsed.
Click to expand it.
src/io/config.cpp
View file @
c62dcf73
...
@@ -239,7 +239,7 @@ void OverallConfig::CheckParamConflict() {
...
@@ -239,7 +239,7 @@ void OverallConfig::CheckParamConflict() {
}
}
// Check max_depth and num_leaves
// Check max_depth and num_leaves
if
(
boosting_config
.
tree_config
.
max_depth
>
0
)
{
if
(
boosting_config
.
tree_config
.
max_depth
>
0
)
{
int
full_num_leaves
=
std
::
pow
(
2
,
boosting_config
.
tree_config
.
max_depth
);
int
full_num_leaves
=
static_cast
<
int
>
(
std
::
pow
(
2
,
boosting_config
.
tree_config
.
max_depth
)
)
;
if
(
full_num_leaves
>
boosting_config
.
tree_config
.
num_leaves
if
(
full_num_leaves
>
boosting_config
.
tree_config
.
num_leaves
&&
boosting_config
.
tree_config
.
num_leaves
==
kDefaultNumLeaves
)
{
&&
boosting_config
.
tree_config
.
num_leaves
==
kDefaultNumLeaves
)
{
Log
::
Warning
(
"Accuarcy may be bad since you didn't set num_leaves."
);
Log
::
Warning
(
"Accuarcy may be bad since you didn't set num_leaves."
);
...
...
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