add tree refresher, need review
This commit is contained in:
parent
dbf3a21942
commit
f757520c02
@ -512,8 +512,6 @@ class RegTree: public TreeModel<bst_float, RTreeNodeStat>{
|
|||||||
int pid = this->GetLeafIndex(feat, root_id);
|
int pid = this->GetLeafIndex(feat, root_id);
|
||||||
return (*this)[pid].leaf_value();
|
return (*this)[pid].leaf_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
/*! \brief get next position of the tree given current pid */
|
/*! \brief get next position of the tree given current pid */
|
||||||
inline int GetNext(int pid, float fvalue, bool is_unknown) const {
|
inline int GetNext(int pid, float fvalue, bool is_unknown) const {
|
||||||
float split_value = (*this)[pid].split_cond();
|
float split_value = (*this)[pid].split_cond();
|
||||||
|
|||||||
@ -48,6 +48,7 @@ class IUpdater {
|
|||||||
} // namespace xgboost
|
} // namespace xgboost
|
||||||
|
|
||||||
#include "./updater_prune-inl.hpp"
|
#include "./updater_prune-inl.hpp"
|
||||||
|
#include "./updater_refresh-inl.hpp"
|
||||||
#include "./updater_colmaker-inl.hpp"
|
#include "./updater_colmaker-inl.hpp"
|
||||||
|
|
||||||
namespace xgboost {
|
namespace xgboost {
|
||||||
@ -60,6 +61,7 @@ namespace tree {
|
|||||||
template<typename FMatrix>
|
template<typename FMatrix>
|
||||||
inline IUpdater<FMatrix>* CreateUpdater(const char *name) {
|
inline IUpdater<FMatrix>* CreateUpdater(const char *name) {
|
||||||
if (!strcmp(name, "prune")) return new TreePruner<FMatrix>();
|
if (!strcmp(name, "prune")) return new TreePruner<FMatrix>();
|
||||||
|
if (!strcmp(name, "refresh")) return new TreeRefresher<FMatrix>();
|
||||||
if (!strcmp(name, "grow_colmaker")) return new ColMaker<FMatrix, GradStats>();
|
if (!strcmp(name, "grow_colmaker")) return new ColMaker<FMatrix, GradStats>();
|
||||||
utils::Error("unknown updater:%s", name);
|
utils::Error("unknown updater:%s", name);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user