Skip to content

Commit

Permalink
[BUG] in ResidualDouble, fix out-of-sample residual prediction if r…
Browse files Browse the repository at this point in the history
…esidual estimator is default (#70)

This fixes an unreported bug in `ResidualDouble` where `fit` would break
if the default residual estimator is used.

This was due to the non-underscore parameter being referenced instead of
the underscored one.
  • Loading branch information
fkiraly authored Sep 10, 2023
1 parent 349285a commit 721549c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions skpro/regression/residual.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _predict_residuals_cv(self, X, y, cv, est):
y_pred : pandas DataFrame, same length as `X`, same columns as `y` in `fit`
labels predicted for `X`
"""
est = self.estimator_resid
est = self.estimator_resid_
method = "predict"
y_pred = y.copy()

Expand Down Expand Up @@ -382,5 +382,6 @@ def get_test_params(cls, parameter_set="default"):
"distr_params": {"df": 3},
"cv": KFold(n_splits=3),
}
params4 = {"estimator": RandomForestRegressor(), "cv": KFold(n_splits=3)}

return [params1, params2, params3]
return [params1, params2, params3, params4]

0 comments on commit 721549c

Please sign in to comment.