Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
LightGBM::FeatureGroup Class Reference

Using to store data and providing some operations on one feature group. More...

#include <feature_group.h>

Public Member Functions

 FeatureGroup (int num_feature, std::vector< std::unique_ptr< BinMapper > > &bin_mappers, data_size_t num_data, double sparse_threshold, bool is_enable_sparse)
 Constructor.
 
 FeatureGroup (int num_feature, std::vector< std::unique_ptr< BinMapper > > &bin_mappers, data_size_t num_data, bool is_sparse)
 
 FeatureGroup (const void *memory, data_size_t num_all_data, const std::vector< data_size_t > &local_used_indices)
 Constructor from memory.
 
 ~FeatureGroup ()
 Destructor.
 
void PushData (int tid, int sub_feature_idx, data_size_t line_idx, double value)
 Push one record, will auto convert to bin and push to bin data.
 
void CopySubset (const FeatureGroup *full_feature, const data_size_t *used_indices, data_size_t num_used_indices)
 
BinIteratorSubFeatureIterator (int sub_feature)
 
BinIteratorFeatureGroupIterator ()
 Returns a BinIterator that can access the entire feature group's raw data. The RawGet() function of the iterator should be called for best efficiency.
 
data_size_t Split (int sub_feature, const uint32_t *threshold, int num_threshold, bool default_left, data_size_t *data_indices, data_size_t num_data, data_size_t *lte_indices, data_size_t *gt_indices) const
 
double BinToValue (int sub_feature_idx, uint32_t bin) const
 From bin to feature value.
 
void SaveBinaryToFile (const VirtualFileWriter *writer) const
 Save binary data to file.
 
size_t SizesInByte () const
 Get sizes in byte of this object.
 
FeatureGroupoperator= (const FeatureGroup &)=delete
 Disable copy.
 
 FeatureGroup (const FeatureGroup &)=delete
 Disable copy.
 

Data Fields

friend Dataset
 
friend DatasetLoader
 

Detailed Description

Using to store data and providing some operations on one feature group.

Constructor & Destructor Documentation

◆ FeatureGroup() [1/2]

LightGBM::FeatureGroup::FeatureGroup ( int  num_feature,
std::vector< std::unique_ptr< BinMapper > > &  bin_mappers,
data_size_t  num_data,
double  sparse_threshold,
bool  is_enable_sparse 
)
inline

Constructor.

Parameters
num_featurenumber of features of this group
bin_mappersBin mapper for features
num_dataTotal number of data
is_enable_sparseTrue if enable sparse feature
sparse_thresholdThreshold for treating a feature as a sparse feature

◆ FeatureGroup() [2/2]

LightGBM::FeatureGroup::FeatureGroup ( const void *  memory,
data_size_t  num_all_data,
const std::vector< data_size_t > &  local_used_indices 
)
inline

Constructor from memory.

Parameters
memoryPointer of memory
num_all_dataNumber of global data
local_used_indicesLocal used indices, empty means using all data

Member Function Documentation

◆ BinToValue()

double LightGBM::FeatureGroup::BinToValue ( int  sub_feature_idx,
uint32_t  bin 
) const
inline

From bin to feature value.

Parameters
bin
Returns
FeatureGroup value of this bin

◆ FeatureGroupIterator()

BinIterator * LightGBM::FeatureGroup::FeatureGroupIterator ( )
inline

Returns a BinIterator that can access the entire feature group's raw data. The RawGet() function of the iterator should be called for best efficiency.

Returns
A pointer to the BinIterator object

◆ PushData()

void LightGBM::FeatureGroup::PushData ( int  tid,
int  sub_feature_idx,
data_size_t  line_idx,
double  value 
)
inline

Push one record, will auto convert to bin and push to bin data.

Parameters
tidThread id
idxIndex of record
valuefeature value of record

◆ SaveBinaryToFile()

void LightGBM::FeatureGroup::SaveBinaryToFile ( const VirtualFileWriter writer) const
inline

Save binary data to file.

Parameters
fileFile want to write

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