中科院刘莹数据挖掘课程作业2重点.docx

  1. 1、本文档共16页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
HW2 Due Date: Nov. 23 Part I: written assignment 1. a) Compute the Information Gain for Gender, Car Type and Shirt Size. 本题的class有两类;即C0和C1 IC0,C1= I10,10=1 inforgender(D)=1020 I6,4+1020 I4,6 =1020 -610 log2610-410 log2410+1020 -610 log2610-410 log2410=0.971 Gain(gender)= IC0,C1-inforgender(D)=1-0.971=0.029 inforCarType(D)=420 I1,3+820 I8,0+820 I1,7 =420-14 log214-34 log234+820 -18 log218-78 log278=0.3797 Gain(CarType)= IC0,C1-inforgender(D)=1-0.3797=0.6203 inforShirtSize(D)=520 I3,2+720 I3,4+420 I2,2+420 I2,2 =520-35 log235-25 log225+720 -37 log237-47 log247+410 -24 log212-24 log212=0.9876 Gain(shirtSize)= IC0,C1-inforgender(D)=1-0.9876=0.0124 b) Construct a decision tree with Information Gain. ① 由a知,CarType的information Gain最大,故本题应该选择CarType作为首要分裂属性。 CarType的类别有Luxury family Sport(因全部属于C0类,此类无需再划分) ② 对Luxury进一步划分: IC0,C1= I1,7=0.5436 inforgender(D)=18 I1,0+78 I1,6=0+78 -17 log217-67 log267=0.5177 Gain(gender)= IC0,C1-inforgender(D)=0.5436-0.5177=0.0259 inforShirtSize(D)=28 I0,2+38 I0,3+28 I1,1+18 I0,2=0.25 Gain(shirtSize)= IC0,C1-inforgender(D)=0.5436-0.25=0.2936 故此处选择ShirtSize进行属性分裂。 ③ 对family进一步划分: IC0,C1= I1,3=0.811 Gain(gender)= IC0,C1-inforgender(D)=0.811- I1,3=0 Gain(shirtSize)= IC0,C1-inforgender(D) =0.811- 14 I1,0- 14 I0,1- 14 I0,1- 14 I0,1=0.811 故此处选择ShirtSize进行属性分裂。 ④ 根据以上的计算可得本题的决策数如下: 2. (a) Design a multilayer feed-forward neural network (one hidden layer) for the data set in Q1. Label the nodes in the input and output layers. 根据数据的属性特点易知输入层有8个节点,分别为: x1 Gender ( Gender = M: x1 = 1; Gender = F: x1 = 0 ) x2 Car Type = Sports ( Y = 1; N = 0) x3 Car Type = Family( Y = 1; N = 0) x4 Car Type = Luxury ( Y = 1; N = 0) x5 Shirt Size = Small ( Y = 1; N = 0) x6 Shirt Size = Medium ( Y = 1; N = 0) x7 Shirt Size = Large ( Y = 1; N = 0) x8 Shirt Size = Extra Large ( Y = 1; N = 0) 隐藏层有三个节点x9、x10和x11. 输出为二类问题, 因此只有1个节点x12(C0=1;C2=0). 神经网络图如下:(其中Wij表示输入层第i个节点到隐藏层第j个节点所付权重,为方便计算,第i个节点到第9/10/11个节点的权重设置一样;Wi-j则表示隐藏层第i个节点到输出层节点所赋予的权重 ) c) Using the neural ne

文档评论(0)

shuwkb + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档