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
94460df7
Commit
94460df7
authored
Oct 24, 2016
by
xuehui
Committed by
Guolin Ke
Oct 24, 2016
Browse files
update for correct Init in DCGCalculator. (#32)
parent
9fe0dea3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/application/application.cpp
src/application/application.cpp
+1
-1
src/metric/dcg_calculator.cpp
src/metric/dcg_calculator.cpp
+1
-1
No files found.
src/application/application.cpp
View file @
94460df7
...
@@ -80,7 +80,7 @@ void Application::LoadParameters(int argc, char** argv) {
...
@@ -80,7 +80,7 @@ void Application::LoadParameters(int argc, char** argv) {
config_reader
.
ReadAllLines
();
config_reader
.
ReadAllLines
();
if
(
config_reader
.
Lines
().
size
()
>
0
)
{
if
(
config_reader
.
Lines
().
size
()
>
0
)
{
for
(
auto
&
line
:
config_reader
.
Lines
())
{
for
(
auto
&
line
:
config_reader
.
Lines
())
{
// remove str after
#
// remove str after
"#"
if
(
line
.
size
()
>
0
&&
std
::
string
::
npos
!=
line
.
find_first_of
(
"#"
))
{
if
(
line
.
size
()
>
0
&&
std
::
string
::
npos
!=
line
.
find_first_of
(
"#"
))
{
line
.
erase
(
line
.
find_first_of
(
"#"
));
line
.
erase
(
line
.
find_first_of
(
"#"
));
}
}
...
...
src/metric/dcg_calculator.cpp
View file @
94460df7
...
@@ -21,7 +21,7 @@ void DCGCalculator::Init(std::vector<double> input_label_gain) {
...
@@ -21,7 +21,7 @@ void DCGCalculator::Init(std::vector<double> input_label_gain) {
label_gain_
=
input_label_gain
;
label_gain_
=
input_label_gain
;
discount_
.
clear
();
discount_
.
clear
();
for
(
data_size_t
i
=
0
;
i
<
kMaxPosition
;
++
i
)
{
for
(
data_size_t
i
=
0
;
i
<
kMaxPosition
;
++
i
)
{
discount_
.
emplace_back
(
1.0
/
std
::
log
(
2.0
+
i
));
discount_
.
emplace_back
(
1.0
/
std
::
log
2
(
2.0
+
i
));
}
}
is_inited_
=
true
;
is_inited_
=
true
;
}
}
...
...
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