ELKI CSV解析器问题

时间:2015-07-22 16:28:37

标签: parsing data-mining elki

我已将.arff文件更改为Weka工具中的.csv文件。 但现在我无法在ELKI中使用arffparser作为解析器。

我应该使用什么解析器?默认值为NumberVectorLabelParser。但它给了我一个ArrayIndexOutOfBoundsException:

Running: -verbose -verbose -dbc.in /home/db/lisbet/Datasets/without ids/try 2/calling them .txt using another parser/Lymphography_withoutdupl_norm_1ofn.csv -dbc.parser NumberVectorLabelParser -algorithm outlier.lof.LOF -lof.k 2 -evaluator outlier.OutlierROCCurve -rocauc.positive yes
Task failed
java.lang.ArrayIndexOutOfBoundsException: 47
    at de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser.getTypeInformation(NumberVectorLabelParser.java:337)
    at de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser.buildMeta(NumberVectorLabelParser.java:242)
    at de.lmu.ifi.dbs.elki.datasource.parser.NumberVectorLabelParser.nextEvent(NumberVectorLabelParser.java:211)
    at de.lmu.ifi.dbs.elki.datasource.bundle.MultipleObjectsBundle.fromStream(MultipleObjectsBundle.java:242)
    at de.lmu.ifi.dbs.elki.datasource.parser.AbstractStreamingParser.asMultipleObjectsBundle(AbstractStreamingParser.java:89)
    at de.lmu.ifi.dbs.elki.datasource.InputStreamDatabaseConnection.loadData(InputStreamDatabaseConnection.java:91)
    at de.lmu.ifi.dbs.elki.database.StaticArrayDatabase.initialize(StaticArrayDatabase.java:119)
    at de.lmu.ifi.dbs.elki.workflow.InputStep.getDatabase(InputStep.java:62)
    at de.lmu.ifi.dbs.elki.KDDTask.run(KDDTask.java:108)
    at de.lmu.ifi.dbs.elki.application.KDDCLIApplication.run(KDDCLIApplication.java:60)
    at [...]

我的.csv文件如下所示:

'Lymphatics = deformed','Lymphatics = displaced','Lymphatics = arched','Lymphatics = normal','Block_of_affere = yes','Block_of_affere = no','Bl_of_lymph_c = no','Bl_of_lymph_c = yes','Bl_of_lymph_s = no','Bl_of_lymph_s = yes','By_pass = no','By_pass = yes','Extravasates = yes','Extravasates = no','Regeneration_of = no','Regeneration_of = yes','Early_uptake_in = yes','Early_uptake_in = no','Changes_in_lym = oval','Changes_in_lym = round','Changes_in_lym = bean','Defect_in_node = lacunar','Defect_in_node = lac_central','Defect_in_node = lac_margin','Defect_in_node = no','Changes_in_node = lac_central','Changes_in_node = lacunar','Changes_in_node = no','Changes_in_node = lac_margin','Changes_in_stru = faint','Changes_in_stru = drop_like','Changes_in_stru = stripped','Changes_in_stru = coarse','Changes_in_stru = diluted','Changes_in_stru = grainy','Changes_in_stru = no','Changes_in_stru = reticular','Special_forms = vesicles','Special_forms = no','Special_forms = chalices','Dislocation_of = no','Dislocation_of = yes','Exclusion_of_no = yes','Exclusion_of_no = no',Lym_nodes_dimin,Lym_nodes_enlar,No_of_nodes_in,Outlier
1,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0.333333,0.285714,no
0,1,0,0,1,0,1,0,1,0,1,0,0,1,1,0,1,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0.333333,0.142857,no

有11个解析器可用。但也许这是我的数据,对解析器来说很大。

1 个答案:

答案 0 :(得分:1)

谢谢,这是ELKI CSV解析器中的一个错误。

它不希望类列有标签。

因此,如果您删除第一行的,Outlier部分(或第一行完全删除),则应该正确读取此文件。

我会在这里推出一个更强大的更改(它仍然会丢失标签,因为ELKI目前支持数字列的列标签,但不支持字符串标签列。)