[BUG]: Not fitted error in the inspector after fitting in some situations (edge case)
Closed this issue · 3 comments
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
It can happen that a sklearn pipline reports its not fitted if the last step has no fit params and no extra method for this. This can lead to an error in the PipelineInspector which checks whether the pipeline is fitted.
Expected Behavior
Maybe one can give a better error or provide extra function.
But I mostly just want to report an edge case.
Steps To Reproduce
Create a sklearn estimator model without any info about fitted params etc e.g."
class MockRegressorReturnsIndex(BaseEstimator):
def fit(self, X, y=None, **fit_params):
return self
def predict(self, X):
return X.index
Environment
Newest branch of the julearn_sk_pandas branche
Relevant log output
No response
Anything else?
No response
But what would be a real scenario of an estimator that does not have any fit params?
It is an edge case for sure, but the real world example would be a transformer that shuffles the features on transform. It does not really fit anything.
This has low prio and I think solutions would be easy to do for an individual creating such a transformer (e.g. one could just set a self.fit_).
Therefore, I am also fine with closing the issue and just note that we do not support this. Just wanted to document that I saw behavior I did not expect.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.