Custom sklearn pipeline transformer giving "pickle.PicklingError"
The pickle package needs the custom class(es) to be defined in another module and then imported. So, create another python package file (e.g. transformation.py
) and then import it like this from transformation import SelectBestPercFeats
. That will resolve the pickling error.