9#include "xgboost/span.h"
11#include "../../src/common/categorical.h"
14inline std::vector<float> OneHotEncodeFeature(std::vector<float> x,
16 std::vector<float> ret(x.size() * num_cat, 0);
17 size_t n_rows = x.size();
18 for (
size_t r = 0; r < n_rows; ++r) {
20 ret.at(num_cat * r + cat) = 1;
namespace of xgboost
Definition base.h:90
int32_t bst_cat_t
Categorical value type.
Definition base.h:99