0
Follow
5
View

GridSearchCV for estimating optimal tuning parameter

Haody_Du 注册会员
6 days ago

GridSearchCV's cv_results_ returns a dictionary. Therefore you can't access it via index. For example:

svc = svm.SVC()
grid = GridSearchCV(svc, parameters)
grid.fit(data, target)
print(grid.cv_results_.keys())

Output will be:

['mean_fit_time', 'mean_score_time', 'mean_test_score',...
 'param_C', 'param_kernel', 'params',...
 'rank_test_score', 'split0_test_score',...
 'split2_test_score', ...
 'std_fit_time', 'std_score_time', 'std_test_score']

You can access cv_results_ items like:

grid.cv_results_['params'] ##instead of grid.cv_results_[0].parameters
grid.cv_results_['std_test_score'] ##for test scores
grid.cv_results_['mean_test_score'] ##for mean test scores

About the Author

Question Info

Publish Time
6 days ago
Update Time
6 days ago

Related Question

用Terraform yamlencode修复缩进

这个for循环和正常的for循环有什么不同

Terratest -如何测试一个包含aws秘密管理器秘密的terrform模块

关于逗号表达式在for语句中的应用

@wangeditor插件集成在a-form中

Mapbox for Unity是弃用软件吗?

在C语言中,这两个for循环有什么区别吗?

指针下for循环中的scanf

vuforia 运行彩屏问题请教

是的,验证在formik中不起作用,issubmitted是假的