[R] Accept CSR data for predictions (#7615)

This commit is contained in:
david-cortes
2022-01-29 18:54:57 +02:00
committed by GitHub
parent 549bd419bb
commit 7f738e7f6f
8 changed files with 93 additions and 7 deletions

View File

@@ -65,6 +65,18 @@ XGB_DLL SEXP XGDMatrixCreateFromMat_R(SEXP mat,
XGB_DLL SEXP XGDMatrixCreateFromCSC_R(SEXP indptr, SEXP indices, SEXP data, SEXP num_row,
SEXP n_threads);
/*!
* \brief create a matrix content from CSR format
* \param indptr pointer to row headers
* \param indices column indices
* \param data content of the data
* \param num_col numer of columns (when it's set to 0, then guess from data)
* \param n_threads Number of threads used to construct DMatrix from csr matrix.
* \return created dmatrix
*/
XGB_DLL SEXP XGDMatrixCreateFromCSR_R(SEXP indptr, SEXP indices, SEXP data, SEXP num_col,
SEXP n_threads);
/*!
* \brief create a new dmatrix from sliced content of existing matrix
* \param handle instance of data matrix to be sliced