机器学习第6章作业三

上传人:风*** 文档编号:68216095 上传时间:2022-04-02 格式:DOC 页数:9 大小:388KB
收藏 版权申诉 举报 下载
机器学习第6章作业三_第1页
第1页 / 共9页
机器学习第6章作业三_第2页
第2页 / 共9页
机器学习第6章作业三_第3页
第3页 / 共9页
资源描述:

《机器学习第6章作业三》由会员分享,可在线阅读,更多相关《机器学习第6章作业三(9页珍藏版)》请在装配图网上搜索。

1、精选优质文档-倾情为你奉上1.1 机器学习:人脸识别、手写识别、信用卡审批。 不是机器学习:计算工资,执行查询的数据库,使用WORD。2.1 Since all occurrence of “” for an attribute of the hypothesis results in a hypothesis which does not accept any instance, all these hypotheses are equal to that one where attribute is “”. So the number of hypothesis is 4*3*3*3*3*

2、3 +1 = 973.With the addition attribute Watercurrent, the number of instances = 3*2*2*2*2*2*3 = 288, the number of hypothesis = 4*3*3*3*3*3*4 +1 = 3889.Generally, the number of hypothesis = 4*3*3*3*3*3*(k+1)+1.2.3 Ans.S0= (,) v (,)G0 = (?, ?, ?, ?, ?, ?) v (?, ?, ?, ?, ?, ?)Example 1: S1=(Sunny, Warm

3、, Normal, Strong, Warm, Same) v (,)G1 = (?, ?, ?, ?, ?, ?) v (?, ?, ?, ?, ?, ?)Example 2: S2= (Sunny, Warm, Normal, Strong, Warm, Same) v (Sunny, Warm, High, Strong, Warm, Same),(Sunny, Warm, ?, Strong, Warm, Same) v (,)G2 = (?, ?, ?, ?, ?, ?) v (?, ?, ?, ?, ?, ?)Example 3: S3=(Sunny, Warm, Normal,

4、Strong, Warm, Same) v (Sunny, Warm, High, Strong, Warm, Same),(Sunny, Warm, ?, Strong, Warm, Same) v (,)G3 = (Sunny, ?, ?, ?, ?, ?) v (?, Warm, ?, ?, ?, ?),(Sunny, ?, ?, ?, ?, ?) v (?, ?, ?, ?, ?, Same),(?, Warm, ?, ?, ?, ?) v (?, ?, ?, ?, ?, Same)Example 4: S4= (Sunny, Warm, ?, Strong, ?, ?) v (Sun

5、ny, Warm, High, Strong, Warm, Same),(Sunny, Warm, Normal, Strong, Warm, Same) v (Sunny, Warm, High, Strong, ?, ?),(Sunny, Warm, ?, Strong, ?, ?) v (,),(Sunny, Warm, ?, Strong, Warm, Same) v (Sunny, Warm, High, Strong, Cool, Change)G4 =(Sunny, ?, ?, ?, ?, ?) v (?, Warm, ?, ?, ?, ?),(Sunny, ?, ?, ?, ?

6、, ?) v (?, ?, ?, ?, ?, Same),(?, Warm, ?, ?, ?, ?) v (?, ?, ?, ?, ?, Same)2.4 Ans. (a) S= (4,6,3,5) (b) G=(3,8,2,7) (c) e.g., (7,6), (5,4) (d) 4 points: (3,2,+), (5,9,+),(2,1,-),(6,10,-)2.6 Proof: Every member of VSH,D satisfies the right-hand side of expression.Let h be an arbitrary member of VSH,D

7、, then h is consistent with all training examples in D.Assuming h does not satisfy the right-hand side of the expression, it means (sS)(gG)(g h s) = (sS)(gG) (g h) (h s). Hence, there does not exist g from G so that g is more general or equal to h or there does not exist s from S so that h is more g

8、eneral or equal to s. If the former holds, it leads to an inconsistence according to the definition of G. If the later holds, itleads to an inconsistence according to the definition of S. Therefore, h satisfies the right-hand side ofthe expression. 􀀀 (Notes: since we assume the expression i

9、s not fulfilled, this can be only be if Sor G is empty, which can only be in the case of any inconsistent training examples, such as noiseor the concept target is not member of H.)贝叶斯:6.1 由题意可得,两次对病人做化验测试都为正时,cancer和cancer的后验概率分别可表示为:P(canner|+,+),P(cancer|+,+)。最后一个等号是因为假定两个测试是相互独立的,即:P(+,+|cancer)=

