xgboost
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
xgboost::MetaInfo Class Reference

Meta information about dataset, always sit in memory. More...

#include <data.h>

Collaboration diagram for xgboost::MetaInfo:
Collaboration graph

Public Member Functions

 MetaInfo ()=default
 default constructor More...
 
 MetaInfo (MetaInfo &&that)=default
 
MetaInfooperator= (MetaInfo &&that)=default
 
MetaInfooperator= (MetaInfo const &that)
 
void Validate (int32_t device) const
 Validate all metainfo. More...
 
MetaInfo Slice (common::Span< int32_t const > ridxs) const
 
bst_float GetWeight (size_t i) const
 Get weight of each instances. 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...
 
void SetInfo (const char *key, std::string const &interface_str)
 Set information in the meta info with array interface. 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_floatlabels_
 label of each instance More...
 
std::vector< bst_group_tgroup_ptr_
 the index of begin and end of a group needed when the learning task is ranking. More...
 
HostDeviceVector< bst_floatweights_
 weights of each instance, optional More...
 
HostDeviceVector< bst_floatbase_margin_
 initialized margins, if specified, xgboost will start from this init margin can be used to specify initial prediction to boost from. More...
 
HostDeviceVector< bst_floatlabels_lower_bound_
 lower bound of the label, to be used for survival analysis (censored regression) More...
 
HostDeviceVector< bst_floatlabels_upper_bound_
 upper bound of the label, to be used for survival analysis (censored regression) More...
 

Static Public Attributes

static constexpr uint64_t kNumField = 9
 number of data fields in MetaInfo More...
 

Detailed Description

Meta information about dataset, always sit in memory.

Constructor & Destructor Documentation

◆ MetaInfo() [1/2]

xgboost::MetaInfo::MetaInfo ( )
default

default constructor

◆ MetaInfo() [2/2]

xgboost::MetaInfo::MetaInfo ( MetaInfo &&  that)
default

Member Function Documentation

◆ Clear()

void xgboost::MetaInfo::Clear ( )

clear all the information

◆ GetWeight()

bst_float xgboost::MetaInfo::GetWeight ( size_t  i) const
inline

Get weight of each instances.

Parameters
iInstance index.
Returns
The weight.

◆ LabelAbsSort()

const std::vector<size_t>& xgboost::MetaInfo::LabelAbsSort ( ) const
inline

get sorted indexes (argsort) of labels by absolute value (used by cox loss)

◆ LoadBinary()

void xgboost::MetaInfo::LoadBinary ( dmlc::Stream *  fi)

Load the Meta info from binary stream.

Parameters
fiThe input stream

◆ operator=() [1/2]

MetaInfo& xgboost::MetaInfo::operator= ( MetaInfo &&  that)
default

◆ operator=() [2/2]

MetaInfo& xgboost::MetaInfo::operator= ( MetaInfo const &  that)
inline

◆ SaveBinary()

void xgboost::MetaInfo::SaveBinary ( dmlc::Stream *  fo) const

Save the Meta info to binary stream.

Parameters
foThe output stream.

◆ SetInfo() [1/2]

void xgboost::MetaInfo::SetInfo ( const char *  key,
const void *  dptr,
DataType  dtype,
size_t  num 
)

Set information in the meta info.

Parameters
keyThe key of the information.
dptrThe data pointer of the source array.
dtypeThe type of the source data.
numNumber of elements in the source array.

◆ SetInfo() [2/2]

void xgboost::MetaInfo::SetInfo ( const char *  key,
std::string const &  interface_str 
)

Set information in the meta info with array interface.

Parameters
keyThe key of the information.
interface_strString representation of json format array interface.
     [ column_0, column_1, ... column_n ]

   Right now only 1 column is permitted.

◆ Slice()

MetaInfo xgboost::MetaInfo::Slice ( common::Span< int32_t const >  ridxs) const

◆ Validate()

void xgboost::MetaInfo::Validate ( int32_t  device) const

Validate all metainfo.

Member Data Documentation

◆ base_margin_

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.

◆ group_ptr_

std::vector<bst_group_t> xgboost::MetaInfo::group_ptr_

the index of begin and end of a group needed when the learning task is ranking.

◆ kNumField

constexpr uint64_t xgboost::MetaInfo::kNumField = 9
static

number of data fields in MetaInfo

◆ labels_

HostDeviceVector<bst_float> xgboost::MetaInfo::labels_

label of each instance

◆ labels_lower_bound_

HostDeviceVector<bst_float> xgboost::MetaInfo::labels_lower_bound_

lower bound of the label, to be used for survival analysis (censored regression)

◆ labels_upper_bound_

HostDeviceVector<bst_float> xgboost::MetaInfo::labels_upper_bound_

upper bound of the label, to be used for survival analysis (censored regression)

◆ num_col_

uint64_t xgboost::MetaInfo::num_col_ {0}

number of columns in the data

◆ num_nonzero_

uint64_t xgboost::MetaInfo::num_nonzero_ {0}

number of nonzero entries in the data

◆ num_row_

uint64_t xgboost::MetaInfo::num_row_ {0}

number of rows in the data

◆ weights_

HostDeviceVector<bst_float> xgboost::MetaInfo::weights_

weights of each instance, optional


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