Commit 1a4a7281 authored by Guolin Ke's avatar Guolin Ke
Browse files

fix #1318

parent 90ab5144
......@@ -576,9 +576,9 @@ Objective Parameters
Metric Parameters
-----------------
- ``metric``, default=\ ``None``, type=multi-enum
- ``metric``, default=\ ``""``, type=multi-enum
- if ``None``, metric corresponding to specified application will be used
- if ``""``(empty string or not specific), metric corresponding to specified application will be used
- ``l1``, absolute loss, alias=\ ``mean_absolute_error``, ``mae``, ``regression_l1``
......
......@@ -91,7 +91,7 @@ void GetMetricType(const std::unordered_map<std::string, std::string>& params, s
metric_types->shrink_to_fit();
}
// add names of objective function if not providing metric
if (metric_types->empty()) {
if (metric_types->empty() && value.size() == 0) {
if (ConfigBase::GetString(params, "objective", &value)) {
std::transform(value.begin(), value.end(), value.begin(), Common::tolower);
metric_types->push_back(value);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment