J48 使用 WEKA 输出决策树节点
J48 Output decision tree node using WEKA
我正在尝试从心脏病学中了解 WEKA J48 决策树-weka.arff。
我有 运行 输出如下,
Test mode:10-fold cross-validation
=== Classifier model (full training set) ===
J48 pruned tree
------------------
thal = Rev
| chest-pain-type = Asymptomatic: Sick (79.0/7.0)
| chest-pain-type = AbnormalAngina
| | #colored-vessels = 0
| | | peak <= 0.1: Healthy (4.0)
| | | peak > 0.1: Sick (3.0/1.0)
| | #colored-vessels = 1: Sick (2.0)
| | #colored-vessels = 2: Healthy (0.0)
| | #colored-vessels = 3: Healthy (0.0)
| chest-pain-type = Angina
| | cholesterol <= 229: Healthy (3.0)
| | cholesterol > 229
| | | age <= 48: Sick (2.0)
| | | age > 48: Healthy (3.0/1.0)
| chest-pain-type = NoTang
| | slope = Flat
| | | #colored-vessels = 0
| | | | blood-pressure <= 122: Healthy (3.0)
| | | | blood-pressure > 122: Sick (3.0)
| | | #colored-vessels = 1: Sick (5.0)
| | | #colored-vessels = 2: Sick (0.0)
| | | #colored-vessels = 3: Sick (3.0/1.0)
| | slope = Up: Healthy (7.0/1.0)
| | slope = Down: Healthy (1.0)
thal = Normal
| #colored-vessels = 0: Healthy (118.0/12.0)
| #colored-vessels = 1
| | sex = Male
| | | chest-pain-type = Asymptomatic: Sick (9.0)
| | | chest-pain-type = AbnormalAngina: Sick (2.0/1.0)
| | | chest-pain-type = Angina: Healthy (3.0/1.0)
| | | chest-pain-type = NoTang: Healthy (2.0)
| | sex = Female: Healthy (13.0/1.0)
| #colored-vessels = 2
| | angina = TRUE: Sick (3.0)
| | angina = FALSE
| | | age <= 62
| | | | age <= 53: Healthy (2.0)
| | | | age > 53: Sick (4.0)
| | | age > 62: Healthy (5.0)
| #colored-vessels = 3: Sick (6.0/1.0)
thal = Fix
| #colored-vessels = 0
| | angina = TRUE: Sick (3.0/1.0)
| | angina = FALSE: Healthy (5.0)
| #colored-vessels = 1: Sick (4.0)
| #colored-vessels = 2: Sick (4.0)
| #colored-vessels = 3: Sick (2.0)
Number of Leaves : 32
Size of the tree : 49
Time taken to build model: 0.03 seconds
=== Stratified cross-validation ===
=== Summary ===
Correctly Classified Instances 222 73.2673 %
Incorrectly Classified Instances 81 26.7327 %
Kappa statistic 0.4601
Mean absolute error 0.3067
Root mean squared error 0.4661
Relative absolute error 61.8185 %
Root relative squared error 93.5807 %
Total Number of Instances 303
=== Detailed Accuracy By Class ===
TP Rate FP Rate Precision Recall F-Measure ROC Area Class
0.696 0.236 0.711 0.696 0.703 0.756 Sick
0.764 0.304 0.75 0.764 0.757 0.756 Healthy
Weighted Avg. 0.733 0.273 0.732 0.733 0.732 0.756
=== Confusion Matrix ===
a b <-- classified as
96 42 | a = Sick
39 126 | b = Healthy
问题是
- j48选择了什么属性作为顶层决策树节点?
- 画一个图表显示前两个的属性和值
J48 创建的决策树的级别。
到目前为止,我只能正确class解释混淆矩阵class。任何帮助将不胜感激。
最上面的节点是"thal",它具有三个不同的级别。
您可以使用 "visualize tree" 在 weka 中将树绘制为图表。在模型结果上,左键单击或右键单击显示 "J48 - 20151206 10:33"(或类似内容)的项目。自己尝试或搜索我提供了屏幕截图的答案(关于如何操作)
您可以在 J48 配置对话框中通过 "Pruning" 将树限制为 n 层。
我正在尝试从心脏病学中了解 WEKA J48 决策树-weka.arff。
我有 运行 输出如下,
Test mode:10-fold cross-validation
=== Classifier model (full training set) ===
J48 pruned tree
------------------
thal = Rev
| chest-pain-type = Asymptomatic: Sick (79.0/7.0)
| chest-pain-type = AbnormalAngina
| | #colored-vessels = 0
| | | peak <= 0.1: Healthy (4.0)
| | | peak > 0.1: Sick (3.0/1.0)
| | #colored-vessels = 1: Sick (2.0)
| | #colored-vessels = 2: Healthy (0.0)
| | #colored-vessels = 3: Healthy (0.0)
| chest-pain-type = Angina
| | cholesterol <= 229: Healthy (3.0)
| | cholesterol > 229
| | | age <= 48: Sick (2.0)
| | | age > 48: Healthy (3.0/1.0)
| chest-pain-type = NoTang
| | slope = Flat
| | | #colored-vessels = 0
| | | | blood-pressure <= 122: Healthy (3.0)
| | | | blood-pressure > 122: Sick (3.0)
| | | #colored-vessels = 1: Sick (5.0)
| | | #colored-vessels = 2: Sick (0.0)
| | | #colored-vessels = 3: Sick (3.0/1.0)
| | slope = Up: Healthy (7.0/1.0)
| | slope = Down: Healthy (1.0)
thal = Normal
| #colored-vessels = 0: Healthy (118.0/12.0)
| #colored-vessels = 1
| | sex = Male
| | | chest-pain-type = Asymptomatic: Sick (9.0)
| | | chest-pain-type = AbnormalAngina: Sick (2.0/1.0)
| | | chest-pain-type = Angina: Healthy (3.0/1.0)
| | | chest-pain-type = NoTang: Healthy (2.0)
| | sex = Female: Healthy (13.0/1.0)
| #colored-vessels = 2
| | angina = TRUE: Sick (3.0)
| | angina = FALSE
| | | age <= 62
| | | | age <= 53: Healthy (2.0)
| | | | age > 53: Sick (4.0)
| | | age > 62: Healthy (5.0)
| #colored-vessels = 3: Sick (6.0/1.0)
thal = Fix
| #colored-vessels = 0
| | angina = TRUE: Sick (3.0/1.0)
| | angina = FALSE: Healthy (5.0)
| #colored-vessels = 1: Sick (4.0)
| #colored-vessels = 2: Sick (4.0)
| #colored-vessels = 3: Sick (2.0)
Number of Leaves : 32
Size of the tree : 49
Time taken to build model: 0.03 seconds
=== Stratified cross-validation ===
=== Summary ===
Correctly Classified Instances 222 73.2673 %
Incorrectly Classified Instances 81 26.7327 %
Kappa statistic 0.4601
Mean absolute error 0.3067
Root mean squared error 0.4661
Relative absolute error 61.8185 %
Root relative squared error 93.5807 %
Total Number of Instances 303
=== Detailed Accuracy By Class ===
TP Rate FP Rate Precision Recall F-Measure ROC Area Class
0.696 0.236 0.711 0.696 0.703 0.756 Sick
0.764 0.304 0.75 0.764 0.757 0.756 Healthy
Weighted Avg. 0.733 0.273 0.732 0.733 0.732 0.756
=== Confusion Matrix ===
a b <-- classified as
96 42 | a = Sick
39 126 | b = Healthy
问题是
- j48选择了什么属性作为顶层决策树节点?
- 画一个图表显示前两个的属性和值 J48 创建的决策树的级别。
到目前为止,我只能正确class解释混淆矩阵class。任何帮助将不胜感激。
最上面的节点是"thal",它具有三个不同的级别。
您可以使用 "visualize tree" 在 weka 中将树绘制为图表。在模型结果上,左键单击或右键单击显示 "J48 - 20151206 10:33"(或类似内容)的项目。自己尝试或搜索我提供了屏幕截图的答案(关于如何操作)
您可以在 J48 配置对话框中通过 "Pruning" 将树限制为 n 层。