0
votes

I have a problem in Weka library.I am trying to convert txt file to .arff file.But I got some error.My txt file like below:

Atlanta.txt


0000000 Tanner's    100 253 250 178 174 063 059 036 008 074 204 052 163
0000001 Frijoleros  250 062 132 174 063 197 071 142 234 243 075 204 052 162
0000002 Indian Delights 253 250 150 174 083 059 036 117 243 076 205 051 162
0000003 Great Wall  253 191 192 174 036 039 075 204 052 163
0000004 The Brickery    100 253 086 231 250 191 192 059 036 215 005 008 075 205 052 163
0000005 Lawrence's Cafe 250 191 192 174 063 197 071 057 036 140 143 075 204 052 163
0000006 Harold's Barbecue   253 174 010 221 036 017 076 205 051 162
0000007 Zab-E-Lee   011 174 235 076 208 051 164
0000008 The Dessert Place   100 086 150 174 036 042 061 076 204 053 162
0000009 Cafe Diem   250 196 174 063 197 005 042 061 068 074 204 053 162
0000010 El Charro   100 253 250 191 192 174 001 142 234 075 204 051 162
0000011 Kurt's at River Manor   253 231 191 192 174 063 248 036 098 076 205 054 165
0000012 Peggy Sue's Diner   100 253 086 250 191 192 174 063 036 042 061 074 204 053 163
0000013 Pars    253 250 174 071 059 057 036 143 075 205 053 164
0000014 Le Rendez-Vous  253 231 250 200 191 192 174 059 036 091 076 205 053 164
0000015 Rockbridge Diner    253 231 136 191 192 059 045 076 206 053 164
0000016 Chefs' Grill    100 080 253 231 102 191 192 174 083 036 024 025 005 076 206 053    165
0000017 Jonathan Lee's  253 231 245 191 192 174 059 036 039 235 075 205 052 163
0000018 The Country Place   253 099 231 250 062 132 191 192 174 071 083 024 215 005 076 206 054 165
0000019 Hama's  253 250 245 174 128 075 205 052 164
0000020 Raja Indian Restaurant  250 191 192 174 197 036 117 075 205 051 164
0000021 PRICCI  080 253 250 245 189 102 174 114 024 215 121 076 206 054 166
0000022 Pittypat's Porch    100 253 099 250 191 192 174 071 221 083 024 220 217 074 204 052 165
0000023 Houston's   026 253 086 250 174 063 215 005 008 107 076 206 053 164
0000024 Azio    253 086 231 250 102 063 114 248 215 121 182 075 205 053 164
0000026 ABRUZZI RISTORANTE  253 099 200 245 196 189 191 192 174 146 097 036 024 123 076 206 053 167
0000027 Rio Bravo Cantina   100 253 086 250 191 192 174 063 215 138 142 234 075 205 053 163
0000028 Savannah Fish Company   250 191 192 174 040 025 212 075 205 053 165
0000029 Lombardi's  253 231 250 174 024 121 075 205 053 164
0000030 Johnny Rockets  026 100 086 250 174 063 008 107 075 205 053 162
0000031 Opus    099 150 200 196 191 192 174 063 040 071 024 025 005 243 076 206 054 167
0000032 La Paz  100 253 250 191 192 174 063 197 083 036 215 025 142 234 222 076 205 053 163

I need to attribute value as Restaurant Id,Restaurant Name,Cuisine,Price,Style,Atmosphere and Occasion(Restaurant Features).But as you can see,number of columns and number of attributes don't exactly match each other.How can i delete some noise data and how can i group all of these features in this situation.I am planning to make a .arff file like that:

Atlanta.arff


@RELATION 'Atlanta'

@ATTRIBUTE Restaurant Id NUMERIC
@ATTRIBUTE Restaurant Name String
@ATTRIBUTE Restaurant Features NUMERIC

    @DATA


