Classification分类
•分类是数据挖掘相关应用中出现的一种基本学习方法。
•分类器执行的主要任务是为新的观察值分配类别标签。
•监督分类方法
–从一组带标签的观察开始。
–预测新观察结果。
Decision Tree
• Each node tests a particular input variable.
• Each branch represents the decision made.
• Classifying a new observation is to traverse this decision tree.
• The depth of a node is the minimum number of steps required to reach the node from root.
• Leaf nodes are at the end of the last branches on the tree, representing class labels.
如果决策是数值,“大于”分支通常都放在右侧,“小于”分支放在左侧。根据变量的性质,其中一个分支可能需要包含“等于”的情况。
内部节点(internal node)是指决策或测试点。每个内部节点对应一个输入变量或属性。顶端的内部节点也叫做根节点(root)。图中的决策树是一个二叉树,其中每个内部节点不会有两个以上的分支。节点的分岔被称为分裂(split。
图中的决策树显示了收入等于或者小于$45,000 的女性和年龄小于或等于 40 岁的男性被分类成会购买产品的人群。在遍历决策树以后,发现女性的年龄与决策无关,而男性的收入与决策无关。
The most informative attribute is identified by– Information gain, calculated based on Entropy.
根节点 P(subscribed=yes)=1−1789/2000=10.55%
熵:用来衡量属性的杂质。
信息增益:用来衡量属性的纯净度
基础熵
Conditional entropy条件熵
Information gain信息增益