MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / GetTaskType

Function GetTaskType

python-package/compile/src/io/config.cpp:105–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void GetTaskType(const std::unordered_map<std::string, std::string>& params, TaskType* task) {
106 std::string value;
107 if (Config::GetString(params, "task", &value)) {
108 std::transform(value.begin(), value.end(), value.begin(), Common::tolower);
109 if (value == std::string("train") || value == std::string("training")) {
110 *task = TaskType::kTrain;
111 } else if (value == std::string("predict") || value == std::string("prediction")
112 || value == std::string("test")) {
113 *task = TaskType::kPredict;
114 } else if (value == std::string("convert_model")) {
115 *task = TaskType::kConvertModel;
116 } else if (value == std::string("refit") || value == std::string("refit_tree")) {
117 *task = TaskType::KRefitTree;
118 } else {
119 Log::Fatal("Unknown task type %s", value.c_str());
120 }
121 }
122}
123
124void GetDeviceType(const std::unordered_map<std::string, std::string>& params, std::string* device_type) {
125 std::string value;

Callers 1

SetMethod · 0.70

Calls 3

transformFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected