Skip to content

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)

Calls to .loco(...) or .loo/.shapley(..., "refit", ...) on an Explainer created in the same block without a preceding .set_y_train(...) call.

Call explainer.set_y_train(y_train) with the training target before invoking .loco(...) or restriction="refit".

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.