开始学习
书封面:见图1目录:见图2
第1章 机器学习简介
第2章 管理和理解数据
第3章 使用近邻算法分类
第4章 使用贝叶斯分类
第5章 使用决策树分类
第6章 回归方法
第7章 神经网络和支持向量机
第8章 使用关联规
第9章 k-means聚类
第10章 模型评估
第11章 模型改进
第12章 机器学习相关的论
我老了一看到英文就晕了 这也太高难了 亦宁 发表于 2017-4-13 14:45 static/image/common/back.gif
我老了一看到英文就晕了
都是为了工作,混口饭吃不容易http://www.bbsls.net//mobcent//app/data/phiz/default/61.png
莞尔 发表于 2017-4-13 14:52 static/image/common/back.gif
这也太高难了
立个贴,自我表下决心http://www.bbsls.net//mobcent//app/data/phiz/default/56.png
cloudtone 发表于 2017-4-13 14:56
都是为了工作,混口饭吃不容易
看你英文学的超好,这些都能看懂啊! 我看不懂,等孩子初中我就辅导不了 了http://www.bbsls.net//mobcent//app/data/phiz/default/20.png
头晕眼花
Exploring and understanding data(考察和理解数据)
Exploring the structure of data(考察数据结构)If you are fortunate, your source will provide a datadictionary, which is a document that describes the dataset's features. In our case, theused car data does not come with this documentation, so we'll need to create one onour own.(如果运气好的话,数据源会自带一个文档描述数据集的特性,如果没有的话,就需要我们自己去创建)
The str() function provides a method to display the structure of R data structuressuch as data frames, vectors, or lists. It can be used to create the basic outline for ourdata dictionary:(str函数能帮助我们显示出数据结构,如图1) Exploring numeric variables(考察数字变量)
To investigate the numeric variables in the used car data, we will employ a comm**et of measurements to describe values known as summary statistics. The summary()function displays several common summary statistics. Let's take a look at a singlefeature, year:(使用summary函数取得一组统计量,如图2 图3)
Measuring the central tendency – mean and median(测量中心趋势---平均数和中位数)
mean函数和median函数(图4)
Measuring spread – quartiles and theve-numbersummary(四分位数和五数概括法)
五数:Minimum(最小值) First quartile or Q1(第一四分位数) Median(中位数) Third quartile or Q3(第三四分位数)Maximum(最大值)The span between the minimum and maximum value is known as the range. In R,the range() function returns both the minimum and maximum value. Combiningrange() with the diff() difference function allows you to examine the range ofdata with a single line of code:(range函数返回最大值和最小值 diff函数返回两个数之间的差值)
Quartiles are a special case of a type of statistics called quantiles, which are numbersthat divide data into equally sized quantities. In addition to quartiles, commonlyused quantiles include tertiles (three parts), quintiles ( ve parts), deciles (10 parts),and percentiles (100 parts).(分位数就是将数据集划分为等大小的 不同部分,如将数据集分为5份、10份、100份)
The middle 50 percent of data between therst and third quartiles is of particularinterest because it in itself is a simple measure of spread. The difference between Q1and Q3 is known as the Interquartile Range (IQR), and it can be calculated with theIQR() function:(IQR函数返回Q3和Q1之间的差值)
The quantile() function provides a robust tool to identify quantiles for a set ofvalues. By default, the quantile() function returns theve-number summary.(quantile函数返回指定位数的分数集,默认是5分位数)
Visualizing numeric variables – boxplots(数字变量的可视化) (图5 6 7)
图中从下到上依次为Q1, Q2 (the median), and Q3
Visualizing numeric variables – histograms (数字变量的可视化--柱状图) (图8 9 10)
Measuring spread – variance and standarddeviation(测量分布趋势方差和标准差) (图11)
Exploring categorical variables(考察分类变量)
In contrast to numeric data, categorical data is typically examined using tables ratherthan summary statistics. A table that presents a single categorical variable is knownas a one-way table. The table() function can be used to generate one-way tables forour used car data: (与数字数据使用summary函数不同,分类数据使用table函数,见图1)The table() output lists the categories of the nominal variable and a count of thenumber of values falling into this category. Since we know that there are 150 usedcars in the dataset, we can determine that roughly one-third of all the cars weremanufactured in the year 2010, given that 49/150 = 0.327. (table函数输出分类列表和每个分类变量对应的值。数据集中包含150个样本的车子。其中49辆产于2010年,使用49除以150就等于0.327)
R can also perform the calculation of table proporti** directly, by using theprop.table() command on a table produced by the table() function: (在R中我们也可以使用prop.table函数直接计算表格属性 图2)
The results of prop.table() can be combined with other R functi** to transformthe output. Suppose that we would like to display the results in percentages witha single decimal place. We can do this by multiplying the proporti** by 100,
then using the round() function while specifying digits = 1, (将输出结果转换成我们想要的格式 图3)
Measuring the central tendency – the mode(使用众数测量中心趋势)
In statistics terms, the mode of a feature is the value occurring most often. Like themean and median, the mode is another measure of central tendency. It is often usedfor categorical data, since the mean and median are not de ned for nominal variables. (在统计学中,众数(mode)指一组数据中出现次数最多的数据值。在分类数据中经常使用,数字数据使用比较多的是平均数和中位数)a variable with a single mode is unimodal, while avariable with two modes is bimodal. Data having multiple modes is more generallycalled multimodal.(单峰、双峰、多峰)
Exploring relati**hips between variables (考察变量之间的关系)
Visualizing relati**hips – scatterplots (变量关系的可视化 图1 2)
大赞 实在是看不懂啊 The k-NNalgorithm(k-NN算法)
尽管k-NN是最简单的机器学习算法,但是仍然被广泛使用
图1是k-NN算的的优缺点
例子:
现在我们根据脆度和甜度将一些样本分为水果、蔬菜、和蛋白质三类 并将它们爱坐标系中表示出了 如图2、3
从图4中我们可以看出相同种类的 在坐标系中距离是靠近的
现在我们的任务是确定 西红柿属于哪一类如图5
计算距离的方式有很多种,传统的k-NN算法使用的是欧几里得距离。使用k-NN算法时,关键是k的选择。需要在拟合和过度拟合之间平衡也就是所谓的方差均衡。如果k的取值过大,可以减少噪音数据产生的影响或者偏差,但是可能使学习者偏离从而忽略小的但是特别重要的模式。
现在我们假定两个极端情况:
1)假定选择一个最大数值的k,即所有的训练集的数量。那么这个模型预测的总是多数类而不是最近邻类
2)假定选择一个最小数值的k,即k=1,如果某些样本被错误的标记了。那么任何未被标记的样本将预测为不正确的类。
现在可以看出最佳k的取值就是在这两个极端情况之间。
在实际应用中,k值的选择取决于不同的学习模型和训练样本的数量。一个普遍的做法是首先选择k的值为训练集样本总数的平方根.例如 如果训练集有15个,我们就将k的值设定为4.
但是这种做法也不是总是最好的。另外一个做法就k取不同的值 去测试测试集,并选择分类结果最好的
页:
[1]
2