As discussed in issue #1978, tree_method=hist ignores the parameter param.num_roots; it simply assumes that the tree has only one root. In particular, when InitData() method initializes row_set_collection_, it simply assigns all rows to node 0, the value that's hard-coded. For now, the updater will simply fail when num_roots exceeds 1. I will revise the updater soon to support multiple roots.
37 lines
968 B
C++
37 lines
968 B
C++
/*!
|
|
* Copyright 2015 by Contributors
|
|
* \file tree_updater.cc
|
|
* \brief Registry of tree updaters.
|
|
*/
|
|
#include <xgboost/tree_updater.h>
|
|
#include <dmlc/registry.h>
|
|
|
|
namespace dmlc {
|
|
DMLC_REGISTRY_ENABLE(::xgboost::TreeUpdaterReg);
|
|
} // namespace dmlc
|
|
|
|
namespace xgboost {
|
|
|
|
TreeUpdater* TreeUpdater::Create(const std::string& name) {
|
|
auto *e = ::dmlc::Registry< ::xgboost::TreeUpdaterReg>::Get()->Find(name);
|
|
if (e == nullptr) {
|
|
LOG(FATAL) << "Unknown tree updater " << name;
|
|
}
|
|
return (e->body)();
|
|
}
|
|
|
|
} // namespace xgboost
|
|
|
|
namespace xgboost {
|
|
namespace tree {
|
|
// List of files that will be force linked in static links.
|
|
DMLC_REGISTRY_LINK_TAG(updater_colmaker);
|
|
DMLC_REGISTRY_LINK_TAG(updater_skmaker);
|
|
DMLC_REGISTRY_LINK_TAG(updater_refresh);
|
|
DMLC_REGISTRY_LINK_TAG(updater_prune);
|
|
DMLC_REGISTRY_LINK_TAG(updater_fast_hist);
|
|
DMLC_REGISTRY_LINK_TAG(updater_histmaker);
|
|
DMLC_REGISTRY_LINK_TAG(updater_sync);
|
|
} // namespace tree
|
|
} // namespace xgboost
|