Clean up C++ warnings (#6213)
This commit is contained in:
@@ -113,7 +113,7 @@ class GBLinear : public GradientBooster {
|
||||
|
||||
void DoBoost(DMatrix *p_fmat,
|
||||
HostDeviceVector<GradientPair> *in_gpair,
|
||||
PredictionCacheEntry* predt) override {
|
||||
PredictionCacheEntry*) override {
|
||||
monitor_.Start("DoBoost");
|
||||
|
||||
model_.LazyInitModel();
|
||||
@@ -128,8 +128,7 @@ class GBLinear : public GradientBooster {
|
||||
|
||||
void PredictBatch(DMatrix *p_fmat,
|
||||
PredictionCacheEntry *predts,
|
||||
bool training,
|
||||
unsigned ntree_limit) override {
|
||||
bool, unsigned ntree_limit) override {
|
||||
monitor_.Start("PredictBatch");
|
||||
auto* out_preds = &predts->predictions;
|
||||
CHECK_EQ(ntree_limit, 0U)
|
||||
@@ -140,7 +139,7 @@ class GBLinear : public GradientBooster {
|
||||
// add base margin
|
||||
void PredictInstance(const SparsePage::Inst &inst,
|
||||
std::vector<bst_float> *out_preds,
|
||||
unsigned ntree_limit) override {
|
||||
unsigned) override {
|
||||
const int ngroup = model_.learner_model_param->num_output_group;
|
||||
for (int gid = 0; gid < ngroup; ++gid) {
|
||||
this->Pred(inst, dmlc::BeginPtr(*out_preds), gid,
|
||||
@@ -148,16 +147,15 @@ class GBLinear : public GradientBooster {
|
||||
}
|
||||
}
|
||||
|
||||
void PredictLeaf(DMatrix *p_fmat,
|
||||
std::vector<bst_float> *out_preds,
|
||||
unsigned ntree_limit) override {
|
||||
void PredictLeaf(DMatrix*,
|
||||
std::vector<bst_float>*,
|
||||
unsigned) override {
|
||||
LOG(FATAL) << "gblinear does not support prediction of leaf index";
|
||||
}
|
||||
|
||||
void PredictContribution(DMatrix* p_fmat,
|
||||
HostDeviceVector<bst_float>* out_contribs,
|
||||
unsigned ntree_limit, bool approximate, int condition = 0,
|
||||
unsigned condition_feature = 0) override {
|
||||
unsigned ntree_limit, bool, int, unsigned) override {
|
||||
model_.LazyInitModel();
|
||||
CHECK_EQ(ntree_limit, 0U)
|
||||
<< "GBLinear::PredictContribution: ntrees is only valid for gbtree predictor";
|
||||
@@ -196,7 +194,7 @@ class GBLinear : public GradientBooster {
|
||||
|
||||
void PredictInteractionContributions(DMatrix* p_fmat,
|
||||
HostDeviceVector<bst_float>* out_contribs,
|
||||
unsigned ntree_limit, bool approximate) override {
|
||||
unsigned, bool) override {
|
||||
std::vector<bst_float>& contribs = out_contribs->HostVector();
|
||||
|
||||
// linear models have no interaction effects
|
||||
|
||||
@@ -95,7 +95,7 @@ class GBLinearModel : public Model {
|
||||
return &weight[i * learner_model_param->num_output_group];
|
||||
}
|
||||
|
||||
std::vector<std::string> DumpModel(const FeatureMap &fmap, bool with_stats,
|
||||
std::vector<std::string> DumpModel(const FeatureMap &, bool,
|
||||
std::string format) const {
|
||||
const int ngroup = learner_model_param->num_output_group;
|
||||
const unsigned nfeature = learner_model_param->num_feature;
|
||||
|
||||
@@ -401,7 +401,7 @@ void GBTree::SaveModel(Json* p_out) const {
|
||||
|
||||
void GBTree::PredictBatch(DMatrix* p_fmat,
|
||||
PredictionCacheEntry* out_preds,
|
||||
bool training,
|
||||
bool,
|
||||
unsigned ntree_limit) {
|
||||
CHECK(configured_);
|
||||
GetPredictor(&out_preds->predictions, p_fmat)
|
||||
@@ -601,8 +601,8 @@ class Dart : public GBTree {
|
||||
|
||||
void PredictContribution(DMatrix* p_fmat,
|
||||
HostDeviceVector<bst_float>* out_contribs,
|
||||
unsigned ntree_limit, bool approximate, int condition,
|
||||
unsigned condition_feature) override {
|
||||
unsigned ntree_limit, bool approximate, int,
|
||||
unsigned) override {
|
||||
CHECK(configured_);
|
||||
cpu_predictor_->PredictContribution(p_fmat, out_contribs, model_,
|
||||
ntree_limit, &weight_drop_, approximate);
|
||||
@@ -674,8 +674,7 @@ class Dart : public GBTree {
|
||||
// commit new trees all at once
|
||||
void
|
||||
CommitModel(std::vector<std::vector<std::unique_ptr<RegTree>>>&& new_trees,
|
||||
DMatrix* m,
|
||||
PredictionCacheEntry* predts) override {
|
||||
DMatrix*, PredictionCacheEntry*) override {
|
||||
int num_new_trees = 0;
|
||||
for (uint32_t gid = 0; gid < model_.learner_model_param->num_output_group; ++gid) {
|
||||
num_new_trees += new_trees[gid].size();
|
||||
|
||||
@@ -239,7 +239,7 @@ class GBTree : public GradientBooster {
|
||||
void PredictContribution(DMatrix* p_fmat,
|
||||
HostDeviceVector<bst_float>* out_contribs,
|
||||
unsigned ntree_limit, bool approximate,
|
||||
int condition, unsigned condition_feature) override {
|
||||
int, unsigned) override {
|
||||
CHECK(configured_);
|
||||
this->GetPredictor()->PredictContribution(
|
||||
p_fmat, out_contribs, model_, ntree_limit, nullptr, approximate);
|
||||
|
||||
Reference in New Issue
Block a user