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
相关文章推荐
- Python爬取CSDN博客专家系列——移动开发
- machine learning in coding(python):使用贪心搜索【进行特征选择】
- Python学习——struct模块的pack、unpack示例
- leetcode 日经贴,python code -Different Ways to Add Parentheses
- 《Python基础教程(第2版)》学习笔记(三):
- Python的getattr(),setattr(),delattr(),hasattr()
- sunburnt 学习笔记 (三) 连接python和solr
- 异步等待的 Python 协程
- 异步等待的 Python 协程
- python学习笔记3
- Python补充05 字符串格式化 (%操作符)
- python 详解re模块
- 从错误中学python(2)————字符串转浮点数
- python实现简单爬虫以及正则表达式简述
- Python中subprocess学习
- Python 之 sklearn 实现 PCA 降维
- python 学习点滴
- python 中文异常问题记录
- python 文件中的中文错误,SyntaxError: Non-ASCII character '\xe6' in file
- Python 模块学习:os模块