參考: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. hdu2688 Rotate(树状数组)

    题目链接:pid=2688">点击打开链接 题意描写叙述:对一个长度为2<=n<=3000000的数组,求数组中有序对(i<j而且F[i]<F[j])的数量?其 ...

  2. [UVALive 6661 Equal Sum Sets] (dfs 或 dp)

    题意: 求从不超过 N 的正整数其中选取 K 个不同的数字,组成和为 S 的方法数. 1 <= N <= 20  1 <= K<= 10  1 <= S <= 15 ...

  3. LinkedList 方法知识点

    package test_day_9; import java.util.Iterator; import java.util.LinkedList; public class LinkedListD ...

  4. Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in query at index 189......

    Exception in thread "main" java.lang.IllegalArgumentException: Illegal character in query ...

  5. lightoj--1294--Largest Box(三分)

    Largest Box Time Limit: 2000MS   Memory Limit: 32768KB   64bit IO Format: %lld & %llu Submit Sta ...

  6. [IOI 1998] Polygon

    [题目链接] http://poj.org/problem?id=1179 [算法] 区间DP [代码] #include <algorithm> #include <bitset& ...

  7. USACO 1.5 Number Triangles

    Number Triangles Consider the number triangle shown below. Write a program that calculates the highe ...

  8. c++面向对象程序设计 谭浩强 第三章答案

    2: #include <iostream> using namespace std; class Date {public: Date(int,int,int); Date(int,in ...

  9. electron-vue中使用iview 报错this. is readonly的解决办法

    title: electron-vue中使用iview 报错this. is readonly的解决办法 toc: false date: 2019-02-12 19:33:28 categories ...

  10. Git 学习笔记(一)

    某大牛曾经说过,版本控制的最大好处就是让你可以永远后悔,而 Git 无疑是众多版本控制软件当中的佼佼者,在开源社区更是备受青睐,那么它为何会诞生,和其他的版本控制软件项目又有什么不同?且让我们慢慢来看 ...