Not recognised arff file but not working

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Not recognised arff file but not working

Abdrahman0x
Hi all,

I think it is an old question, but I searched for a solution in this forum
and over the internet but couldnt find. I have an arff file tthat once
opened in weka shows an error message that the file is not recognized. I
tried opening it in Excel and saving as csv file but even it is not working.
The file data is shown below:

@RELATION data
               
@ATTRIBUTE H55933 NUMERIC
@ATTRIBUTE R39465 NUMERIC
@ATTRIBUTE R39465 NUMERIC
@ATTRIBUTE R85482 NUMERIC
@ATTRIBUTE U14973 NUMERIC
@ATTRIBUTE R02593 NUMERIC
@ATTRIBUTE T51496 NUMERIC
@ATTRIBUTE H80240 NUMERIC
@ATTRIBUTE T65938 NUMERIC
@ATTRIBUTE T55131 NUMERIC
@ATTRIBUTE T72863 NUMERIC
@ATTRIBUTE H86060 NUMERIC
@ATTRIBUTE X63432 NUMERIC
@ATTRIBUTE H20709 NUMERIC
@ATTRIBUTE class {Positive,Negative}
@DATA
7,4263.4077,4064.9358,1997.893,5282.325,2169.72,2773.4211,7526.386,4607.6763,2598.06,1522.6462,1300.5988,1181.63,2417.9583,3139.4,2473.2612,1306.9038,1285.6025,1900.3613,3504.2139,2428.0525,5150.0137,3855.84,1806.475,3192.413,872.0143,1135.8239,2365.2424,1567.2363,1643.5575,1582.035,2854.9875,2513.335,930.0712,3166.58,930.3038,2018.355,2065.5945,2065.5945,2065.5945,206

If any one can explain to me or guide me to a tutorial please.

Thank you,
AR



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Not recognised arff file but not working

Peter Reutemann
> I think it is an old question, but I searched for a solution in this forum
> and over the internet but couldnt find. I have an arff file tthat once
> opened in weka shows an error message that the file is not recognized. I
> tried opening it in Excel and saving as csv file but even it is not working.
> The file data is shown below:
>
> @RELATION       data
>
> @ATTRIBUTE      H55933  NUMERIC
> @ATTRIBUTE      R39465  NUMERIC
> @ATTRIBUTE      R39465  NUMERIC
> @ATTRIBUTE      R85482  NUMERIC
> @ATTRIBUTE      U14973  NUMERIC
> @ATTRIBUTE      R02593  NUMERIC
> @ATTRIBUTE      T51496  NUMERIC
> @ATTRIBUTE      H80240  NUMERIC
> @ATTRIBUTE      T65938  NUMERIC
> @ATTRIBUTE      T55131  NUMERIC
> @ATTRIBUTE      T72863  NUMERIC
> @ATTRIBUTE      H86060  NUMERIC
> @ATTRIBUTE      X63432  NUMERIC
> @ATTRIBUTE      H20709  NUMERIC
> @ATTRIBUTE      class   {Positive,Negative}
> @DATA
> 7,4263.4077,4064.9358,1997.893,5282.325,2169.72,2773.4211,7526.386,4607.6763,2598.06,1522.6462,1300.5988,1181.63,2417.9583,3139.4,2473.2612,1306.9038,1285.6025,1900.3613,3504.2139,2428.0525,5150.0137,3855.84,1806.475,3192.413,872.0143,1135.8239,2365.2424,1567.2363,1643.5575,1582.035,2854.9875,2513.335,930.0712,3166.58,930.3038,2018.355,2065.5945,2065.5945,2065.5945,206

I somewhat doubt that this ever worked...

The dataset that is shown contains definitions for 15 attributes (14
numeric, 1 nominal).
The line of data that you provided consists of 41 numeric cells (Weka
uses comma as separator) and not a single categorical value
("Positive" or "Negative").
The dataset definition and data don't match, hence loading results in an error.

> If any one can explain to me or guide me to a tutorial please.

Information about the ARFF format would be available from the Weka
manual that you received with our Weka installation or the wiki:
https://waikato.github.io/weka-wiki/arff/

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Not recognised arff file but not working

Abdrahman0x
Thank you Peter but the data provided in my post is just an example. The
number of attributes and the number of data are the same, and still I cant
open the file in Weka. The file is attached. Can you please check and let me
know.

Thank you,
A.R.

Cancer_Data.arff
<https://weka.8497.n7.nabble.com/file/t6588/Cancer_Data.arff>  



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Not recognised arff file but not working

Peter Reutemann
> Thank you Peter but the data provided in my post is just an example. The
> number of attributes and the number of data are the same, and still I cant
> open the file in Weka. The file is attached. Can you please check and let me
> know.

Your dataset has duplicate attribute names, namely "control" appears
lots of times.
Attribute names have to be unique, otherwise Weka cannot locate an
attribute by its name.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Not recognised arff file but not working

Abdrahman0x
Thank you Peter for the appreciated efforts. I got your point.
One small issue which I am still facing, whenever I try to load this file
into Weka it will show an error because the attributes are not unique. I was
thinking to use the unsupervised instance remove-duplicates method in Weka
for this purpose, but as I told you I couldn't load the file into Weka.

Is there an alternative way to remove the duplicates or to load the file
into weka.

Thank you,
A.R.



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Not recognised arff file but not working

Peter Reutemann-3
On September 13, 2019 7:12:14 PM GMT+12:00, Abdrahman0x <[hidden email]> wrote:

>Thank you Peter for the appreciated efforts. I got your point.
>One small issue which I am still facing, whenever I try to load this
>file
>into Weka it will show an error because the attributes are not unique.
>I was
>thinking to use the unsupervised instance remove-duplicates method in
>Weka
>for this purpose, but as I told you I couldn't load the file into Weka.
>
>Is there an alternative way to remove the duplicates or to load the
>file
>into weka.
>
>Thank you,
>A.R.
>
>
>
>--
>Sent from: https://weka.8497.n7.nabble.com/
>_______________________________________________
>Wekalist mailing list -- [hidden email]
>Send posts to: To unsubscribe send an email to
>[hidden email]
>To subscribe, unsubscribe, etc., visit
>%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>List etiquette:
>http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

You have to fix the file first, before you will be able to load it. Use a text editor, like vim, emacs, notepad++, etc.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Not recognised arff file but not working

Abdrahman0x
Thank you Peter, but if I use any text editor I will be able to remove the
duplicated attributes without the data. As you know the file is big, so how
to remove the attribute with the associated data?

Thank you,
A.R.



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Not recognised arff file but not working

Peter Reutemann-3
On September 14, 2019 1:43:41 AM GMT+12:00, Abdrahman0x <[hidden email]> wrote:

>Thank you Peter, but if I use any text editor I will be able to remove
>the
>duplicated attributes without the data. As you know the file is big, so
>how
>to remove the attribute with the associated data?
>
>Thank you,
>A.R.
>
>
>
>--
>Sent from: https://weka.8497.n7.nabble.com/
>_______________________________________________
>Wekalist mailing list -- [hidden email]
>Send posts to: To unsubscribe send an email to
>[hidden email]
>To subscribe, unsubscribe, etc., visit
>%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>List etiquette:
>http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

You're not supposed to remove the attributes with the text editor, but fix the attribute names, so that you have a valid arff file that you can load and further manipulate.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html