Skip to content

Commit

Permalink
fix warnings (microsoft#3399)
Browse files Browse the repository at this point in the history
* fix warnings

* Apply suggestions from code review

* Update feature_group.h

* Update feature_group.h

* Update src/treelearner/serial_tree_learner.cpp

* Update multiclass_metric.hpp
  • Loading branch information
guolinke authored Sep 29, 2020
1 parent 432c821 commit 3c0e12d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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
2 changes: 1 addition & 1 deletion src/metric/multiclass_metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class AucMuMetric : public Metric {
}
}
ans = (2.0 * ans / num_class_) / (num_class_ - 1);
return std::vector<double>(1.0, ans);
return std::vector<double>(1, ans);
}

private:
Expand Down
2 changes: 1 addition & 1 deletion src/treelearner/serial_tree_learner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ 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) {
bool is_feature_numerical = train_data_->FeatureBinMapper(feature_index)
->bin_type() == BinType::NumericalBin;
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

0 comments on commit 3c0e12d

Please sign in to comment.