add cross validation

This commit is contained in:
tqchen
2014-09-05 22:34:32 -07:00
parent bc1817ca2f
commit 0ecd6c08f3
5 changed files with 66 additions and 10 deletions

View File

@@ -174,6 +174,10 @@ extern "C" {
_WrapperEnd();
return ret;
}
SEXP XGDMatrixNumRow_R(SEXP handle) {
bst_ulong nrow = XGDMatrixNumRow(R_ExternalPtrAddr(handle));
return ScalarInteger(static_cast<int>(nrow));
}
// functions related to booster
void _BoosterFinalizer(SEXP ext) {
if (R_ExternalPtrAddr(ext) == NULL) return;

View File

@@ -65,6 +65,11 @@ extern "C" {
* \return info vector
*/
SEXP XGDMatrixGetInfo_R(SEXP handle, SEXP field);
/*!
* \brief return number of rows
* \param handle a instance of data matrix
*/
SEXP XGDMatrixNumRow_R(SEXP handle);
/*!
* \brief create xgboost learner
* \param dmats a list of dmatrix handles that will be cached