added XGDMatrixNumCol_R function
This commit is contained in:
parent
605c23e0dc
commit
1d504d6c6c
@ -195,6 +195,14 @@ SEXP XGDMatrixNumRow_R(SEXP handle) {
|
|||||||
return ScalarInteger(static_cast<int>(nrow));
|
return ScalarInteger(static_cast<int>(nrow));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SEXP XGDMatrixNumCol_R(SEXP handle) {
|
||||||
|
bst_ulong ncol;
|
||||||
|
R_API_BEGIN();
|
||||||
|
CHECK_CALL(XGDMatrixNumCol(R_ExternalPtrAddr(handle), &ncol));
|
||||||
|
R_API_END();
|
||||||
|
return ScalarInteger(static_cast<int>(ncol));
|
||||||
|
}
|
||||||
|
|
||||||
// functions related to booster
|
// functions related to booster
|
||||||
void _BoosterFinalizer(SEXP ext) {
|
void _BoosterFinalizer(SEXP ext) {
|
||||||
if (R_ExternalPtrAddr(ext) == NULL) return;
|
if (R_ExternalPtrAddr(ext) == NULL) return;
|
||||||
|
|||||||
@ -83,10 +83,16 @@ XGB_DLL SEXP XGDMatrixGetInfo_R(SEXP handle, SEXP field);
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief return number of rows
|
* \brief return number of rows
|
||||||
* \param handle a instance of data matrix
|
* \param handle an instance of data matrix
|
||||||
*/
|
*/
|
||||||
XGB_DLL SEXP XGDMatrixNumRow_R(SEXP handle);
|
XGB_DLL SEXP XGDMatrixNumRow_R(SEXP handle);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief return number of columns
|
||||||
|
* \param handle an instance of data matrix
|
||||||
|
*/
|
||||||
|
XGB_DLL SEXP XGDMatrixNumCol_R(SEXP handle);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief create xgboost learner
|
* \brief create xgboost learner
|
||||||
* \param dmats a list of dmatrix handles that will be cached
|
* \param dmats a list of dmatrix handles that will be cached
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user