Medial Code Documentation
|
statistics that is helpful to store and represent a split solution for the tree More...
#include <param.h>
Public Member Functions | |
void | CopyAndCollect (SplitEntryContainer< GradientT > const &that, std::vector< uint32_t > *collected_cat_bits, std::vector< std::size_t > *cat_bits_sizes) |
Copy primitive fields into this, and collect cat_bits into a vector. | |
template<typename G > | |
void | CopyAndCollect (SplitEntryContainer< GradientT > const &that, std::vector< uint32_t > *collected_cat_bits, std::vector< std::size_t > *cat_bits_sizes, std::vector< G > *collected_gradients) |
Copy primitive fields into this, and collect cat_bits and gradient sums into vectors. | |
bst_feature_t | SplitIndex () const |
bool | DefaultLeft () const |
bool | NeedReplace (bst_float new_loss_chg, unsigned split_index) const |
decides whether we can replace current entry with the given statistics | |
bool | Update (const SplitEntryContainer &e) |
update the split entry, replace it if e is better | |
template<typename GradientSumT > | |
bool | Update (bst_float new_loss_chg, bst_feature_t split_index, float new_split_value, bool default_left, bool is_cat, GradientSumT const &left_sum, GradientSumT const &right_sum) |
update the split entry, replace it if e is better | |
Static Public Member Functions | |
static void | Reduce (SplitEntryContainer &dst, const SplitEntryContainer &src) |
same as update, used by AllReduce | |
Data Fields | |
bst_float | loss_chg {0.0f} |
loss change after split this node | |
bst_feature_t | sindex {0} |
split index | |
bst_float | split_value {0.0f} |
std::vector< uint32_t > | cat_bits |
bool | is_cat {false} |
GradientT | left_sum |
GradientT | right_sum |
Friends | |
std::ostream & | operator<< (std::ostream &os, SplitEntryContainer const &s) |
statistics that is helpful to store and represent a split solution for the tree
|
inline |
Copy primitive fields into this, and collect cat_bits into a vector.
This is used for allgather.
that | The other entry to copy from |
collected_cat_bits | The vector to collect cat_bits |
cat_bits_sizes | The sizes of the collected cat_bits |
|
inline |
Copy primitive fields into this, and collect cat_bits and gradient sums into vectors.
This is used for allgather.
that | The other entry to copy from |
collected_cat_bits | The vector to collect cat_bits |
cat_bits_sizes | The sizes of the collected cat_bits |
collected_gradients | The vector to collect gradients |
|
inline |
|
inline |
decides whether we can replace current entry with the given statistics
This function gives better priority to lower index when loss_chg == new_loss_chg. Not the best way, but helps to give consistent result during multi-thread execution.
new_loss_chg | the loss reduction get through the split |
split_index | the feature index where the split is on |
|
inline |
|
inline |
update the split entry, replace it if e is better
new_loss_chg | loss reduction of new candidate |
split_index | feature index to split on |
new_split_value | the split point |
default_left | whether the missing value goes to left |
|
inline |
update the split entry, replace it if e is better
e | candidate split solution |