Unverified Commit 3c0e12dc authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix warnings (#3399)

* 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
parent 432c8214
...@@ -29,9 +29,9 @@ class FeatureGroup { ...@@ -29,9 +29,9 @@ class FeatureGroup {
* \param num_data Total number of data * \param num_data Total number of data
* \param is_enable_sparse True if enable sparse feature * \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, 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); CHECK_EQ(static_cast<int>(bin_mappers->size()), num_feature);
// use bin at zero to store most_freq_bin // use bin at zero to store most_freq_bin
num_total_bin_ = 1; num_total_bin_ = 1;
......
...@@ -336,7 +336,7 @@ class AucMuMetric : public Metric { ...@@ -336,7 +336,7 @@ class AucMuMetric : public Metric {
} }
} }
ans = (2.0 * ans / num_class_) / (num_class_ - 1); ans = (2.0 * ans / num_class_) / (num_class_ - 1);
return std::vector<double>(1.0, ans); return std::vector<double>(1, ans);
} }
private: private:
......
...@@ -716,7 +716,7 @@ void SerialTreeLearner::RenewTreeOutput(Tree* tree, const ObjectiveFunction* obj ...@@ -716,7 +716,7 @@ void SerialTreeLearner::RenewTreeOutput(Tree* tree, const ObjectiveFunction* obj
void SerialTreeLearner::ComputeBestSplitForFeature( void SerialTreeLearner::ComputeBestSplitForFeature(
FeatureHistogram* histogram_array_, int feature_index, int real_fidx, 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) { SplitInfo* best_split, double parent_output) {
bool is_feature_numerical = train_data_->FeatureBinMapper(feature_index) bool is_feature_numerical = train_data_->FeatureBinMapper(feature_index)
->bin_type() == BinType::NumericalBin; ->bin_type() == BinType::NumericalBin;
......
...@@ -120,7 +120,7 @@ class SerialTreeLearner: public TreeLearner { ...@@ -120,7 +120,7 @@ class SerialTreeLearner: public TreeLearner {
protected: protected:
void ComputeBestSplitForFeature(FeatureHistogram* histogram_array_, void ComputeBestSplitForFeature(FeatureHistogram* histogram_array_,
int feature_index, int real_fidx, 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, const LeafSplits* leaf_splits,
SplitInfo* best_split, double parent_output); SplitInfo* best_split, double parent_output);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment