treelite
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
DMatrix Struct Reference

a simple data matrix in CSR (Compressed Sparse Row) storage More...

#include <data.h>

Public Member Functions

void Clear ()
 clear all data fields
 

Static Public Member Functions

static DMatrixCreate (const char *filename, const char *format, int nthread, int verbose)
 construct a new DMatrix from a file More...
 
static DMatrixCreate (dmlc::Parser< uint32_t > *parser, int nthread, int verbose)
 construct a new DMatrix from a data parser. The data parser here refers to any iterable object that streams input data in small batches. More...
 

Public Attributes

std::vector< float > data
 feature values
 
std::vector< uint32_t > col_ind
 feature indices
 
std::vector< size_t > row_ptr
 pointer to row headers; length of [num_row] + 1
 
size_t num_row
 number of rows
 
size_t num_col
 number of columns
 
size_t nelem
 number of nonzero entries
 

Detailed Description

a simple data matrix in CSR (Compressed Sparse Row) storage

Definition at line 16 of file data.h.

Member Function Documentation

◆ Create() [1/2]

DMatrix * Create ( const char *  filename,
const char *  format,
int  nthread,
int  verbose 
)
static

construct a new DMatrix from a file

Parameters
filenamename of file
formatformat of file (libsvm/libfm/csv)
nthreadnumber of threads to use
verbosewhether to produce extra messages
Returns
newly built DMatrix

Definition at line 17 of file data.cc.

◆ Create() [2/2]

DMatrix * Create ( dmlc::Parser< uint32_t > *  parser,
int  nthread,
int  verbose 
)
static

construct a new DMatrix from a data parser. The data parser here refers to any iterable object that streams input data in small batches.

Parameters
parserpointer to data parser
nthreadnumber of threads to use
verbosewhether to produce extra messages
Returns
newly built DMatrix

Definition at line 25 of file data.cc.


The documentation for this struct was generated from the following files: