How to save a custom transformer in sklearn?
问题 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 definition of the custom transformer is missing from the current python session. Suppose in one python session, I define, create and save a custom transformer, it can also be loaded in the same session: from sklearn.base import TransformerMixin from sklearn.base import BaseEstimator from sklearn.externals import joblib class CustomTransformer