我正在尝试为学校项目使用C4.5算法创建决策树。决策树用于Haberman's Survival Data Set,属性信息如下。
Attribute Information:
1. Age of patient at time of operation (numerical)
2. Patient's year of operation (year - 1900, numerical)
3. Number of positive axillary nodes detected (numerical)
4. Survival status (class attribute)
1 = the patient survived 5 years or longer
2 = the patient died within 5 year
并且我们需要实现一个决策树,其中每个叶子必须具有一个不同的结果(这意味着该叶子的熵应为0,但是有六个实例具有相同的属性,但结果不同。
例如:
66,58,0,2
66,58,0,1
[C4.5算法在这种情况下会做什么,我到处搜索但找不到任何信息。
谢谢。
阅读Quinlan,J。R. C4.5:机器学习程序。 Morgan Kaufmann Publishers,1993年。(如果有大学作业,学习C4.5是一个好方法)从我的研究。似乎在第137页上,源代码列出了build.c有一行//* if all case are the same.... or there are not enough case to divide
(如您的问题)它会return Node
这个节点来自Node = Leaf(ClassFreq, BestClass, Cases, Cases-NoBestClass);
ClassFreq存储每个类的数量BestClass存储,即优势类(大多数频率)案例存储那里有多少数据NoBestClass存储多少BestClass数据该叶子函数来自文件
Trees.c
,该叶子函数将返回一个叶子为bestClass (Best class become the leaf)
的节点。
所有这些信息参考Quinlan,J。R. C4.5:机器学习程序。摩根·考夫曼出版社,1993年。
知道这一点的任何人,如果我做错了,请发表评论。谢谢