SparseBatch

public class SparseBatch

2D sparse batch, laid out in CSR (Compressed Sparse Row) layout

Author

Hyunsu Cho

Constructors

SparseBatch

public SparseBatch(float[] data, int[] col_ind, long[] row_ptr, int num_row, int num_col)

Create a sparse batch representing a 2D sparse matrix

Parameters
  • data – nonzero (non-missing) entries

  • col_ind – corresponding column indices, should be of same length as data

  • row_ptr – offsets to define each instance, should be of length [num_row]+1

  • num_row – number of rows (data instances) in the matrix

  • num_row – number of columns (features) in the matrix

Throws
  • TreeliteError

Return

Created sparse batch

Methods

dispose

public synchronized void dispose()

Destructor, to be called when the object is garbage collected

finalize

protected void finalize()

getHandle

public long getHandle()

Get the underlying native handle

Returns

Integer representing memory address