ENH: allow python to handle feature names
This commit is contained in:
@@ -435,6 +435,7 @@ int XGDMatrixGetUIntInfo(const DMatrixHandle handle,
|
||||
*out_dptr = BeginPtr(vec);
|
||||
API_END();
|
||||
}
|
||||
|
||||
int XGDMatrixNumRow(const DMatrixHandle handle,
|
||||
bst_ulong *out) {
|
||||
API_BEGIN();
|
||||
@@ -442,6 +443,13 @@ int XGDMatrixNumRow(const DMatrixHandle handle,
|
||||
API_END();
|
||||
}
|
||||
|
||||
int XGDMatrixNumCol(const DMatrixHandle handle,
|
||||
bst_ulong *out) {
|
||||
API_BEGIN();
|
||||
*out = static_cast<size_t>(static_cast<const DataMatrix*>(handle)->info.num_col());
|
||||
API_END();
|
||||
}
|
||||
|
||||
// xgboost implementation
|
||||
int XGBoosterCreate(DMatrixHandle dmats[],
|
||||
bst_ulong len,
|
||||
|
||||
@@ -184,6 +184,13 @@ XGB_DLL int XGDMatrixGetUIntInfo(const DMatrixHandle handle,
|
||||
*/
|
||||
XGB_DLL int XGDMatrixNumRow(DMatrixHandle handle,
|
||||
bst_ulong *out);
|
||||
/*!
|
||||
* \brief get number of columns
|
||||
* \param handle the handle to the DMatrix
|
||||
* \return 0 when success, -1 when failure happens
|
||||
*/
|
||||
XGB_DLL int XGDMatrixNumCol(DMatrixHandle handle,
|
||||
bst_ulong *out);
|
||||
// --- start XGBoost class
|
||||
/*!
|
||||
* \brief create xgboost learner
|
||||
|
||||
Reference in New Issue
Block a user