MCPcopy Create free account
hub / github.com/dmlc/xgboost / XGDMatrixCreateFromDense

Function XGDMatrixCreateFromDense

src/c_api/c_api.cc:537–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535}
536
537XGB_DLL int XGDMatrixCreateFromDense(char const *data, char const *c_json_config,
538 DMatrixHandle *out) {
539 API_BEGIN();
540 xgboost_CHECK_C_ARG_PTR(data);
541 xgboost::data::ArrayAdapter adapter{xgboost::data::ArrayAdapter(StringView{data})};
542 xgboost_CHECK_C_ARG_PTR(c_json_config);
543 auto config = Json::Load(StringView{c_json_config});
544 float missing = GetMissing(config);
545 auto n_threads = OptionalArg<Integer, int64_t>(config, "nthread", 0);
546 auto data_split_mode =
547 static_cast<DataSplitMode>(OptionalArg<Integer, int64_t>(config, "data_split_mode", 0));
548 xgboost_CHECK_C_ARG_PTR(out);
549 *out = new std::shared_ptr<DMatrix>(
550 DMatrix::Create(&adapter, missing, n_threads, "", data_split_mode));
551 API_END();
552}
553
554XGB_DLL int XGDMatrixCreateFromCSC(char const *indptr, char const *indices, char const *data,
555 xgboost::bst_ulong nrow, char const *c_json_config,

Callers 4

MakeSimpleDMatrixForTestFunction · 0.85
TESTFunction · 0.85
mainFunction · 0.85
XGDMatrixCreateFromMat_RFunction · 0.85

Calls 2

ArrayAdapterClass · 0.85
GetMissingFunction · 0.85

Tested by 2

MakeSimpleDMatrixForTestFunction · 0.68
TESTFunction · 0.68