Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warnings #3399

Merged
merged 7 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/LightGBM/feature_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class FeatureGroup {
* \param num_data Total number of data
* \param is_enable_sparse True if enable sparse feature
*/
FeatureGroup(int num_feature, bool is_multi_val,
FeatureGroup(int num_feature, int8_t is_multi_val,
std::vector<std::unique_ptr<BinMapper>>* bin_mappers,
data_size_t num_data) : num_feature_(num_feature), is_multi_val_(is_multi_val), is_sparse_(false) {
data_size_t num_data) : num_feature_(num_feature), is_multi_val_(is_multi_val > 0), is_sparse_(false) {
CHECK_EQ(static_cast<int>(bin_mappers->size()), num_feature);
// use bin at zero to store most_freq_bin
num_total_bin_ = 1;
Expand Down
5 changes: 4 additions & 1 deletion src/treelearner/serial_tree_learner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,11 @@ void SerialTreeLearner::RenewTreeOutput(Tree* tree, const ObjectiveFunction* obj

void SerialTreeLearner::ComputeBestSplitForFeature(
FeatureHistogram* histogram_array_, int feature_index, int real_fidx,
bool is_feature_used, int num_data, const LeafSplits* leaf_splits,
int8_t is_feature_used, int num_data, const LeafSplits* leaf_splits,
SplitInfo* best_split, double parent_output) {
if (!is_feature_used) {
return;
}
guolinke marked this conversation as resolved.
Show resolved Hide resolved
bool is_feature_numerical = train_data_->FeatureBinMapper(feature_index)
->bin_type() == BinType::NumericalBin;
if (is_feature_numerical & !config_->monotone_constraints.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/treelearner/serial_tree_learner.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class SerialTreeLearner: public TreeLearner {
protected:
void ComputeBestSplitForFeature(FeatureHistogram* histogram_array_,
int feature_index, int real_fidx,
bool is_feature_used, int num_data,
int8_t is_feature_used, int num_data,
const LeafSplits* leaf_splits,
SplitInfo* best_split, double parent_output);

Expand Down