我有以下学习渠道:
Pipeline(memory=None,
steps=[('feature_processor', DataProcessor()),
('classifier', GridSearchCV(cv=15,
error_score='raise-deprecating',
estimator=XGBClassifier(base_score=0.5,
booster='gbtree',
colsample_bylevel=1,
colsample_bynode=1,
colsample_bytree=1,
gamma=0, learning_rate=0.1,
max_delta_step=0,..._dispatch='2*n_jobs',
refit=True,
return_train_score='warn',
scoring='accuracy', verbose=1))
])
里面有一个经过训练的模型,使用GridSearchCV
对参数进行了优化。模型及其管道被保存到pickle中。我正在使用pickle.load()
读回它,但现在我不知道如何访问GridSearchCV
找到的最佳参数
有人能给我指出正确的方向吗
如果无法通过管道的信息访问此信息,是否有其他方法来执行此操作
事先非常感谢
试试这个:
从您的示例中,您可以通过以下方式获得最佳模型:
编辑:
仅适用于最佳参数:
相关问题 更多 >
编程相关推荐