Add global configuration (#6414)
* Add management functions for global configuration: XGBSetGlobalConfig(), XGBGetGlobalConfig(). * Add Python interface: set_config(), get_config(), and config_context(). * Add unit tests for Python * Add R interface: xgb.set.config(), xgb.get.config() * Add unit tests for R Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
This commit is contained in:
committed by
GitHub
parent
c2ba4fb957
commit
fb56da5e8b
@@ -490,6 +490,12 @@ class LearnerConfiguration : public Learner {
|
||||
|
||||
// Extract all parameters
|
||||
std::vector<std::string> keys;
|
||||
// First global parameters
|
||||
Json const global_config{ToJson(*GlobalConfigThreadLocalStore::Get())};
|
||||
for (auto const& items : get<Object const>(global_config)) {
|
||||
keys.emplace_back(items.first);
|
||||
}
|
||||
// Parameters in various xgboost components.
|
||||
while (!stack.empty()) {
|
||||
auto j_obj = stack.top();
|
||||
stack.pop();
|
||||
|
||||
Reference in New Issue
Block a user