I am in the same situation as was presented in this question: I want to save a model pipeline (a ColumnTransformer) in which there are some custom transformers I created, to use it to predict in another file placed in a different folder.
I managed to import the model in the new file through joblib as explained in the question linked above, i.e. creating a file with the custom transformers inside and importing them. However, when I use the predict() method of the uploaded model, I get the following:
NotFittedError: This ColumnTransformer instance is not fitted yet. Call 'fit' with appropriate arguments before using this estimator.
This makes sense since my custom transformers are just taken from a "new file" and therefore are not fitted yet.
However I do not understand which would be the best practice to solve this issue. Is there a better way than refitting the model to the dataset?
I saw that in some answers someone was suggesting to use cloudpickle, could it be an option?