Skip to content
Snippets Groups Projects
Commit 53e83a44 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Raise an error if y is not None

parent 5ff8b6fa
No related branches found
No related tags found
1 merge request!37Revert "For some reason, the class information is not passed in the sample wrapper"
......@@ -153,6 +153,12 @@ class SampleWrapper(BaseWrapper, TransformerMixin):
return self._samples_transform(samples, "score")
def fit(self, samples, y=None):
if y is not None:
raise TypeError(
"We don't accept `y` in fit arguments because "
"`y` should be part of the sample. To pass `y` "
"to the wrapped estimator, use `fit_extra_arguments`."
)
if is_estimator_stateless(self.estimator):
return self
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment