Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions
LightGBM::DataPartition Class Reference

DataPartition is used to store the the partition of data on tree. More...

#include <data_partition.hpp>

Public Member Functions

 DataPartition (data_size_t num_data, int num_leaves)
 
void ResetLeaves (int num_leaves)
 
void ResetNumData (int num_data)
 
void Init ()
 Init, will put all data on the root(leaf_idx = 0)
 
void ResetByLeafPred (const std::vector< int > &leaf_pred, int num_leaves)
 
const data_size_tGetIndexOnLeaf (int leaf, data_size_t *out_len) const
 Get the data indices of one leaf.
 
void Split (int leaf, const Dataset *dataset, int feature, const uint32_t *threshold, int num_threshold, bool default_left, int right_leaf)
 Split the data.
 
void SetUsedDataIndices (const data_size_t *used_data_indices, data_size_t num_used_data)
 SetLabelAt used data indices before training, used for bagging.
 
data_size_t leaf_count (int leaf) const
 Get number of data on one leaf.
 
data_size_t leaf_begin (int leaf) const
 Get leaf begin.
 
const data_size_tindices () const
 
int num_leaves () const
 Get number of leaves.
 

Detailed Description

DataPartition is used to store the the partition of data on tree.

Member Function Documentation

◆ GetIndexOnLeaf()

const data_size_t * LightGBM::DataPartition::GetIndexOnLeaf ( int  leaf,
data_size_t out_len 
) const
inline

Get the data indices of one leaf.

Parameters
leafindex of leaf
indicesoutput data indices
Returns
number of data on this leaf

◆ leaf_begin()

data_size_t LightGBM::DataPartition::leaf_begin ( int  leaf) const
inline

Get leaf begin.

Parameters
leafindex of leaf
Returns
begin index of this leaf

◆ leaf_count()

data_size_t LightGBM::DataPartition::leaf_count ( int  leaf) const
inline

Get number of data on one leaf.

Parameters
leafindex of leaf
Returns
number of data of this leaf

◆ SetUsedDataIndices()

void LightGBM::DataPartition::SetUsedDataIndices ( const data_size_t used_data_indices,
data_size_t  num_used_data 
)
inline

SetLabelAt used data indices before training, used for bagging.

Parameters
used_data_indicesindices of used data
num_used_datanumber of used data

◆ Split()

void LightGBM::DataPartition::Split ( int  leaf,
const Dataset dataset,
int  feature,
const uint32_t *  threshold,
int  num_threshold,
bool  default_left,
int  right_leaf 
)
inline

Split the data.

Parameters
leafindex of leaf
feature_binsfeature bin data
thresholdthreshold that want to split
right_leafindex of right leaf

The documentation for this class was generated from the following file: