Fixes for multiple and default metric (#1239)
* fix multiple evaluation metrics * create DefaultEvalMetric only when really necessary * py test for #1239 * make travis happy
This commit is contained in:
committed by
Tianqi Chen
parent
9ef86072f4
commit
9a48a40cf1
@@ -33,7 +33,10 @@ class Booster {
|
||||
|
||||
inline void SetParam(const std::string& name, const std::string& val) {
|
||||
auto it = std::find_if(cfg_.begin(), cfg_.end(),
|
||||
[&name](decltype(*cfg_.begin()) &x) {
|
||||
[&name, &val](decltype(*cfg_.begin()) &x) {
|
||||
if (name == "eval_metric") {
|
||||
return x.first == name && x.second == val;
|
||||
}
|
||||
return x.first == name;
|
||||
});
|
||||
if (it == cfg_.end()) {
|
||||
|
||||
Reference in New Issue
Block a user