How to properly pickle sklearn pipeline when using custom transformer
I found a pretty straightforward solution. Assuming you are using Jupyter notebooks for training: Create a .py file where the custom transformer is defined and import it to the Jupyter notebook. This is the file custom_transformer.py from sklearn.pipeline import TransformerMixin class FilterOutBigValuesTransformer(TransformerMixin): def __init__(self): pass def fit(self, X, y=None): self.biggest_value = X.c1.max() return self def … Read more