This class used to convert feature values into bin, and store some meta information for bin.
More...
#include <bin.h>
|
| BinMapper (const BinMapper &other) |
|
| BinMapper (const void *memory) |
|
bool | CheckAlign (const BinMapper &other) const |
|
int | num_bin () const |
| Get number of bins.
|
|
MissingType | missing_type () const |
| Missing Type.
|
|
bool | is_trivial () const |
| True if bin is trivial (contains only one bin)
|
|
double | sparse_rate () const |
| Sparsity of this bin ( num_zero_bins / num_data )
|
|
void | SaveBinaryToFile (const VirtualFileWriter *writer) const |
| Save binary data to file.
|
|
double | BinToValue (uint32_t bin) const |
| Mapping bin into feature value.
|
|
size_t | SizesInByte () const |
| Get sizes in byte of this object.
|
|
uint32_t | ValueToBin (double value) const |
| Mapping feature value into bin.
|
|
uint32_t | GetDefaultBin () const |
| Get the default bin when value is 0.
|
|
void | FindBin (double *values, int num_values, size_t total_sample_cnt, int max_bin, int min_data_in_bin, int min_split_data, BinType bin_type, bool use_missing, bool zero_as_missing) |
| Construct feature value to bin mapper according feature values.
|
|
void | CopyTo (char *buffer) const |
| Seirilizing this object to buffer.
|
|
void | CopyFrom (const char *buffer) |
| Deserilizing this object from buffer.
|
|
BinType | bin_type () const |
| Get bin types.
|
|
std::string | bin_info () const |
| Get bin info.
|
|
|
static int | SizeForSpecificBin (int bin) |
| Use specific number of bin to calculate the size of this class.
|
|
This class used to convert feature values into bin, and store some meta information for bin.
◆ BinToValue()
double LightGBM::BinMapper::BinToValue |
( |
uint32_t |
bin | ) |
const |
|
inline |
Mapping bin into feature value.
- Parameters
-
- Returns
- Feature value of this bin
◆ CopyFrom()
void LightGBM::BinMapper::CopyFrom |
( |
const char * |
buffer | ) |
|
Deserilizing this object from buffer.
- Parameters
-
◆ CopyTo()
void LightGBM::BinMapper::CopyTo |
( |
char * |
buffer | ) |
const |
Seirilizing this object to buffer.
- Parameters
-
◆ FindBin()
void LightGBM::BinMapper::FindBin |
( |
double * |
values, |
|
|
int |
num_values, |
|
|
size_t |
total_sample_cnt, |
|
|
int |
max_bin, |
|
|
int |
min_data_in_bin, |
|
|
int |
min_split_data, |
|
|
BinType |
bin_type, |
|
|
bool |
use_missing, |
|
|
bool |
zero_as_missing |
|
) |
| |
Construct feature value to bin mapper according feature values.
- Parameters
-
values | (Sampled) values of this feature, Note: not include zero. |
num_values | number of values. |
total_sample_cnt | number of total sample count, equal with values.size() + num_zeros |
max_bin | The maximal number of bin |
min_data_in_bin | min number of data in one bin |
min_split_data | |
bin_type | Type of this bin |
use_missing | True to enable missing value handle |
zero_as_missing | True to use zero as missing value |
◆ GetDefaultBin()
uint32_t LightGBM::BinMapper::GetDefaultBin |
( |
| ) |
const |
|
inline |
Get the default bin when value is 0.
- Returns
- default bin
◆ SaveBinaryToFile()
Save binary data to file.
- Parameters
-
◆ SizeForSpecificBin()
int LightGBM::BinMapper::SizeForSpecificBin |
( |
int |
bin | ) |
|
|
static |
Use specific number of bin to calculate the size of this class.
- Parameters
-
- Returns
- Size
◆ ValueToBin()
uint32_t LightGBM::BinMapper::ValueToBin |
( |
double |
value | ) |
const |
|
inline |
Mapping feature value into bin.
- Parameters
-
- Returns
- bin for this feature value
The documentation for this class was generated from the following files:
- External/LightGBM_2.2.3/LightGBM-2.2.3/include/LightGBM/bin.h
- External/LightGBM_2.2.3/LightGBM-2.2.3/src/io/bin.cpp