关于数据集的元信息,始终驻留在内存中。 更多...
#include <data.h>
|  | 
|  | MetaInfo () | 
|  | 
|  | MetaInfo (MetaInfo &&that)=default | 
|  | 
|  | MetaInfo (MetaInfo const &that)=delete | 
|  | 
| MetaInfo & | operator= (MetaInfo &&that)=default | 
|  | 
| MetaInfo & | operator= (MetaInfo const &that)=delete | 
|  | 
| void | Validate (DeviceOrd device) const | 
|  | 验证所有元信息。更多... 
 | 
|  | 
| MetaInfo | Slice (Context const *ctx, common::Span< bst_idx_t const > ridxs, bst_idx_t nnz) const | 
|  | 切片元信息。更多... 
 | 
|  | 
| MetaInfo | Copy () const | 
|  | 
| bool | IsDense () const | 
|  | 矩阵是否是密集的。更多... 
 | 
|  | 
| bst_float | GetWeight (size_t i) const | 
|  | 获取每个实例的权重。更多... 
 | 
|  | 
| const std::vector< size_t > & | LabelAbsSort (Context const *ctx) const | 
|  | 按绝对值获取标签的排序索引(argsort)(用于cox损失)。更多... 
 | 
|  | 
| void | Clear () | 
|  | 清除所有信息。更多... 
 | 
|  | 
| void | LoadBinary (dmlc::Stream *fi) | 
|  | 从二进制流加载元信息。更多... 
 | 
|  | 
| void | SaveBinary (dmlc::Stream *fo) const | 
|  | 将元信息保存到二进制流。更多... 
 | 
|  | 
| void | SetInfo (Context const &ctx, StringView key, StringView interface_str) | 
|  | 使用数组接口在元信息中设置信息。更多... 
 | 
|  | 
| void | GetInfo (char const *key, bst_ulong *out_len, DataType dtype, const void **out_dptr) const | 
|  | 
| void | SetFeatureInfo (const char *key, const char **info, const bst_ulong size) | 
|  | 
| void | GetFeatureInfo (const char *field, std::vector< std::string > *out_str_vecs) const | 
|  | 
| void | Extend (MetaInfo const &that, bool accumulate_rows, bool check_column) | 
|  | 扩展其他 MetaInfo。更多... 
 | 
|  | 
| void | SynchronizeNumberOfColumns (Context const *ctx, DataSplitMode split_mode) | 
|  | 同步所有工作节点的列数。更多... 
 | 
|  | 
| bool | IsRowSplit () const | 
|  | 数据是否按行拆分。更多... 
 | 
|  | 
| bool | IsColumnSplit () const | 
|  | 数据是否按列拆分。更多... 
 | 
|  | 
| bool | IsRanking () const | 
|  | 这是否是排序学习数据。更多... 
 | 
|  | 
| bool | IsVerticalFederated () const | 
|  | 一个方便的方法,用于检查我们是否正在进行垂直联邦学习,这需要一些特殊的处理。更多... 
 | 
|  | 
| bool | ShouldHaveLabels () const | 
|  | 一个方便的方法,用于检查 MetaInfo 是否应该包含标签。更多... 
 | 
|  | 
| bool | HasCategorical () const | 
|  | DMatrix 是否具有分类特征的标志。更多... 
 | 
|  | 
| CatContainer const * | Cats () const | 
|  | 分类的获取器。更多... 
 | 
|  | 
| CatContainer * | Cats () | 
|  | 
| std::shared_ptr< CatContainer const > | CatsShared () const | 
|  | 
| void | Cats (std::shared_ptr< CatContainer > cats) | 
|  | 分类的设置器。更多... 
 | 
|  | 
◆ MetaInfo() [1/3]
      
        
          | xgboost::MetaInfo::MetaInfo | ( |  | ) |  | 
      
 
 
◆ MetaInfo() [2/3]
  
  | 
        
          | xgboost::MetaInfo::MetaInfo | ( | MetaInfo && | that | ) |  |  | 默认 | 
 
 
◆ MetaInfo() [3/3]
  
  | 
        
          | xgboost::MetaInfo::MetaInfo | ( | MetaInfo const & | that | ) |  |  | 删除 | 
 
 
◆ Cats() [1/3]
      
        
          | CatContainer* xgboost::MetaInfo::Cats | ( |  | ) |  | 
      
 
 
◆ Cats() [2/3]
      
        
          | CatContainer const* xgboost::MetaInfo::Cats | ( |  | ) | const | 
      
 
 
◆ Cats() [3/3]
      
        
          | void xgboost::MetaInfo::Cats | ( | std::shared_ptr< CatContainer > | cats | ) |  | 
      
 
 
◆ CatsShared()
      
        
          | std::shared_ptr<CatContainer const> xgboost::MetaInfo::CatsShared | ( |  | ) | const | 
      
 
 
◆ Clear()
      
        
          | void xgboost::MetaInfo::Clear | ( |  | ) |  | 
      
 
 
◆ Copy()
      
        
          | MetaInfo xgboost::MetaInfo::Copy | ( |  | ) | const | 
      
 
 
◆ Extend()
      
        
          | void xgboost::MetaInfo::Extend | ( | MetaInfo const & | that, | 
        
          |  |  | bool | accumulate_rows, | 
        
          |  |  | bool | check_column | 
        
          |  | ) |  |  | 
      
 
