码迷,mamicode.com
首页 > 编程语言 > 详细

machine learning in coding(python):使用交叉验证【选择模型超参数】

时间:2015-08-11 21:28:54      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:机器学习   machine learning   超参数选择   交叉验证   



# Hyperparameter selection loop
score_hist = []
Cvals = [0.001, 0.003, 0.006, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.1]
for C in Cvals:
    model.C = C
    score = cv_loop(Xt, y, model, N)
    score_hist.append((score,C))
    print "C: %f Mean AUC: %f" %(C, score)
bestC = sorted(score_hist)[-1][1]
print "Best C value: %f" % (bestC)



from kaggle

版权声明:本文为博主原创文章,未经博主允许不得转载。

machine learning in coding(python):使用交叉验证【选择模型超参数】

标签:机器学习   machine learning   超参数选择   交叉验证   

原文地址:http://blog.csdn.net/mmc2015/article/details/47426753

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!