中科院 刘莹 数据挖掘 课程作业2.docxVIP

  • 39
  • 0
  • 约7.13千字
  • 约 16页
  • 2017-02-28 发布于湖北
  • 举报
中科院 刘莹 数据挖掘 课程作业2

HW2Due Date: Nov. 23Part I: written assignment1.Compute the Information Gain for Gender, Car Type and Shirt Size.本题的class有两类;即C0和C1==1(D)=+=+=0.971Gain()=-(D)=1-0.971=0.029(D)=++=+=0.3797Gain()=-(D)=1-0.3797=0.6203(D)=+++=+=0.9876Gain()=-(D)=1-0.9876=0.0124Construct a decision tree with Information Gain.由a知,CarType的information Gain最大,故本题应该选择CarType作为首要分裂属性。CarType的类别有Luxury family Sport(因全部属于C0类,此类无需再划分)对Luxury进一步划分:==0.5436(D)=+=+=0.5177Gain()=-(D)=0.5436-0.5177=0.0259(D)=+++=0.25Gain()=-(D)=0.5436-0.25=0.2936故此处选择ShirtSize进行属性分裂。对family进一步划分:==0.811Gain()=-(D)=0.811-=0Gain()=-(D)=0.811--- - =0.811故此处选择ShirtSize进行属性分裂。根据以上的计算可得本题的决策数如下:(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个节点到输出层节点所赋予的权重 )Using the neural network obtained above, show the weight values after one iteration of the back propagation algorithm, given the training instance “(M, Family, Small). Indicate your initial weight values and biases and the learning rate used.对于 (M, Family, Small), 其类标号为C0, 其训练元祖为{1, 0, 1, 0, 1, 0, 0, 0}.表1初始输入、权重、偏倚值和学习率X1X2X3X4X5X6X7X8W1jW2jW3jW4j101010000.2W5jW6jW7jW8jW9-12W10-12W11-12L---表2净输入和净输出计算单元j净输入Ij净输出Oj91*0.1+1*0.1+1*0.1+0.1=0.41+(1+)=0.51101*0.1+1*0.1+1*0.1++0.1=0.41+(1+)=0.51111*0.1+1*0.1+1*0.1-0.1=0.21+(1+)=0.78120.51*0.1+0.51*0.2-0.78*0.1=0.0751+(1+)=0.92表3每个节点误差的计算单元jErrj120.92*(1-0.92) *(1-0.92)=0.0059110.78*(1-0.78)* 0.0059*(-0.1)=-051*(1-0.51)* 0.0059*(0.2)=0.0002990.51*(1-0.51)*

文档评论(0)

1亿VIP精品文档

相关文档