xgboost

Public Types | Public Member Functions | Public Attributes | List of all members
xgboost::SparsePage Class Reference

In-memory storage unit of sparse batch, stored in CSR format. More...

`#include <data.h>`

Inheritance diagram for xgboost::SparsePage:
Collaboration diagram for xgboost::SparsePage:

## Public Types
using | Inst = common::Span< Entry const >
| an instance of sparse vector in the batch More...

## Public Member Functions
HostSparsePageView | GetView () const
| SparsePage ()
| constructor More...
size_t | Size () const
size_t | MemCostBytes () const
void | Clear ()
| clear the page More...
void | SetBaseRowId (size_t row_id)
| Set the base row id for this page. More...
SparsePage | GetTranspose (int num_columns, int32_t n_threads) const
void | SortIndices (int32_t n_threads)
| Sort the column index. More...
bool | IsIndicesSorted (int32_t n_threads) const
| Check wether the column index is sorted. More...
void | SortRows (int32_t n_threads)
template<typename AdapterBatchT >
uint64_t | Push (const AdapterBatchT &batch, float missing, int nthread)
| Pushes external data batch onto this page. More...
void | Push (const SparsePage &batch)
| Push a sparse page. More...
void | PushCSC (const SparsePage &batch)
| Push a SparsePage stored in CSC format. More...

## Public Attributes
HostDeviceVector< bst_row_t > | offset
HostDeviceVector< Entry > | data
| the data of the segments More...
size_t | base_rowid {0}

## Detailed Description

In-memory storage unit of sparse batch, stored in CSR format.

## Member Typedef Documentation

## ◆ Inst

using xgboost::SparsePage::Inst = common::Span<Entry const>

an instance of sparse vector in the batch

## Constructor & Destructor Documentation

## ◆ SparsePage()

xgboost::SparsePage::SparsePage | ( |  | ) |
| inline

constructor

## Member Function Documentation

## ◆ Clear()

void xgboost::SparsePage::Clear | ( |  | ) |
| inline

clear the page

## ◆ GetTranspose()

SparsePage xgboost::SparsePage::GetTranspose | ( | int | num_columns,
|  | int32_t | n_threads
| ) |  | const

## ◆ GetView()

HostSparsePageView xgboost::SparsePage::GetView | ( |  | ) | const
| inline

## ◆ IsIndicesSorted()

bool xgboost::SparsePage::IsIndicesSorted | ( | int32_t | n_threads | ) | const

Check wether the column index is sorted.

## ◆ MemCostBytes()

size_t xgboost::SparsePage::MemCostBytes | ( |  | ) | const
| inline

Returns
  estimation of memory cost of this page

## ◆ Push() [1/2]

template<typename AdapterBatchT >

uint64_t xgboost::SparsePage::Push | ( | const AdapterBatchT & | batch,
|  | float | missing,
|  | int | nthread
| ) |  |

Pushes external data batch onto this page.

Template Parameters

  AdapterBatchT |

Parameters

  batch |
  missing |
  nthread |

Returns
  The maximum number of columns encountered in this input batch. Useful when pushing many adapter batches to work out the total number of columns.

## ◆ Push() [2/2]

void xgboost::SparsePage::Push | ( | const SparsePage & | batch | ) |

Push a sparse page.

Parameters

  batch | the row page

## ◆ PushCSC()

void xgboost::SparsePage::PushCSC | ( | const SparsePage & | batch | ) |

Push a SparsePage stored in CSC format.

Parameters

  batch | The row batch to be pushed

## ◆ SetBaseRowId()

void xgboost::SparsePage::SetBaseRowId | ( | size_t | row_id | ) |
| inline

Set the base row id for this page.

## ◆ Size()

size_t xgboost::SparsePage::Size | ( |  | ) | const
| inline

Returns
  Number of instances in the page.

## ◆ SortIndices()

void xgboost::SparsePage::SortIndices | ( | int32_t | n_threads | ) |

Sort the column index.

## ◆ SortRows()

void xgboost::SparsePage::SortRows | ( | int32_t | n_threads | ) |

## Member Data Documentation

## ◆ base_rowid

size_t xgboost::SparsePage::base_rowid {0}

## ◆ data

HostDeviceVector<Entry> xgboost::SparsePage::data

the data of the segments

## ◆ offset

HostDeviceVector<bst_row_t> xgboost::SparsePage::offset

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

- /home/runner/work/xgboost/xgboost/include/xgboost/data.h