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
b3e99b27
Commit
b3e99b27
authored
Nov 01, 2016
by
Guolin Ke
Browse files
fix unbalance for binary classification
parent
47313fb5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1140 additions
and
2 deletions
+1140
-2
examples/binary_classification/LightGBM_model.txt
examples/binary_classification/LightGBM_model.txt
+1138
-0
src/objective/binary_objective.hpp
src/objective/binary_objective.hpp
+2
-2
No files found.
examples/binary_classification/LightGBM_model.txt
0 → 100644
View file @
b3e99b27
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/objective/binary_objective.hpp
View file @
b3e99b27
...
@@ -47,8 +47,8 @@ public:
...
@@ -47,8 +47,8 @@ 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
/
cnt_positive
;
label_weights_
[
1
]
=
1.0
f
;
label_weights_
[
0
]
=
1.0
f
/
cnt_negative
;
label_weights_
[
0
]
=
static_cast
<
float
>
(
cnt_positive
)
/
cnt_negative
;
}
}
}
}
...
...
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