Question

When I imported a CSvfile in Weka, it reads some numeric variable as Nominal Type. I would like to convert them to Numeric but Im not seeing any option in Weka.

I tried to open the .arff file using Notepad and Notepad++. I remove the variables and change it to numeric

example:

@attribute thours {' ',18,4,48,42,56,35,40,30,14,54,24,36,20,77,25,70,0,16,34,60,64,21,32,6,84,23,31,52,28,50,66,45,12,10,33,11,22,98,8,3,65,72,9,26,15,63,5,27,51,39,105,7,2,58,43,90,68,46,44,47,112,49,91,37,1,41,104,78,96,75,74,62,71,76,89,13,38,19,29,59,92,81,55,57,53,67,80,102,100,17}

to @attribute thours numeric

and save the file. when i imprted the fiel again, Im getting an error

"...not recognized as an 'Arff data files' file. reason: numebr expected, read Token ], line 78"

Any help is greatly appreciated. Thanks.

Dixi

Was it helpful?

Solution

I believe the reason for your error is that one or more entries of the variable, "thours", is missing. This is represented in the attribute description as the single quotes. If those values are indeed supposed to be missing, you should change it to the format Weka expects in a ".arff", which is a question mark "?".

This link provides a very detailed description of ".arff" files, and what is expected in them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top