扩展其他 MetaInfo。
- 参数
- 
  
    | that | 其他 MetaInfo 对象。 |  | accumulate_rows | 此函数中是否需要累积行。如果客户端代码预先知道行数,则将此参数设置为 false。 |  | check_column | 扩展方法是否应检查列的一致性。 |  
 
 
 
◆ GetFeatureInfo()
      
        
          | void xgboost::MetaInfo::GetFeatureInfo | ( | const char * | field, | 
        
          |  |  | std::vector< std::string > * | out_str_vecs | 
        
          |  | ) |  | const | 
      
 
 
◆ GetInfo()
      
        
          | void xgboost::MetaInfo::GetInfo | ( | char const * | key, | 
        
          |  |  | bst_ulong * | out_len, | 
        
          |  |  | DataType | dtype, | 
        
          |  |  | const void ** | out_dptr | 
        
          |  | ) |  | const | 
      
 
 
◆ GetWeight()
  
  | 
        
          | bst_float xgboost::MetaInfo::GetWeight | ( | size_t | i | ) | const |  | inline | 
 
 
◆ HasCategorical()
  
  | 
        
          | bool xgboost::MetaInfo::HasCategorical | ( |  | ) | const |  | inline | 
 
 
◆ IsColumnSplit()
  
  | 
        
          | bool xgboost::MetaInfo::IsColumnSplit | ( |  | ) | const |  | inline | 
 
 
◆ IsDense()
  
  | 
        
          | bool xgboost::MetaInfo::IsDense | ( |  | ) | const |  | inline | 
 
 
◆ IsRanking()
  
  | 
        
          | bool xgboost::MetaInfo::IsRanking | ( |  | ) | const |  | inline | 
 
 
◆ IsRowSplit()
  
  | 
        
          | bool xgboost::MetaInfo::IsRowSplit | ( |  | ) | const |  | inline | 
 
 
◆ IsVerticalFederated()
      
        
          | bool xgboost::MetaInfo::IsVerticalFederated | ( |  | ) | const | 
      
 
一个方便的方法,用于检查我们是否正在进行垂直联邦学习,这需要一些特殊的处理。
 
 
◆ LabelAbsSort()
      
        
          | const std::vector<size_t>& xgboost::MetaInfo::LabelAbsSort | ( | Context const * | ctx | ) | const | 
      
 
按绝对值获取标签的排序索引(argsort)(用于cox损失)。
 
 
◆ LoadBinary()
      
        
          | void xgboost::MetaInfo::LoadBinary | ( | dmlc::Stream * | fi | ) |  | 
      
 
 
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ SaveBinary()
      
        
          | void xgboost::MetaInfo::SaveBinary | ( | dmlc::Stream * | fo | ) | const | 
      
 
 
◆ SetFeatureInfo()
      
        
          | void xgboost::MetaInfo::SetFeatureInfo | ( | const char * | key, | 
        
          |  |  | const char ** | info, | 
        
          |  |  | const bst_ulong | size | 
        
          |  | ) |  |  | 
      
 
 
◆ SetInfo()
使用数组接口在元信息中设置信息。
- 参数
- 
  
    | key | 信息的键。 |  | interface_str | JSON 格式数组接口的字符串表示。 |  
 
 
 
◆ ShouldHaveLabels()
      
        
          | bool xgboost::MetaInfo::ShouldHaveLabels | ( |  | ) | const | 
      
 
一个方便的方法,用于检查 MetaInfo 是否应该包含标签。
通常我们假设标签在所有地方都可用。唯一的例外是在垂直联邦学习中,标签仅在 worker 0 上可用。
 
 
◆ Slice()
切片元信息。
ridxs 的设备由 ctx 对象指定。
- 参数
- 
  
  
 
 
◆ SynchronizeNumberOfColumns()
      
        
          | void xgboost::MetaInfo::SynchronizeNumberOfColumns | ( | Context const * | ctx, | 
        
          |  |  | DataSplitMode | split_mode | 
        
          |  | ) |  |  | 
      
 
同步所有工作节点的列数。
通常我们只需要找出所有工作节点的最大列数,但在垂直联邦学习中,由于每个工作节点加载自己的列列表,我们需要对它们求和。
 
 
◆ Validate()
      
        
          | void xgboost::MetaInfo::Validate | ( | DeviceOrd | device | ) | const | 
      
 
 
◆ base_margin_
初始化的边距,如果指定,xgboost 将从这个初始边距开始。可用于指定初始预测以进行提升。
 
 
◆ data_split_mode
◆ feature_names
      
        
          | std::vector<std::string> xgboost::MetaInfo::feature_names | 
      
 
 
◆ feature_type_names
      
        
          | std::vector<std::string> xgboost::MetaInfo::feature_type_names | 
      
 
用户提供的每个特征的类型名称。例如:“int”/“float”/“i”/“q”。
 
 
◆ feature_types
◆ feature_weights
◆ group_ptr_
◆ kNumField
  
  | 
        
          | constexpr uint64_t xgboost::MetaInfo::kNumField = 13 |  | staticconstexpr | 
 
 
◆ labels
◆ labels_lower_bound_
◆ labels_upper_bound_
◆ num_col_
      
        
          | uint64_t xgboost::MetaInfo::num_col_ {0} | 
      
 
 
◆ num_nonzero_
      
        
          | uint64_t xgboost::MetaInfo::num_nonzero_ {0} | 
      
 
 
◆ num_row_
◆ weights_
此类的文档由以下文件生成
- /home/docs/checkouts/readthedocs.org/user_builds/xgboost/checkouts/stable/include/xgboost/data.h