Sklearn How to Save a Model Created From a Pipeline and GridSearchCV Using Joblib or Pickle?

前端 未结 1 776
臣服心动
臣服心动 2021-01-31 16:12

After identifying the best parameters using a pipeline and GridSearchCV, how do I pickle/joblib this process to re-use later?

相关标签:
1条回答
  • 2021-01-31 16:47
    from sklearn.externals import joblib
    joblib.dump(grid.best_estimator_, 'filename.pkl')
    

    If you want to dump your object into one file - use:

    joblib.dump(grid.best_estimator_, 'filename.pkl', compress = 1)
    
    0 讨论(0)
提交回复
热议问题