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
fa9e4527
Unverified
Commit
fa9e4527
authored
Jun 02, 2022
by
shiyu1994
Committed by
GitHub
Jun 02, 2022
Browse files
[c++][fix] check nullable of bin mappers in dataset_loader.cpp (fix #5221) (#5258)
check nullable of bin mappers
parent
4971a066
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/io/dataset_loader.cpp
src/io/dataset_loader.cpp
+1
-1
No files found.
src/io/dataset_loader.cpp
View file @
fa9e4527
...
@@ -1472,7 +1472,7 @@ void DatasetLoader::CheckCategoricalFeatureNumBin(
...
@@ -1472,7 +1472,7 @@ void DatasetLoader::CheckCategoricalFeatureNumBin(
if
(
bin_mappers
.
size
()
<
1024
)
{
if
(
bin_mappers
.
size
()
<
1024
)
{
for
(
size_t
i
=
0
;
i
<
bin_mappers
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
bin_mappers
.
size
();
++
i
)
{
const
int
max_bin_for_this_feature
=
max_bin_by_feature
.
empty
()
?
max_bin
:
max_bin_by_feature
[
i
];
const
int
max_bin_for_this_feature
=
max_bin_by_feature
.
empty
()
?
max_bin
:
max_bin_by_feature
[
i
];
if
(
bin_mappers
[
i
]
->
bin_type
()
==
BinType
::
CategoricalBin
&&
bin_mappers
[
i
]
->
num_bin
()
>
max_bin_for_this_feature
)
{
if
(
bin_mappers
[
i
]
!=
nullptr
&&
bin_mappers
[
i
]
->
bin_type
()
==
BinType
::
CategoricalBin
&&
bin_mappers
[
i
]
->
num_bin
()
>
max_bin_for_this_feature
)
{
need_warning
=
true
;
need_warning
=
true
;
break
;
break
;
}
}
...
...
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