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
223b164e
Commit
223b164e
authored
Apr 11, 2017
by
Huan Zhang
Committed by
Guolin Ke
Apr 12, 2017
Browse files
fix the size of vector cnt_per_class (#402)
parent
bbcd5f4d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/boosting/gbdt.cpp
src/boosting/gbdt.cpp
+1
-1
No files found.
src/boosting/gbdt.cpp
View file @
223b164e
...
...
@@ -167,7 +167,7 @@ void GBDT::ResetTrainingData(const BoostingConfig* config, const Dataset* train_
CHECK
(
num_tree_per_iteration_
==
num_class_
);
// + 1 here for the binary classification
class_default_output_
=
std
::
vector
<
double
>
(
num_tree_per_iteration_
+
1
,
0.0
f
);
std
::
vector
<
data_size_t
>
cnt_per_class
(
num_tree_per_iteration_
,
0
);
std
::
vector
<
data_size_t
>
cnt_per_class
(
num_tree_per_iteration_
+
1
,
0
);
auto
label
=
train_data_
->
metadata
().
label
();
for
(
int
i
=
0
;
i
<
num_data_
;
++
i
)
{
++
cnt_per_class
[
static_cast
<
int
>
(
label
[
i
])];
...
...
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