| 995 | } |
| 996 | |
| 997 | inline std::string ParseMetricAlias(const std::string& type) { |
| 998 | if (type == std::string("regression") || type == std::string("regression_l2") || type == std::string("l2") || type == std::string("mean_squared_error") || type == std::string("mse")) { |
| 999 | return "l2"; |
| 1000 | } else if (type == std::string("l2_root") || type == std::string("root_mean_squared_error") || type == std::string("rmse")) { |
| 1001 | return "rmse"; |
| 1002 | } else if (type == std::string("regression_l1") || type == std::string("l1") || type == std::string("mean_absolute_error") || type == std::string("mae")) { |
| 1003 | return "l1"; |
| 1004 | } else if (type == std::string("binary_logloss") || type == std::string("binary")) { |
| 1005 | return "binary_logloss"; |
| 1006 | } else if (type == std::string("ndcg") || type == std::string("lambdarank")) { |
| 1007 | return "ndcg"; |
| 1008 | } else if (type == std::string("map") || type == std::string("mean_average_precision")) { |
| 1009 | return "map"; |
| 1010 | } else if (type == std::string("multi_logloss") || type == std::string("multiclass") || type == std::string("softmax") || type == std::string("multiclassova") || type == std::string("multiclass_ova") || type == std::string("ova") || type == std::string("ovr")) { |
| 1011 | return "multi_logloss"; |
| 1012 | } else if (type == std::string("xentropy") || type == std::string("cross_entropy")) { |
| 1013 | return "cross_entropy"; |
| 1014 | } else if (type == std::string("xentlambda") || type == std::string("cross_entropy_lambda")) { |
| 1015 | return "cross_entropy_lambda"; |
| 1016 | } else if (type == std::string("kldiv") || type == std::string("kullback_leibler")) { |
| 1017 | return "kullback_leibler"; |
| 1018 | } else if (type == std::string("mean_absolute_percentage_error") || type == std::string("mape")) { |
| 1019 | return "mape"; |
| 1020 | } else if (type == std::string("none") || type == std::string("null") || type == std::string("custom") || type == std::string("na")) { |
| 1021 | return "custom"; |
| 1022 | } |
| 1023 | return type; |
| 1024 | } |
| 1025 | |
| 1026 | } // namespace LightGBM |
| 1027 | |