【问题标题】:weka not represent all the attributesweka 不代表所有属性
【发布时间】:2017-09-04 12:53:33
【问题描述】:

我创建了一个 arff 文件,然后在 Weka 中打开了该文件。 Weka 将文件作为一个属性读取,而我有十个属性。谁能帮我解决这个问题? 代码和Weka结果如下所示

@Relation  Dentition_Records
@attribute  N            NUMERIC 
@attribute  Animal       String
@attribute  I            NUMERIC
@attribute  i            NUMERIC
@attribute  C            NUMERIC
@attribute  c            NUMERIC
@attribute  P            NUMERIC
@attribute  p            NUMERIC
@attribute  M            NUMERIC
@attribute  m            NUMERIC

@Data
1;Opossum;5;4;1;1;3;3;4;4
2;Hairy tail mole;3;3;1;1;4;4;3;3
3;Common mole;3;2;1;0;3;3;3;3
4;Star nose mole;3;3;1;1;4;4;3;3
5;Brawn bat;2;3;1;1;3;3;3;3
6;Sliver hair bat;2;3;1;1;2;3;3;3
7;Pigmy bat;2;3;1;1;2;2;3;3
8;House bat;2;3;1;1;1;2;3;3
9;Red bat;1;3;1;1;2;2;3;3
10;Hoary bat;1;3;1;1;2;2;3;3
11;Lump nose bat;2;3;1;1;2;3;3;8
12;Armadillo;0;0;0;0;0;0;3;3
13;Pika;2;1;0;0;2;2;3;3
14;Snowshoe rabbit;2;1;0;0;3;2;3;3
15;Beaver;1;1;0;0;2;1;3;3
16;Marmot;1;1;0;0;2;1;3;3
17;Groundhog;1;1;0;0;2;1;3;3
18;Prairie Dog;1;1;0;0;2;1;3;3
19;Ground Squirrel;1;1;0;0;2;1;3;3
20;Chipmunk;1;1;0;0;2;1;3;3
21;Gray swuirrel;1;1;0;0;2;1;3;3
22;Fox squirrel;1;1;0;0;1;1;3;3
23;Pocket gopher;1;1;0;0;1;1;3;3
24;Kangaroo rat;1;1;0;0;1;1;3;3
25;Pack rat;1;1;0;0;0;0;3;3
26;Field mouse;1;1;0;0;0;0;3;3
27;Muskrat;1;1;0;0;0;0;3;3
28;Black rat;1;1;0;0;0;0;3;3
29;House mouse;1;1;0;0;0;0;3;3
30;Porcupine;1;1;0;0;1;1;3;3
31;Guinea pig;1;1;0;0;1;1;3;3
32;Coyote;1;1;1;1;4;4;3;3
33;Wolf;3;3;1;1;4;4;2;3
34;Fox ;3;3;1;1;4;4;2;3
35;Bear;3;3;1;1;4;4;2;3
36;Civet cat;3;3;1;1;4;4;2;2
37;Raccon;3;3;1;1;4;4;3;2
38;Marten;3;3;1;1;4;4;1;2
39;Ficher;3;3;1;1;4;4;1;2
40;Weasel;3;3;1;1;3;3;1;2
41;Mink;3;3;1;1;3;3;1;2
42;Ferrer;3;3;1;1;3;3;1;2
43;Wolverine;3;3;1;1;4;4;1;2
44;Badger;3;3;1;1;3;3;1;2
45;Skunk;3;3;1;1;3;3;1;2
46;River otter;3;3;1;1;4;3;1;2
47;Sea otter;3;2;1;1;3;3;1;2
48;Jaguar;3;3;1;1;3;2;1;1
49;Ocelot;3;3;1;1;3;2;1;1
50;Cougar;3;3;1;1;3;2;1;1
51;Lynx;3;3;1;1;3;2;1;1
52;Fur seal;3;2;1;1;4;4;1;1
53;Sea Lion;3;2;1;1;4;4;1;1
54;Walrus;1;0;1;1;3;3;0;0
55;Grey seal;3;2;1;1;3;3;2;2
56;Elephant seal;2;1;1;1;4;4;1;1
57;Peccary;2;3;1;1;3;3;3;3
58;ELK;0;4;1;0;3;3;3;3
59;Deer;0;4;0;0;3;3;3;3
60;Moose;0;4;0;0;3;3;3;3
61;Reindeer;0;4;1;0;3;3;3;3
62;Antelope;0;4;0;0;3;3;3;3
63;Bison;0;4;0;0;3;3;3;3
64;Mountain goat ;0;4;0;0;3;3;3;3
65;Musk ox;0;4;0;0;3;3;3;3
66;Mountain sheep;0;4;0;0;3;3;3;3

【问题讨论】:

    标签: weka


    【解决方案1】:

    用逗号, 替换所有分号;' 包围所有字符串,您的文件就可以正常工作了。

    例子:

    @Relation  Dentition_Records
    
    @attribute  N            NUMERIC 
    @attribute  Animal       String
    @attribute  I            NUMERIC
    @attribute  i            NUMERIC
    @attribute  C            NUMERIC
    @attribute  c            NUMERIC
    @attribute  P            NUMERIC
    @attribute  p            NUMERIC
    @attribute  M            NUMERIC
    @attribute  m            NUMERIC
    
    @Data
    1,Opossum,5,4,1,1,3,3,4,4
    4,'Star nose mole',3,3,1,1,4,4,3,3
    

    【讨论】:

    • 不客气!如果对您有帮助,请随时接受答案!
    猜你喜欢
    • 2019-01-24
    • 2014-05-26
    • 2011-08-16
    • 1970-01-01
    • 2016-04-01
    • 2012-12-28
    • 2017-10-12
    • 2012-09-08
    • 2015-09-03
    相关资源
    最近更新 更多