28 #include "pugixml/src/pugixml.hpp" 30 #ifdef QUICKRANK_PERF_STATS 52 #ifdef QUICKRANK_PERF_STATS 54 static std::atomic<std::uint_fast64_t> _internal_nodes_traversed;
60 avglabel = prediction;
73 RTNode(
size_t *new_sampleids,
size_t new_nsampleids,
75 sampleids = new_sampleids;
76 nsampleids = new_nsampleids;
77 avglabel = prediction;
81 RTNode(
float new_threshold,
size_t new_featureidx,
82 size_t new_featureid,
RTNode *new_left,
RTNode *new_right) {
83 threshold = new_threshold;
84 featureidx = new_featureidx;
85 featureid = new_featureid;
99 sampleids = new_sampleids;
102 avglabel = nsampleids ? sumlabel / (double) nsampleids : 0.0;
117 featureidx = fidx, featureid = fid;
134 const size_t next_fx_offset)
const {
143 (d[featureidx * next_fx_offset] <= threshold ?
146 #ifdef QUICKRANK_PERF_STATS 148 _internal_nodes_traversed.fetch_add(1, std::memory_order_relaxed);
153 #ifdef QUICKRANK_PERF_STATS 154 static void clean_stats() {
155 _internal_nodes_traversed = 0;
158 static unsigned long long internal_nodes_traversed() {
159 return _internal_nodes_traversed;
164 const std::string &pos =
"")
const;
RTNodeHistogram * hist
Definition: rtnode.h:46
RTNode(size_t *new_sampleids, RTNodeHistogram *new_hist)
Definition: rtnode.h:97
size_t const * thresholds_size
Definition: rtnode_histogram.h:29
size_t * sampleids
Definition: rtnode.h:39
bool is_leaf() const
Definition: rtnode.h:129
double squares_sum_
Definition: rtnode_histogram.h:34
size_t get_feature_idx()
Definition: rtnode.h:122
RTNode(double prediction)
Definition: rtnode.h:59
static RTNode * parse_xml(const pugi::xml_node &split_xml)
Definition: rtnode.cc:78
double ** sumlbl
Definition: rtnode_histogram.h:32
RTNode * left
Definition: rtnode.h:44
RTNode(float new_threshold, size_t new_featureidx, size_t new_featureid, RTNode *new_left, RTNode *new_right)
Definition: rtnode.h:81
float Feature
data type for instance predicted label
Definition: types.h:31
RTNode(size_t *new_sampleids, size_t new_nsampleids, double prediction)
Definition: rtnode.h:73
pugi::xml_node append_xml_model(pugi::xml_node parent, const std::string &pos="") const
Definition: rtnode.cc:48
quickrank::Score score_instance(const quickrank::Feature *d, const size_t next_fx_offset) const
Definition: rtnode.h:133
size_t featureid
Definition: rtnode.h:50
double avglabel
Definition: rtnode.h:43
double Score
data type for instance truth label
Definition: types.h:30
void save_leaves(RTNode **&leaves, size_t &nleaves, size_t &capacity)
Definition: rtnode.cc:34
size_t nsampleids
Definition: rtnode.h:40
double deviance
Definition: rtnode.h:42
Definition: rtnode_histogram.h:26
~RTNode()
Definition: rtnode.h:109
size_t get_feature_id()
Definition: rtnode.h:119
float threshold
Definition: rtnode.h:41
void set_feature(size_t fidx, size_t fid)
Definition: rtnode.h:115
size_t ** count
Definition: rtnode_histogram.h:33
RTNode * right
Definition: rtnode.h:45
static const size_t uint_max
Definition: rtnode.h:34
size_t featureidx
Definition: rtnode.h:49