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

Function GetBoostingType

src/io/config.cpp:51–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void GetBoostingType(const std::unordered_map<std::string, std::string>& params, std::string* boosting) {
52 std::string value;
53 if (Config::GetString(params, "boosting", &value)) {
54 std::transform(value.begin(), value.end(), value.begin(), Common::tolower);
55 if (value == std::string("gbdt") || value == std::string("gbrt")) {
56 *boosting = "gbdt";
57 } else if (value == std::string("dart")) {
58 *boosting = "dart";
59 } else if (value == std::string("goss")) {
60 *boosting = "goss";
61 } else if (value == std::string("rf") || value == std::string("random_forest")) {
62 *boosting = "rf";
63 } else {
64 Log::Fatal("Unknown boosting type %s", value.c_str());
65 }
66 }
67}
68
69void ParseMetrics(const std::string& value, std::vector<std::string>* out_metric) {
70 std::unordered_set<std::string> metric_sets;

Callers 1

SetMethod · 0.70

Calls 3

transformFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected