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

Method Load

src/data/data.cc:947–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

945} // namespace
946
947DMatrix* DMatrix::Load(const std::string& uri, bool silent, DataSplitMode data_split_mode) {
948 auto dlm_pos = uri.find('#');
949 CHECK(dlm_pos == std::string::npos)
950 << "External memory training with text input has been removed.";
951 std::string fname = uri;
952
953 // legacy handling of binary data loading
954 DMatrix* loaded = TryLoadBinary(fname, silent);
955 if (loaded) {
956 return loaded;
957 }
958
959 int partid = 0, npart = 1;
960
961 static std::once_flag warning_flag;
962 std::call_once(warning_flag,
963 []() { LOG(WARNING) << "Text file input has been deprecated since 3.1"; });
964
965 fname = data::ValidateFileFormat(fname);
966 std::unique_ptr<dmlc::Parser<std::uint32_t>> parser(
967 dmlc::Parser<std::uint32_t>::Create(fname.c_str(), partid, npart, "auto"));
968 data::FileAdapter adapter(parser.get());
969 return DMatrix::Create(&adapter, std::numeric_limits<float>::quiet_NaN(), Context{}.Threads(), "",
970 data_split_mode);
971}
972
973template <typename DataIterHandle, typename DMatrixHandle, typename DataIterResetCallback,
974 typename XGDMatrixCallbackNext>

Callers 8

LoadBinaryMethod · 0.45
LoadModelMethod · 0.45
TestLearnerSerializationFunction · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 5

TryLoadBinaryFunction · 0.85
ValidateFileFormatFunction · 0.85
c_strMethod · 0.80
ThreadsMethod · 0.80
getMethod · 0.45

Tested by 6

TestLearnerSerializationFunction · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36