Best parameters solved by Hyperopt is unsuitable

好久不见. 提交于 2019-12-03 15:58:53

First, you are using sklearn.cross_validation which has been deprecated as of version 0.18. So please update that to sklearn.model_selection.

Now to the main issue, the best from fmin always returns the index for parameters defined using hp.choice.

So in your case, 'kernel':0 means that the first value ('rbf') is selected as best value for kernel.

See this issue which confirms this:

To get the original values from best, use space_eval() function like this:

from hyperopt import space_eval
space_eval(parameter_space_svc, best)

Output:
{'C': 13.271912841932233, 'gamma': 0.0017394328334592358, 'kernel': 'rbf'}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!