XGDMatrixSetStrFeatureInfo

Function XGDMatrixSetStrFeatureInfo 

Source
pub unsafe extern "C" fn XGDMatrixSetStrFeatureInfo(
    handle: DMatrixHandle,
    field: *const c_char,
    features: *mut *const c_char,
    size: bst_ulong,
) -> c_int
Expand description

\brief Set string encoded information of all features.

Accepted fields are:

  • feature_name
  • feature_type

\param handle An instance of data matrix \param field Field name \param features Pointer to array of strings. \param size Size of features pointer (number of strings passed in).

\return 0 when success, -1 when failure happens

\code

char const* feat_names [] {“feat_0”, “feat_1”}; XGDMatrixSetStrFeatureInfo(handle, “feature_name”, feat_names, 2);

// i for integer, q for quantitive. Similarly “int” and “float” are also recognized. char const* feat_types [] {“i”, “q”}; XGDMatrixSetStrFeatureInfo(handle, “feature_type”, feat_types, 2);

\endcode