10、P(+|cancer)P(+|cancer)同理可得:P(+|cancer) P(+|cancer) P(cancer)=0.98*0.98*0.008=0.P(+|cancer) P(+|cancer) P(cancer)=0.03*0.03*0.992=0.P(+,+) = P(+,+|cancer) P(cancer) + P(+,+|cancer)P(cancer)=0.+0.=0.所以:P(canner|+,+)0./0.=0.P(cancer|+,+)=0.6.2 由贝叶斯公式可知:因为事件cancer与cancer互斥,且P(cancer)+P(cancer)=1,有全概率公式可

11、得: P(+) = P(+|cancer) P(cancer) + P(+|cancer)P(cancer)故所以中的归一化方法正确。6.3 (a) P(h): 如果假设h1比h2更一般时,赋予P(h1)=P(h2) (b) P(h): 如果假设h1比h2更一般时,赋予P(h1)P(hj) P(D|h)= 6.5 在朴素贝叶斯分类中,在给定目标值V时,属性之间相互独立,其贝叶斯网如下所示,箭头方向为从上到下。因为属性wind与其它属性独立,没有与其相关联的属性。机器学习1在测试一假设h时,发现在一包含n=1000个随机抽取样例的样本s上,它出现r=300个错误。Errors(h)的标准差是什么

12、?将此结果与第5.3.4节末尾的例子中标准差相比会得出什么结论? 由题意知errors(h)=r/n=300/1000=0.3,由于r是二项分布,它的方差为np(1-p),然而p未知,用r/p代替p得出r的估计方差为1000*0.3*(1-0.3)=210,相应的标准差为sqrt(210)=14.5,这表示errors(h)=r/n中的标准差为14.5/1000=0.0145,由此得出以下结论:一般来说,若在n个随机选取的样本中有r个错误,errors(h)的标准差为sqrt(p(1-p)/n),它约等于用r/n= errors(h)来代替p. 2、如果没有更多的信息对真实错误率的评估也就是样

13、本错误率, 则真实错误率的标准差为:17/100=0.17 由95%的置信区间公式: 带入数字得95%的置信区间为:0.17 +(1.96 X 0.04).3.如果假设h在n=65的独立抽取样本上出现r=10个错误,真实的错误率的90%的置信区间(双侧的)是多少?95%单侧置信区间(即一个上界U,使得有95%置信区间errorD(h)U)是多少?90%单侧区间是多少?解:样本数为:n = 65,假设h在n个样本上所犯的错误为r = 10,所以样本错误率为errorS(h) = = = 。于是:errorD(h)的N%的置信区间为: 当N = 90时,查表5-1得:zN = 1.64,可得真实错

14、误率的90%的置信区间为: = 0.160.07395%的单侧置信区间为errorD(h)U,其中90%的单侧置信区间为:errorD(h) U,其中(zN为置信度为80%的置信度时的值1.28)。4.要测试一假设h,其errorD(h)已知在0.2到0.6的范围内,要保证95%双侧置信区间的宽度小于0.1,最小应搜集的样例数是多少?解:若使95%双侧置信区间的宽度小于0.1,则: (其中zN = 1.96),上式中因此最少应搜集的样例数为3015.5 对随即变量 ,为待估参数,服从N(0,1) 分布,均值为d,方差为其中:erorD(h1)-errorD(h2)单侧置信区间下限:d-zNs,+)同理可求单侧置信区间上限:(-,d+ zNs,把s代入即可.5.6 首先,先回顾一下抽样样本的数字特征, 设为总体的一个样本,则:1. 样本均值 2. 样本方差 3. 样本标准差 4. 样本(k阶)原点矩 5. 样本(k阶)中心矩 对于式5.14, S是从整个样本空间上抽取的,因此样本方差 样本均值 式5.14的近似的N%的置信区间为: 而对于式5.17其中,S代表一个大小为且从中均匀抽取的样本。则它的近似的N%的置信区间为: 由于抽取的样本方式不同,因此样本分量之间的独立程度也有很大差别,所以不能式5.14与式5.17的近似的N%的置信区间的估计方法混为一谈。专心-专注-专业

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!