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
e2fe9283
Commit
e2fe9283
authored
Nov 01, 2016
by
Guolin Ke
Committed by
GitHub
Nov 01, 2016
Browse files
fixed a bug in bin.cpp
parent
cba6b245
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
src/io/bin.cpp
src/io/bin.cpp
+1
-4
No files found.
src/io/bin.cpp
View file @
e2fe9283
...
@@ -114,15 +114,12 @@ void BinMapper::FindBin(std::vector<float>* values, int max_bin) {
...
@@ -114,15 +114,12 @@ void BinMapper::FindBin(std::vector<float>* values, int max_bin) {
Common
::
SortForPair
<
float
,
float
>
(
lower_bounds
,
upper_bounds
,
0
,
false
);
Common
::
SortForPair
<
float
,
float
>
(
lower_bounds
,
upper_bounds
,
0
,
false
);
// update bin upper bound
// update bin upper bound
bin_upper_bound_
=
new
float
[
bin_cnt
];
bin_upper_bound_
=
new
float
[
bin_cnt
];
num_bin_
=
bin_cnt
;
for
(
int
i
=
0
;
i
<
bin_cnt
-
1
;
++
i
)
{
for
(
int
i
=
0
;
i
<
bin_cnt
-
1
;
++
i
)
{
bin_upper_bound_
[
i
]
=
(
upper_bounds
[
i
]
+
lower_bounds
[
i
+
1
])
/
2.0
f
;
bin_upper_bound_
[
i
]
=
(
upper_bounds
[
i
]
+
lower_bounds
[
i
+
1
])
/
2.0
f
;
}
}
// last bin upper bound
// last bin upper bound
bin_upper_bound_
[
bin_cnt
-
1
]
=
std
::
numeric_limits
<
float
>::
infinity
();
bin_upper_bound_
[
bin_cnt
-
1
]
=
std
::
numeric_limits
<
float
>::
infinity
();
CHECK
(
bin_cnt
<=
max_bin
);
}
}
// check trival(num_bin_ == 1) feature
// check trival(num_bin_ == 1) feature
if
(
num_bin_
<=
1
)
{
if
(
num_bin_
<=
1
)
{
...
...
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