Premature end of line error

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Premature end of line error

Ally
Hello everyone!
I'm new to Weka and I have to use it for a University project. So, I created a .csv file and when I try to upload it to Weka, it says: "not recognised as a CSV data file. Reason: 1 problem encountered on line 2".
Then, if I open the .csv file with Notepad and then save as .arff file, when I try to open it again with Weka, in this case I get another error message: "not recognised as an arff data file. Reason: premature end of line, read Token[EOL], line 8".
Please help, I don't know much about working with Weka and really don't know what could be the problem, even though I did a lot of research about this problem.

This is the file: https://app.box.com/s/adfpf1zatgpl5mo20u5hdd1gnqihnq40

@Relation "PIB_Rata inflatiei"
       
@Attribute "PIB" NUMERIC
@Attribute "Rata_inflatiei" NUMERIC

@Data
30624.3,20780.9,27980.4,31920.3,37657.0,37168.3,35838.9,41978.0,36183.4,37439.0,40717.1,46174.0,59867.6,76217.6,99699.2,123533.7,171540.2,208185.1,167421.6,167998.1,185362.3,171664.6,191548.1,199325.9,177956.0
128.0,211.2,255.2,136.8,32.2,38.8,154.8,59.1,45.8,45.7,34.5,22.5,15.3,11.3,9.0,6.6,4.8,7.8,5.6,6.1,5.8,3.3,4.0,1.1,-0.6
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Premature end of line error

Peter Reutemann
> I'm new to Weka and I have to use it for a University project. So, I created
> a .csv file and when I try to upload it to Weka, it says: "not recognised as
> a CSV data file. Reason: 1 problem encountered on line 2".
> Then, if I open the .csv file with Notepad and then save as .arff file, when
> I try to open it again with Weka, in this case I get another error message:
> "not recognised as an arff data file. Reason: premature end of line, read
> Token[EOL], line 8".
> Please help, I don't know much about working with Weka and really don't know
> what could be the problem, even though I did a lot of research about this
> problem.
>
> This is the file: https://app.box.com/s/adfpf1zatgpl5mo20u5hdd1gnqihnq40
>
> @Relation "PIB_Rata inflatiei"
>
> @Attribute "PIB"                NUMERIC
> @Attribute "Rata_inflatiei"     NUMERIC
>
> @Data
> 30624.3,20780.9,27980.4,31920.3,37657.0,37168.3,35838.9,41978.0,36183.4,37439.0,40717.1,46174.0,59867.6,76217.6,99699.2,123533.7,171540.2,208185.1,167421.6,167998.1,185362.3,171664.6,191548.1,199325.9,177956.0
> 128.0,211.2,255.2,136.8,32.2,38.8,154.8,59.1,45.8,45.7,34.5,22.5,15.3,11.3,9.0,6.6,4.8,7.8,5.6,6.1,5.8,3.3,4.0,1.1,-0.6

You're defining only two attributes (PIB, Rata_inflatiei), but your
data has lot more columns than that.

When importing a CSV file, make sure that each column has a header, no
empty rows.

If you want to use ARFF instead, read up on the ARFF format here:
http://weka.wikispaces.com/ARFF+%28stable+version%29

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
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Premature end of line error

Ally
Ooh, I actually put the data values on rows, not on columns...such a stupid mistake I made, haha. Thank you so much for your help, it works now!
Loading...