且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在sklearn中保存自定义转换器?

更新时间:2023-10-13 22:31:28

sklearn.preprocessing.StandardScaler 之所以有效,是因为类定义在 sklearn 包安装中可用,joblib 加载泡菜时会查找.

sklearn.preprocessing.StandardScaler works because the class definition is available in the sklearn package installation, which joblib will look up when you load the pickle.

您必须通过重新定义或导入来使您的 CustomTransformer 类在新会话中可用.

You'll have to make your CustomTransformer class available in the new session, either by re-defining or importing it.