Add XGBoosterGetNumFeature (#5856)

- add GetNumFeature to Learner
- add XGBoosterGetNumFeature to C API
- update c-api-demo accordingly
This commit is contained in:
Alexander Gugel
2020-07-14 07:25:17 +01:00
committed by GitHub
parent e0c179c7cc
commit 970b4b3fa2
6 changed files with 36 additions and 1 deletions

View File

@@ -384,6 +384,10 @@ class LearnerConfiguration : public Learner {
}
}
uint32_t GetNumFeature() override {
return learner_model_param_.num_feature;
}
void SetAttr(const std::string& key, const std::string& value) override {
attributes_[key] = value;
mparam_.contain_extra_attrs = 1;