Commit 381bc122 authored by Guolin Ke's avatar Guolin Ke
Browse files

fix #1321

parent e005cdb0
......@@ -340,7 +340,6 @@ void ObjectiveConfig::Set(const std::unordered_map<std::string, std::string>& pa
GetDouble(params, "scale_pos_weight", &scale_pos_weight);
CHECK(scale_pos_weight > 0);
GetDouble(params, "alpha", &alpha);
CHECK(alpha > 0 && alpha < 1);
GetBool(params, "reg_sqrt", &reg_sqrt);
GetDouble(params, "tweedie_variance_power", &tweedie_variance_power);
CHECK(tweedie_variance_power >= 1 && tweedie_variance_power < 2);
......@@ -367,7 +366,6 @@ void MetricConfig::Set(const std::unordered_map<std::string, std::string>& param
GetInt(params, "num_class", &num_class);
CHECK(num_class > 0);
GetDouble(params, "alpha", &alpha);
CHECK(alpha > 0 && alpha < 1);
GetDouble(params, "tweedie_variance_power", &tweedie_variance_power);
CHECK(tweedie_variance_power >= 1 && tweedie_variance_power < 2);
std::string tmp_str = "";
......
......@@ -446,6 +446,7 @@ class RegressionQuantileloss : public RegressionL2loss {
public:
explicit RegressionQuantileloss(const ObjectiveConfig& config): RegressionL2loss(config) {
alpha_ = static_cast<score_t>(config.alpha);
CHECK(alpha_ > 0 && alpha_ < 1);
}
explicit RegressionQuantileloss(const std::vector<std::string>& strs): RegressionL2loss(strs) {
......
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