【发布时间】:2016-08-01 04:40:00
【问题描述】:
我想在我的源代码中使用 Weka 来构建 ID3 分类器。它应该接受测试数据集(没有类标签)并附加标签并将其写入一个新文件。这些类标签实际上是如何附加的?这是哪个类和函数?
My train dataset:
@relation data
@attribute GENDER {M,F}
@attribute FAMILY {YES,NO}
@attribute SMOKER {YES,NO}
@attribute PASSIVESMOKER {YES,NO}
@attribute CITY {YES,NO}
@attribute CHEMICALS {YES,NO}
@attribute THERAPY {YES,NO}
@attribute PERSISTENTCOUGH {YES,NO}
@attribute CLASS {LOW,BAVG,AVG,AAVG,HIGH}
@data
M,NO,NO,NO,NO,NO,NO,NO,LOW
M,NO,NO,NO,NO,YES,NO,NO,BAVG
M,NO,NO,NO,YES,YES,YES,YES,AAVG
M,NO,NO,YES,NO,NO,NO,NO,LOW
M,NO,NO,YES,NO,YES,NO,NO,BAVG
.....
.....
Test dataset:
@relation data
@attribute GENDER {M,F}
@attribute FAMILY {YES,NO}
@attribute SMOKER {YES,NO}
@attribute PASSIVESMOKER {YES,NO}
@attribute CITY {YES,NO}
@attribute CHEMICALS {YES,NO}
@attribute THERAPY {YES,NO}
@attribute PERSISTENTCOUGH {YES,NO}
@data
M,NO,NO,NO,NO,NO,NO,NO,?
M,NO,NO,NO,NO,YES,NO,NO,?
M,NO,NO,NO,YES,YES,YES,YES,?
M,NO,NO,YES,NO,NO,NO,NO,?
【问题讨论】:
-
你能分享一下你到目前为止的尝试吗?
标签: machine-learning classification weka decision-tree id3