Support numpy array interface (#6998)

This commit is contained in:
Jiaming Yuan
2021-05-27 16:08:22 +08:00
committed by GitHub
parent ab6fd304c4
commit 4cf95a6041
6 changed files with 59 additions and 38 deletions

View File

@@ -130,6 +130,22 @@ XGB_DLL int XGDMatrixCreateFromCSR(char const *indptr,
char const* json_config,
DMatrixHandle* out);
/*!
* \brief Create a matrix from dense array.
* \param data JSON encoded __array_interface__ to array values.
* \param json_config JSON encoded configuration. Required values are:
*
* - missing
* - nthread
*
* \param out created dmatrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromArray(char const *data,
char const *json_config,
DMatrixHandle *out);
/*!
* \brief create a matrix content from CSC format
* \param col_ptr pointer to col headers