【正文】
No yes Yes yes Yes yes Yes yes Yes yes Yes student buys_puter no no no no no yes no yes no no no yes no no E(student) = 7/14*I(6, 1)+7/14*I(3,4) = Gain(student) = I ( p, n) E (student) = = 用信息增益計(jì)算進(jìn)行屬性選擇 ? 用 credit_rating進(jìn)行劃分 credit_rating? excellent fair credit_rating buys_puter Fair no Fair yes Fair yes Fair yes Fair no Fair yes Fair yes fair yes credit_rating buys_puter Excellent no Excellent no Excellent yes Excellent yes Excellent yes excellent no E(credit_rating) = 6/14*I(3, 3)+8/14*I(5,3) = Gain(credit_rating) = I ( p, n) E (credit_rating) = =用信息增益計(jì)算進(jìn)行屬性選擇 Gain(age) = Gain(ine) = Gain(student ) = Gain(credit _ rating ) = age? overcast =30 40 30..40 age buys_puter =30 no =30 no =30 no =30 yes =30 yes age buys_puter 31?40 yes 31?40 yes 31?40 yes 31?40 yes age buys_puter 40 yes 40 yes 40 no 40 yes 40 no age ine student credit_rating class:buys_puter =30 high no fair no =30 high no excellent no =30 medium no fair no =30 low yes fair yes =30 medium yes excellent yes age? overcast student? no yes =30 40 no yes yes 30..40 ? 用 student進(jìn)行 再 劃分 age? overcast student? no yes =30 40 yes 30..40 Gain(student) = I ( p, n) E (student) =I(3,2)0 = 2/5*(log2 (2/5)3/5*(log2 (3/5)0 =+ = age student buys_puter =30 yes yes =30 yes yes age student buys_puter =30 no no =30 no no =30 no no E(student) = 3/5*I(0, 3)+2/5*I(2,0) =3/5*(0/3*log2(0/3)3/3*log2(0/3)) + 2/5*(2/2*log2(2/2)0/2*log2(0/2)) =0 ? 用 credit_rating進(jìn)行 再 劃分 age? overcast credit_rating? excellent fair =30 40 yes 30..40 age credit_rating buys_puter =30 excellent no =30 excellent yes age credit_rating buys_puter =30 fair no =30 fair no =30 fair yes E(credit_rating) = 2/5*I(1, 1)+3/5*I(1,2) =2/5*(1/2*log2(1/2)1/2*log2(1/2)) + 3/5*(1/3*log2(1/3)2/3*log2(2/3)) =+= Gain(credit_rating) = I ( p, n) E (credit_rating) =I(3,2)0 = 2/5*(log2 (2/5)3/5*(log2 (3/5) =+ == 最終劃分結(jié)果 age? overcast student? credit rating? no yes fair excellent =30 40 no no