我正在尝试用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,1C4.5算法在这种情况下会做什么,我到处都找过了,但找不到任何信息。
谢谢。
发布于 2020-01-24 03:53:00
阅读Quinlan,J.R.C4.5:机器学习程序。摩根·考夫曼出版社,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)的节点。
所有这些信息参考昆兰,J.R.C4.5:机器学习程序。摩根·考夫曼出版社,1993年。
任何知道这一点的人,如果我做错了什么,请发表评论。谢谢
https://stackoverflow.com/questions/43010933
复制相似问题