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
ddf8c104
Unverified
Commit
ddf8c104
authored
Jul 02, 2020
by
Guolin Ke
Committed by
GitHub
Jul 02, 2020
Browse files
Allow the minimal feature to 1 in column sampling (#3197)
Co-authored-by:
StrikerRUS
<
nekit94-12@hotmail.com
>
parent
314b9d24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/treelearner/col_sampler.hpp
src/treelearner/col_sampler.hpp
+1
-1
No files found.
src/treelearner/col_sampler.hpp
View file @
ddf8c104
...
...
@@ -31,7 +31,7 @@ class ColSampler {
}
static
int
GetCnt
(
size_t
total_cnt
,
double
fraction
)
{
const
int
min
=
std
::
min
(
2
,
static_cast
<
int
>
(
total_cnt
));
const
int
min
=
std
::
min
(
1
,
static_cast
<
int
>
(
total_cnt
));
int
used_feature_cnt
=
static_cast
<
int
>
(
Common
::
RoundInt
(
total_cnt
*
fraction
));
return
std
::
max
(
used_feature_cnt
,
min
);
}
...
...
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