How to save a custom transformer in sklearn?

后端 未结 2 981
轮回少年
轮回少年 2021-02-19 09:17

I am not able to load an instance of a custom transformer saved using either sklearn.externals.joblib.dump or pickle.dump because the original definiti

2条回答
  •  情话喂你
    2021-02-19 09:56

    It works for me if I pass my transform function in sklearn.preprocessing.FunctionTranformer() and if I save the model using dill.dump() and dill.load a ".pk" file.

    Note: I have included the tranform function into a sklearn pipeline with my classifier.

提交回复
热议问题