參考:http://scikit-learn.org/stable/modules/learning_curve.html

estimator's generalization error can be decomposed in terms ofbias, variance and noise. The bias of
an estimator is its average error for different training sets. The variance of
an estimator indicates how sensitive it is to varying training sets. Noise is a property of the data.

首先介绍背景,进而引入本节要讲的内容。背景就是:

针对函数COS(1.5π x),分别使用不同的estimators fit the function:linear regression with polynomial features of degree 1, 4 and 15。结果图例如以下:

图一high bias,图二刚好,图三high variance。但,,,。这并非重点。。

。。。。。。

。。

重点是:对于一维的COS函数。能够通过绘图来辨别bias或variance。但对于高维的样例,不能通过绘图来识别。此时。以下要讲的内容就helpful了。。。

1、Validation curve

为了验证一个模型。我们须要一个scoring function(see Model evaluation: quantifying
the quality of predictions
。翻译文章:http://blog.csdn.net/mmc2015/article/details/47121611)。而为了找到较好的超參数的组合。我们常使用grid search或类似方法 (seeGrid
Search: Searching for estimator parameters
,翻译文章:http://blog.csdn.net/mmc2015/article/details/47100091) ,在grid search过程中,我们希望找到使validation sets最大的score相应的超參数组合。(注意,validation
sets一旦使用,对于模型就是有bias的,所以对于generalization,一定要再选择其它独立的test sets验证。

然而并非重点。

。。

。。

重点是,我们希望能够plot the influence of a single hyperparameter on the training score and the validation score,这样有助于分析estimator是否overfitting、underfitting。。

training score and the validation score都low,说明estimator underfittig;training score high but the validation score low,说明overfitting。training score and the validation score都high,说明效果比較好(上图告诉我们。參数gamma最好选择0.001-0.0001);training score low but the validation
score high,可能性不大。

(事实上该方法不是非常有用,由于模型不仅受一个參数的影响。还会受其它參数的综合影响,还是grid search靠谱;假设仅仅有一个參数。那么该方法比較好。

2、Learning curve

A learning curve
shows the validation and training score of an estimator
for varying numbers of training samples
.

如上图。If both the validation score and the training score converge to a value that is too low with increasing size of the
training set, we will not benefit much from more training data.这时,须要考虑换estimator或者调參数。

如上图,If
the training score is much greater than the validation score for the maximum number of training samples, adding more training samples will most likely increase generalization.这时。须要考虑获取很多其它的samples。

上面几幅图的产生程序參考:

scikit-learn:3.5. Validation curves: plotting scores to evaluate models的更多相关文章

  1. scikit learn 模块 调参 pipeline+girdsearch 数据举例:文档分类 (python代码)

    scikit learn 模块 调参 pipeline+girdsearch 数据举例:文档分类数据集 fetch_20newsgroups #-*- coding: UTF-8 -*- import ...

  2. (原创)(三)机器学习笔记之Scikit Learn的线性回归模型初探

    一.Scikit Learn中使用estimator三部曲 1. 构造estimator 2. 训练模型:fit 3. 利用模型进行预测:predict 二.模型评价 模型训练好后,度量模型拟合效果的 ...

  3. (原创)(四)机器学习笔记之Scikit Learn的Logistic回归初探

    目录 5.3 使用LogisticRegressionCV进行正则化的 Logistic Regression 参数调优 一.Scikit Learn中有关logistics回归函数的介绍 1. 交叉 ...

  4. Scikit Learn: 在python中机器学习

    转自:http://my.oschina.net/u/175377/blog/84420#OSC_h2_23 Scikit Learn: 在python中机器学习 Warning 警告:有些没能理解的 ...

  5. Scikit Learn

    Scikit Learn Scikit-Learn简称sklearn,基于 Python 语言的,简单高效的数据挖掘和数据分析工具,建立在 NumPy,SciPy 和 matplotlib 上.

  6. 深入了解数据校验:Java Bean Validation 2.0(JSR380)

    每篇一句 吾皇一日不退役,尔等都是臣子 相关阅读 [小家Java]深入了解数据校验(Bean Validation):基础类打点(ValidationProvider.ConstraintDescri ...

  7. Java-Class-@I:org.springframework.validation.annotation.Validated

    ylbtech-Java-Class-@I:org.springframework.validation.annotation.Validated 1.返回顶部   2.返回顶部 1. package ...

  8. Query意图分析:记一次完整的机器学习过程(scikit learn library学习笔记)

    所谓学习问题,是指观察由n个样本组成的集合,并根据这些数据来预测未知数据的性质. 学习任务(一个二分类问题): 区分一个普通的互联网检索Query是否具有某个垂直领域的意图.假设现在有一个O2O领域的 ...

  9. Spring Boot奇怪的问题:The Bean Validation API is on the classpath but no implementation could be found

    注意:此方法不能解决在项目上用了Hibernate Validator的问题. 错误如下: *************************** APPLICATION FAILED TO STAR ...

随机推荐

  1. Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not access

    准备使用Java进行图片压缩的时候,使用 import com.sun.image.codec.jpeg.*; 结果出现错误: Access restriction: The method creat ...

  2. 刚接触Joomla,写一下瞎折腾的初感受~

    我这几天一直在苦苦寻找一款能够长期投靠的CMS产品,要求的是 1)必须支持命名空间 2)必须OOP + MVC分层 3)丰富分文档和使用群体,至少是出名的.免得哪一天他们解散了 4)-- 一開始我把目 ...

  3. 并行编程(1) - sum.msic.Unsafe 一

    相信看过java源代码的同学.对 sum.msic.Unsafe 这个类并不陌生,特别是在java.util.concurrent包有非常多的使用. sum.msic.Unsafe源代码:      ...

  4. 2014.08.04,读书,读书笔记-《Matlab概率与数理统计分析》-第1章 MATLAB的数据基础

    第1章 MATLAB数据基础 虽然一直间或使用MATLAB,但从来没有系统的学习过,现在开始也不晚.先对几个重点或者平时忽略的要点做下笔记. %后的所有文字为注释,多条命令可以放在一行,但要用逗号或分 ...

  5. IT关键词,面试知识问与答

    二叉树遍历的三种方式? 遍历是指依次访问⼆叉树中的每个元素.有三种遍历⽅法,分别是前序遍历. 中序遍历和后序遍历.它们是按照访问根节点和⼦节点的先后顺序命名的. • 前序遍历:先访问根节点,然后访问左 ...

  6. 8. String to Integer[M]字符串转整数

    题目 Inplement atoi which converts a string to an integer. The function first discards as many whitesp ...

  7. JVM源码分析之javaagent原理完全解读--转

    原文地址:http://www.infoq.com/cn/articles/javaagent-illustrated 概述 本文重点讲述javaagent的具体实现,因为它面向的是我们Java程序员 ...

  8. PHP魔术方法__call()篇

    当我们调用类中的方法时,如果方法不存在的话.__call会是运行,从而使错误不显示出来 header('Content-type:text/html;charset="utf-8" ...

  9. POJ 1328 Radar Installation 【贪心 区间选点】

    解题思路:给出n个岛屿,n个岛屿的坐标分别为(a1,b1),(a2,b2)-----(an,bn),雷达的覆盖半径为r 求所有的岛屿都被覆盖所需要的最少的雷达数目. 首先将岛屿坐标进行处理,因为雷达的 ...

  10. 数据库常用sql语句积累

    组合一个新表 select p.*,(select value from as_info where key = 'v51_products') as v51_products from AP_POR ...