我一直在使用 WEKA 做一些文本分类工作,我想试试 R。
问题是我无法将 WEKA 的字符串解析器创建的 String to Vector ARFF 文件加载到 Rattle 中。
查看日志,我得到如下信息:
/Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
: scan() expected 'a real', got '2281}'/
我的 ARFF 数据文件看起来有点像这样:
@relation 'reviewData'
@attribute polarity {0,2}
.....
@attribute $$ numeric
@attribute we numeric
@attribute wer numeric
@attribute win numeric
@attribute work numeric
@data
{0 2,63 1,71 1,100 1,112 1,140 1,186 1,228 1}
{14 1,40 1,48 1,52 1,61 1,146 1}
{2 1,41 1,43 1,57 1,71 1,79 1,106 1,108 1,133 1,146 1,149 1,158 1,201 1}
{0 2,6 1,25 1,29 1,42 1,49 1,69 1,82 1,108 1,116 1,138 1,140 1,155 1}
..../
任何想法如何将其转换为 R 可读格式?
干杯!