Skip to content

Commit f2a07c7

Browse files
committed
pick up math box plot
1 parent 52a5029 commit f2a07c7

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
author: shellbye
3+
comments: true
4+
date: 2016-04-08 01:27:08+00:00
5+
layout: post
6+
slug: pick_up_math_1_box_plot
7+
title: 重拾数学1-箱线图
8+
categories:
9+
- tech_world
10+
tags:
11+
- math
12+
- Probability and statistics
13+
---
14+
15+
来到[新公司]{:target="_blank"}实习之后,发现我将要做的工作是我一直以来期待的关于机器学习和人工智能的东西,
16+
兴奋至于也终于意识到不得不好好补补自己的数学了,于是打算写一个重拾数学的学习笔记,
17+
尽量做到每天一篇,看看能坚持多久吧。
18+
19+
首先是在[KHanACADEMY]{:target="_blank"}上遇到的第一个问题,就是[box plot]{:target="_blank"},
20+
21+
> The box plot (a.k.a. box and whisker diagram) is a standardized way of displaying the
22+
distribution of data based on the five number summary:
23+
minimum, first quartile, median, third quartile, and maximum.
24+
25+
26+
Box plot中文应该是叫箱线图,主要用来以较少的数据直观的描述数据集的分布情况,其主要用的值有最小值、
27+
中位数、最大值、第一四分位数和第三四分位数等。
28+
29+
举例:
30+
请给出一下有序数列的box plot图,4,5,7,7,7,8,10,11,11,13,13,14.
31+
32+
解:
33+
首先需要找到的五个点以及其对应的寻找方法如下:
34+
1. 最大值:数列中的最大值
35+
2. 最小值:数列中的最小值
36+
3. 中位数:如果数列中数的个数为奇数,则直接取数列长度除以2向上取整的位置所在的数
37+
(如10,20,30,40,50中,数列长度为5,5/2向上取整为3,所以,中位数为位于第三个位置的数30);
38+
如果数列中数的个数为偶数,则取数列长度除以2的位置的数,以及其后面的数,在本例中,即第六和第七位数,
39+
分别为8和10,然后在求二者的平均数,本例中即为9,所以本例中的数列的中位数即为9.
40+
4. 第一四分位数:如果数列中数的个数为奇数,则第一四分位数为去掉中位数之后前面剩余的数所组成的数列的中位数,
41+
如果数列中数的个数为偶数,则第一四分位数为前面一半的数所组成的数列的中位数。
42+
5. 第三四分位数:如果数列中数的个数为奇数,则第三四分位数为去掉中位数之后后面剩余的数所组成的数列的中位数,
43+
如果数列中数的个数为偶数,则第三四分位数为后面一半的数所组成的数列的中位数。
44+
45+
找到以上所需的五个数之后,接下来就是要在数轴上画图的过程了,每个点具体的画法如下所示:
46+
![simple.box.defs](http://www.physics.csbsju.edu/stats/simple.box.defs.gif)
47+
48+
其中的第一四分位数到第三四分位数之间的长方形叫做interquartile range(IQR),IQR内部的线为中位数,
49+
IQR外面一上一下两条短线表示最大与最小值。
50+
51+
本例中最终的作图结果如下图:
52+
![box plot](/assets/box-plot1.png)
53+
54+
55+
56+
参考:
57+
[1.Box Plot: Display of Distribution](http://www.physics.csbsju.edu/stats/box2.html){:target="_blank"}
58+
[2.Box plot - Wikipedia, the free encyclopedia](https://en.wikipedia.org/wiki/Box_plot){:target="_blank"}
59+
[3.BOX PLOT--描述统计的一个简便工具](http://www.gdstats.gov.cn/tjkw/tjyyc/2003/2003/2/0013.htm){:target="_blank"}
60+
61+
62+
[新公司]:http://100tal.com/
63+
[KHanACADEMY]:https://www.khanacademy.org/math/probability
64+
[box plot]:http://www.physics.csbsju.edu/stats/box2.html

assets/box-plot1.png

18.3 KB
Loading

0 commit comments

Comments
 (0)