Reduce compile warnings (#6198)
Co-authored-by: Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
@@ -220,10 +220,10 @@ class FeatureSelector {
|
||||
* \param lambda Regularisation lambda.
|
||||
* \param param A parameter with algorithm-dependent use.
|
||||
*/
|
||||
virtual void Setup(const gbm::GBLinearModel &model,
|
||||
const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat,
|
||||
float alpha, float lambda, int param) {}
|
||||
virtual void Setup(const gbm::GBLinearModel &,
|
||||
const std::vector<GradientPair> &,
|
||||
DMatrix *,
|
||||
float , float , int ) {}
|
||||
/**
|
||||
* \brief Select next coordinate to update.
|
||||
*
|
||||
@@ -250,8 +250,8 @@ class FeatureSelector {
|
||||
class CyclicFeatureSelector : public FeatureSelector {
|
||||
public:
|
||||
int NextFeature(int iteration, const gbm::GBLinearModel &model,
|
||||
int group_idx, const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat, float alpha, float lambda) override {
|
||||
int , const std::vector<GradientPair> &,
|
||||
DMatrix *, float, float) override {
|
||||
return iteration % model.learner_model_param->num_feature;
|
||||
}
|
||||
};
|
||||
@@ -263,8 +263,8 @@ class CyclicFeatureSelector : public FeatureSelector {
|
||||
class ShuffleFeatureSelector : public FeatureSelector {
|
||||
public:
|
||||
void Setup(const gbm::GBLinearModel &model,
|
||||
const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat, float alpha, float lambda, int param) override {
|
||||
const std::vector<GradientPair> &g,
|
||||
DMatrix *, float, float, int) override {
|
||||
if (feat_index_.size() == 0) {
|
||||
feat_index_.resize(model.learner_model_param->num_feature);
|
||||
std::iota(feat_index_.begin(), feat_index_.end(), 0);
|
||||
@@ -273,8 +273,8 @@ class ShuffleFeatureSelector : public FeatureSelector {
|
||||
}
|
||||
|
||||
int NextFeature(int iteration, const gbm::GBLinearModel &model,
|
||||
int group_idx, const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat, float alpha, float lambda) override {
|
||||
int, const std::vector<GradientPair> &,
|
||||
DMatrix *, float, float) override {
|
||||
return feat_index_[iteration % model.learner_model_param->num_feature];
|
||||
}
|
||||
|
||||
@@ -288,9 +288,9 @@ class ShuffleFeatureSelector : public FeatureSelector {
|
||||
*/
|
||||
class RandomFeatureSelector : public FeatureSelector {
|
||||
public:
|
||||
int NextFeature(int iteration, const gbm::GBLinearModel &model,
|
||||
int group_idx, const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat, float alpha, float lambda) override {
|
||||
int NextFeature(int, const gbm::GBLinearModel &model,
|
||||
int, const std::vector<GradientPair> &,
|
||||
DMatrix *, float, float) override {
|
||||
return common::GlobalRandom()() % model.learner_model_param->num_feature;
|
||||
}
|
||||
};
|
||||
@@ -307,8 +307,8 @@ class RandomFeatureSelector : public FeatureSelector {
|
||||
class GreedyFeatureSelector : public FeatureSelector {
|
||||
public:
|
||||
void Setup(const gbm::GBLinearModel &model,
|
||||
const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat, float alpha, float lambda, int param) override {
|
||||
const std::vector<GradientPair> &,
|
||||
DMatrix *, float, float, int param) override {
|
||||
top_k_ = static_cast<bst_uint>(param);
|
||||
const bst_uint ngroup = model.learner_model_param->num_output_group;
|
||||
if (param <= 0) top_k_ = std::numeric_limits<bst_uint>::max();
|
||||
@@ -321,7 +321,7 @@ class GreedyFeatureSelector : public FeatureSelector {
|
||||
}
|
||||
}
|
||||
|
||||
int NextFeature(int iteration, const gbm::GBLinearModel &model,
|
||||
int NextFeature(int, const gbm::GBLinearModel &model,
|
||||
int group_idx, const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat, float alpha, float lambda) override {
|
||||
// k-th selected feature for a group
|
||||
@@ -438,9 +438,9 @@ class ThriftyFeatureSelector : public FeatureSelector {
|
||||
}
|
||||
}
|
||||
|
||||
int NextFeature(int iteration, const gbm::GBLinearModel &model,
|
||||
int group_idx, const std::vector<GradientPair> &gpair,
|
||||
DMatrix *p_fmat, float alpha, float lambda) override {
|
||||
int NextFeature(int, const gbm::GBLinearModel &model,
|
||||
int group_idx, const std::vector<GradientPair> &,
|
||||
DMatrix *, float, float) override {
|
||||
// k-th selected feature for a group
|
||||
auto k = counter_[group_idx]++;
|
||||
// stop after either reaching top-N or going through all the features in a group
|
||||
|
||||
Reference in New Issue
Block a user