Decision tree and the ID3 algorithm

In data mining there are four main problems, clustering, classifying, regression and dimension reduce, to be discussed. And this issue is mainly about Decision Tree in classification. For some data that we’ve known, calculate the decision tree, and use the tree to deal with new points, telling which group the new, coming points belong to.

         For one decision tree, each node is one decision and its leaves are the final decisions. Taking the following graph as an example:

Figure1

To solve the problem that split the dataset randomly making the decision tree too high, Figure2 e.g., we use the ID3 algorithm to split the dataset into subsets having an information entropy as small as possible.

Figure2

Among all the possible splits, ID3 pick the one that maximize the entropy gain.

Examples:

  1. 8bits strings:

dataset1 {11110000, 10101010, 11000011}

dataset2 {00000000, 11111111}

For every element in dataset1 the entropy is:

                            E(S1) =-(4/8)*log(4/8)-(1-4/8)*log(1-4/8)= 1

For every element in dataset2 the entropy is:

                            E(S2) =-(8/8)*log(8/8)= 0

  2. 8 points, 2 of them are red and 6 of them are blue. Split the dataset by line x=2

                            When classify the data above, the decision tree can be like this:

 

References:

http://www.marmakoide.org/download/teaching/dm/dm-decision-trees.pdf

More information about decision tree demo using ID3 algorithm.

 

转载于:https://www.cnblogs.com/sunshinewill/archive/2013/03/27/2985734.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值