| 49 | } |
| 50 | |
| 51 | void 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 | |
| 69 | void ParseMetrics(const std::string& value, std::vector<std::string>* out_metric) { |
| 70 | std::unordered_set<std::string> metric_sets; |