Machine learning 在数据挖掘中,如何从决策树生成规则?

Machine learning 在数据挖掘中,如何从决策树生成规则?,machine-learning,classification,weka,decision-tree,Machine Learning,Classification,Weka,Decision Tree,我有从数据集创建决策树的代码。我在weka示例中使用天气数据集。如何从java中的决策树生成规则 数据集:: @relation weather @attribute outlook {sunny, overcast, rainy} @attribute temperature real @attribute humidity real @attribute windy {TRUE, FALSE} @attribute play {yes, no} @data sunny,85,85,FAL

我有从数据集创建决策树的代码。我在weka示例中使用天气数据集。如何从java中的决策树生成规则

数据集::

@relation weather

@attribute outlook {sunny, overcast, rainy}
@attribute temperature real
@attribute humidity real
@attribute windy {TRUE, FALSE}
@attribute play {yes, no}

@data
sunny,85,85,FALSE,no
sunny,80,90,TRUE,no
overcast,83,86,FALSE,yes
rainy,70,96,FALSE,yes
rainy,68,80,FALSE,yes
rainy,65,70,TRUE,no
overcast,64,65,TRUE,yes
sunny,72,95,FALSE,no
sunny,69,70,FALSE,yes
rainy,75,80,FALSE,yes
sunny,75,70,TRUE,yes
overcast,72,90,TRUE,yes
overcast,81,75,FALSE,yes
rainy,71,91,TRUE,no

您可以从树中获取决策规则,方法是跟踪每个叶的路径,并用“and”连接连接点上的条件。也就是说,对于每一片叶子,您都会得到一条规则,告诉您必须满足哪些条件才能到达该叶子

不过,与其训练树,不如直接训练一组决策规则,例如使用
DecisionTable
分类器