Support categorical data for hist. (#7695)
* Extract partitioner from hist. * Implement categorical data support by passing the gradient index directly into the partitioner. * Organize/update document. * Remove code for negative hessian.
This commit is contained in:
@@ -604,6 +604,16 @@ class RegTree : public Model {
|
||||
*/
|
||||
std::vector<FeatureType> const &GetSplitTypes() const { return split_types_; }
|
||||
common::Span<uint32_t const> GetSplitCategories() const { return split_categories_; }
|
||||
/*!
|
||||
* \brief Get the bit storage for categories
|
||||
*/
|
||||
common::Span<uint32_t const> NodeCats(bst_node_t nidx) const {
|
||||
auto node_ptr = GetCategoriesMatrix().node_ptr;
|
||||
auto categories = GetCategoriesMatrix().categories;
|
||||
auto segment = node_ptr[nidx];
|
||||
auto node_cats = categories.subspan(segment.beg, segment.size);
|
||||
return node_cats;
|
||||
}
|
||||
auto const& GetSplitCategoriesPtr() const { return split_categories_segments_; }
|
||||
|
||||
// The fields of split_categories_segments_[i] are set such that
|
||||
|
||||
Reference in New Issue
Block a user