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
f3b1daf8
Commit
f3b1daf8
authored
Nov 05, 2016
by
Guolin Ke
Browse files
Merge branch 'master' into dev
parents
dd5f2b27
0241d323
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/objective/binary_objective.hpp
src/objective/binary_objective.hpp
+7
-2
No files found.
src/objective/binary_objective.hpp
View file @
f3b1daf8
...
@@ -47,8 +47,13 @@ public:
...
@@ -47,8 +47,13 @@ public:
label_weights_
[
1
]
=
1.0
f
;
label_weights_
[
1
]
=
1.0
f
;
// if using unbalance, change the labels weight
// if using unbalance, change the labels weight
if
(
is_unbalance_
)
{
if
(
is_unbalance_
)
{
label_weights_
[
1
]
=
1.0
f
;
if
(
cnt_positive
>
cnt_negative
)
{
label_weights_
[
0
]
=
static_cast
<
score_t
>
(
cnt_positive
)
/
cnt_negative
;
label_weights_
[
1
]
=
1.0
f
;
label_weights_
[
0
]
=
static_cast
<
score_t
>
(
cnt_positive
)
/
cnt_negative
;
}
else
{
label_weights_
[
1
]
=
static_cast
<
score_t
>
(
cnt_negative
)
/
cnt_positive
;
label_weights_
[
0
]
=
1.0
f
;
}
}
}
}
}
...
...
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