File feature_matrix_csr.hpp

Functions

std::unique_ptr<ICsrFeatureMatrix> createCsrFeatureMatrix(const float32 *values, uint32 *indices, uint32 *indptr, uint32 numRows, uint32 numCols, float32 sparseValue = 0.0f)

Creates and returns a new object of the type ICsrFeatureMatrix.

Parameters:
  • values – A pointer to an array of type float32, shape (numNonZeroValues), that stores all non-zero values

  • indices – A pointer to an array of type uint32, shape (numNonZeroValues), that stores the column-indices, the values in values correspond to

  • indptr – A pointer to an array of type uint32, shape (numRows + 1), that stores the indices of first element in values and indices that corresponds to a certain row. The index at the last position is equal to numNonZeroValues

  • numRows – The number of rows in the feature matrix

  • numCols – The number of columns in the feature matrix

  • sparseValue – The value that should be used for sparse elements in the feature matrix

Returns:

An unique pointer to an object of type ICsrFeatureMatrix that has been created

class ICsrFeatureMatrix : public IRowWiseFeatureMatrix
#include <feature_matrix_csr.hpp>

Defines an interface for all feature matrices that provide row-wise access to the feature values of examples that are stored in a sparse matrix in the compressed sparse row (CSR) format.

Public Functions

inline virtual ~ICsrFeatureMatrix() override