Skip to content

Commit

Permalink
fix #1318
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Apr 17, 2018
1 parent 90ab514 commit 1a4a728
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/Parameters.rst
Expand Up @@ -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``

Expand Down
2 changes: 1 addition & 1 deletion src/io/config.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 1a4a728

Please sign in to comment.