Skip to content

Commit

Permalink
Rename misspelled config parameter for pseudo-Huber (#7904)
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed May 15, 2022
1 parent 1baad86 commit 4cd14ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion doc/model.schema
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
}
}
},
"pseduo_huber_param": {
"pseudo_huber_param": {
"type": "object",
"properties": {
"huber_slope": {
Expand Down
4 changes: 2 additions & 2 deletions src/metric/elementwise_metric.cu
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ class PseudoErrorLoss : public Metric {
public:
const char* Name() const override { return "mphe"; }
void Configure(Args const& args) override { param_.UpdateAllowUnknown(args); }
void LoadConfig(Json const& in) override { FromJson(in["pseduo_huber_param"], &param_); }
void LoadConfig(Json const& in) override { FromJson(in["pseudo_huber_param"], &param_); }
void SaveConfig(Json* p_out) const override {
auto& out = *p_out;
out["name"] = String(this->Name());
out["pseduo_huber_param"] = ToJson(param_);
out["pseudo_huber_param"] = ToJson(param_);
}

double Eval(const HostDeviceVector<bst_float>& preds, const MetaInfo& info,
Expand Down
6 changes: 3 additions & 3 deletions src/objective/regression_obj.cu
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,16 @@ class PseudoHuberRegression : public ObjFunction {
void SaveConfig(Json* p_out) const override {
auto& out = *p_out;
out["name"] = String("reg:pseudohubererror");
out["pseduo_huber_param"] = ToJson(param_);
out["pseudo_huber_param"] = ToJson(param_);
}

void LoadConfig(Json const& in) override {
auto const& config = get<Object const>(in);
if (config.find("pseduo_huber_param") == config.cend()) {
if (config.find("pseudo_huber_param") == config.cend()) {
// The parameter is added in 1.6.
return;
}
FromJson(in["pseduo_huber_param"], &param_);
FromJson(in["pseudo_huber_param"], &param_);
}
};

Expand Down

0 comments on commit 4cd14ae

Please sign in to comment.