from sklearn.externals import joblib joblib.dump(grid.best_estimator_, 'filename.pkl')
如果要将对象转储到一个文件中 - 请使用:
joblib.dump(grid.best_estimator_, 'filename.pkl', compress = 1)