| 136 | } |
| 137 | |
| 138 | void GetTreeLearnerType(const std::unordered_map<std::string, std::string>& params, std::string* tree_learner) { |
| 139 | std::string value; |
| 140 | if (Config::GetString(params, "tree_learner", &value)) { |
| 141 | std::transform(value.begin(), value.end(), value.begin(), Common::tolower); |
| 142 | if (value == std::string("serial")) { |
| 143 | *tree_learner = "serial"; |
| 144 | } else if (value == std::string("serial2")) { |
| 145 | *tree_learner = "serial2"; |
| 146 | } else if (value == std::string("feature") || value == std::string("feature_parallel")) { |
| 147 | *tree_learner = "feature"; |
| 148 | } else if (value == std::string("data") || value == std::string("data_parallel")) { |
| 149 | *tree_learner = "data"; |
| 150 | } else if (value == std::string("voting") || value == std::string("voting_parallel")) { |
| 151 | *tree_learner = "voting"; |
| 152 | } else { |
| 153 | Log::Fatal("Unknown tree learner type %s", value.c_str()); |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | void Config::Set(const std::unordered_map<std::string, std::string>& params) { |
| 159 | // generate seeds by seed. |