我有一个scikit-learn pipline和kerasRegressor:
estimators = [
('standardize', StandardScaler()),
('mlp', KerasRegressor(build_fn=baseline_model, nb_epoch=5, batch_size=1000, verbose=1))
]
pipeline = Pipeline(estimators)
在训练了pipline之后,我尝试使用joblib保存到磁盘。。。在
^{pr2}$但我得到一个错误:
RuntimeError: maximum recursion depth exceeded
如何将管道保存到磁盘?在
我与同样的问题做斗争,因为没有直接的方法来做到这一点。这是一个对我有用的方法。我把我的管道保存到两个文件中。第一个文件存储了sklearn管道的pickle对象,第二个文件用于存储Keras模型:
下面是如何将模型加载回:
^{pr2}$相关问题 更多 >
编程相关推荐