0000000 Tanner's    {100 253 250 178 174 063 059 036 008 074 204 052 163}
0000001 Frijoleros  {250 062 132 174 063 197 071 142 234 243 075 204 052 162}
0000002 Indian Delights {253 250 150 174 083 059 036 117 243 076 205 051 162}
0000003 Great Wall  {253 191 192 174 036 039 075 204 052 163}
0000004 The Brickery    {100 253 086 231 250 191 192 059 036 215 005 008 075 205 052 163}
0000005 Lawrence's Cafe {250 191 192 174 063 197 071 057 036 140 143 075 204 052 163}
0000006 Harold's Barbecue   {253 174 010 221 036 017 076 205 051 162}
0000007 Zab-E-Lee   {011 174 235 076 208 051 164}
0000008 The Dessert Place   {100 086 150 174 036 042 061 076 204 053 162}
0000009 Cafe Diem   {250 196 174 063 197 005 042 061 068 074 204 053 162}
0000010 El Charro   {100 253 250 191 192 174 001 142 234 075 204 051 162}
0000011 Kurt's at River Manor   {253 231 191 192 174 063 248 036 098 076 205 054 165}
0000012 Peggy Sue's Diner   {100 253 086 250 191 192 174 063 036 042 061 074 204 053 163}
0000013 Pars    {253 250 174 071 059 057 036 143 075 205 053 164}
0000014 Le Rendez-Vous  {253 231 250 200 191 192 174 059 036 091 076 205 053 164}
0000015 Rockbridge Diner    {253 231 136 191 192 059 045 076 206 053 164}
0000016 Chefs' Grill    {100 080 253 231 102 191 192 174 083 036 024 025 005 076 206 053 165}
0000017 Jonathan Lee's  {253 231 245 191 192 174 059 036 039 235 075 205 052 163}
0000018 The Country Place   {253 099 231 250 062 132 191 192 174 071 083 024 215 005 076 206 054 165}
0000019 Hama's  {253 250 245 174 128 075 205 052 164}
0000020 Raja Indian Restaurant  {250 191 192 174 197 036 117 075 205 051 164}
0000021 PRICCI  {080 253 250 245 189 102 174 114 024 215 121 076 206 054 166}
0000022 Pittypat's Porch    {100 253 099 250 191 192 174 071 221 083 024 220 217 074 204 052 165}
0000023 Houston's   {026 253 086 250 174 063 215 005 008 107 076 206 053 164}
0000024 Azio    {253 086 231 250 102 063 114 248 215 121 182 075 205 053 164}
0000025 Banks   {136 005 045 076 206 054 166}
0000026 ABRUZZI RISTORANTE  {253 099 200 245 196 189 191 192 174 146 097 036 024 123 076 206 053 167}
0000027 Rio Bravo Cantina   {100 253 086 250 191 192 174 063 215 138 142 234 075 205 053 163}
0000028 Savannah Fish Company   {250 191 192 174 040 025 212 075 205 053 165}
0000029 Lombardi's  {253 231 250 174 024 121 075 205 053 164}
0000030 Johnny Rockets  {026 100 086 250 174 063 008 107 075 205 053 162}
0000031 Opus    {099 150 200 196 191 192 174 063 040 071 024 025 005 243 076 206 054 167}
0000032 La Paz  {100 253 250 191 192 174 063 197 083 036 215 025 142 234 222 076 205 053 163}

Thank you for your helping.Happy coding:)

1

1 Answers

0
votes

If you are using the Weka GUI, I would recommend the following:

  1. Open your data file in Excel (import the data as tab separated values)
  2. Add the headers you want, and fill in missing data. Every row must have all column values filled in for Weka to read the data properly.
  3. Save your file as a .csv
  4. Open the Weka GUI, go to Explorer, then Open file, set the format as csv (see image), and open the csv file you just saved.

Screenshot of opening csv file

  1. After you've loaded your data, you can save it to arff using the Save... button.

Screenshot of save