xgboost
|
Meta information about dataset, always sit in memory. More...
#include <data.h>
Public Member Functions | |
MetaInfo ()=default | |
default constructor More... | |
bst_float | GetWeight (size_t i) const |
Get weight of each instances. More... | |
unsigned | GetRoot (size_t i) const |
Get the root index of i-th instance. More... | |
const std::vector< size_t > & | LabelAbsSort () const |
get sorted indexes (argsort) of labels by absolute value (used by cox loss) More... | |
void | Clear () |
clear all the information More... | |
void | LoadBinary (dmlc::Stream *fi) |
Load the Meta info from binary stream. More... | |
void | SaveBinary (dmlc::Stream *fo) const |
Save the Meta info to binary stream. More... | |
void | SetInfo (const char *key, const void *dptr, DataType dtype, size_t num) |
Set information in the meta info. More... | |
Public Attributes | |
uint64_t | num_row_ {0} |
number of rows in the data More... | |
uint64_t | num_col_ {0} |
number of columns in the data More... | |
uint64_t | num_nonzero_ {0} |
number of nonzero entries in the data More... | |
HostDeviceVector< bst_float > | labels_ |
label of each instance More... | |
std::vector< bst_uint > | root_index_ |
specified root index of each instance, can be used for multi task setting More... | |
std::vector< bst_uint > | group_ptr_ |
the index of begin and end of a group needed when the learning task is ranking. More... | |
HostDeviceVector< bst_float > | weights_ |
weights of each instance, optional More... | |
std::vector< uint64_t > | qids_ |
session-id of each instance, optional More... | |
HostDeviceVector< bst_float > | base_margin_ |
initialized margins, if specified, xgboost will start from this init margin can be used to specify initial prediction to boost from. More... | |
Static Public Attributes | |
static const int | kVersion = 2 |
version flag, used to check version of this info More... | |
static const int | kVersionQidAdded = 2 |
version that introduced qid field More... | |
Meta information about dataset, always sit in memory.
|
default |
default constructor
void xgboost::MetaInfo::Clear | ( | ) |
clear all the information
|
inline |
Get the root index of i-th instance.
i | Instance index. |
|
inline |
Get weight of each instances.
i | Instance index. |
|
inline |
get sorted indexes (argsort) of labels by absolute value (used by cox loss)
void xgboost::MetaInfo::LoadBinary | ( | dmlc::Stream * | fi | ) |
Load the Meta info from binary stream.
fi | The input stream |
void xgboost::MetaInfo::SaveBinary | ( | dmlc::Stream * | fo | ) | const |
Save the Meta info to binary stream.
fo | The output stream. |
void xgboost::MetaInfo::SetInfo | ( | const char * | key, |
const void * | dptr, | ||
DataType | dtype, | ||
size_t | num | ||
) |
Set information in the meta info.
key | The key of the information. |
dptr | The data pointer of the source array. |
dtype | The type of the source data. |
num | Number of elements in the source array. |
HostDeviceVector<bst_float> xgboost::MetaInfo::base_margin_ |
initialized margins, if specified, xgboost will start from this init margin can be used to specify initial prediction to boost from.
std::vector<bst_uint> xgboost::MetaInfo::group_ptr_ |
the index of begin and end of a group needed when the learning task is ranking.
|
static |
version flag, used to check version of this info
|
static |
version that introduced qid field
HostDeviceVector<bst_float> xgboost::MetaInfo::labels_ |
label of each instance
uint64_t xgboost::MetaInfo::num_col_ {0} |
number of columns in the data
uint64_t xgboost::MetaInfo::num_nonzero_ {0} |
number of nonzero entries in the data
uint64_t xgboost::MetaInfo::num_row_ {0} |
number of rows in the data
std::vector<uint64_t> xgboost::MetaInfo::qids_ |
session-id of each instance, optional
std::vector<bst_uint> xgboost::MetaInfo::root_index_ |
specified root index of each instance, can be used for multi task setting
HostDeviceVector<bst_float> xgboost::MetaInfo::weights_ |
weights of each instance, optional