fippy/loco-missing-set-y-train
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| fippy | error | none, edit by hand | All versions |
fippy.Explainer.loco() and restriction="refit" refit the reduced model on (self.X_train[keep], self._y_train) and raise AttributeError if explainer.set_y_train(y_train) has not been called first.
explainer = fippy.Explainer(model.predict, X_train, loss=fippy.losses.absolute_error)explainer.set_y_train(y_train)res = explainer.loco(X_val, y_val, learner=est)What the rule reports
Section titled “What the rule reports”Calls to .loco(...) or .loo/.shapley(..., "refit", ...) on an Explainer created in the same block without a preceding .set_y_train(...) call.
How to fix it
Section titled “How to fix it”Call explainer.set_y_train(y_train) with the training target before invoking .loco(...) or restriction="refit".
Diagnostic message
Section titled “Diagnostic message”fippy LOCO and restriction='refit' read self._y_train and raise AttributeError unless explainer.set_y_train(y_train) was called first. Call explainer.set_y_train(y_train) before loco() or refit().See all rules in the fippy pack.