ELKI CSV 解析器问题

ELKI CSV parser problems

我在 Weka 的工具中将 .arff 文件更改为 .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 个解析器可用。但也许是我的数据对解析器来说太大了。

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

没想到class列有标签

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

我将在此处进行更改,使其更加健壮(尽管它仍然会丢失标签,因为 ELKI 目前支持数字列的列标签,但不支持字符串标签列)。