2015-10-10 63 views
1

我正在訓練模型。我的數據集是這樣的:Weka樹,哪一個支持STRING屬性?

@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屬性時,我的代碼工作正常。

回答

0

您可以在訓練之前運行StringToNominal過濾器。你發現它在無監督 - >屬性 - > StringToNominal

+0

我正在使用java API ...這是命令行權? –

+1

cli或gui,但您也可以在api中應用過濾器。 fqcn是:weka.filters.unsupervised.attribute.StringToNominal – Napster2202

+0

我明白了,我將檢查如何在培訓時使用它來對抗屬性 –