【问题标题】:Weka trees, which one supports STRING attribute?Weka 树,哪一种支持 STRING 属性?
【发布时间】:2016-01-08 14:31:22
【问题描述】:

我正在尝试训练模型。我的数据集是这样的:

@RELATION thesis 
@attribute paragraph  string
@ATTRIBUTE class     {computer,civil engineering,biology} 

@DATA 
'This is related to computer science', computer
'This is science to computer science', computer
'This is related to computer science', computer
'biology data and all about medical', biology
'organs and body data and all about medical', biology
'tissues and diseases data and all about medicine, surgery and tissues', biology
'fighting against diseases data and all about cells and blood', biology

我尝试过 J48、RandomForester 和 ADTREE 树。它们都不支持STRING 属性。

weka.classifiers.trees.ADTree: Cannot handle string attributes!

我们有没有支持 STRING 属性的树???

当我使用class 属性时,我的代码一切正常。

【问题讨论】:

    标签: java weka decision-tree


    【解决方案1】:

    您可以在训练之前运行 StringToNominal 过滤器。您可以在 unsupervised->attribute->StringToNominal

    中找到它

    【讨论】:

    • cli 或 gui,但您也可以在 api 中应用过滤器。 fqcn 是:weka.filters.unsupervised.attribute.StringToNominal
    • 我明白了,我会检查如何在训练时针对属性使用它
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-14
    • 1970-01-01
    • 1970-01-01
    • 2013-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多