您的位置:首页 > 编程语言 > Python开发

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

2015-08-11 20:45 776 查看
# 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: