Saruchi
Saruchi

Reputation: 31

Attributes names are not unique in Weka 3.8

I am having trouble importing a CSV file. I get the following error: File "filename.csv" not recognised as an 'CSV data files' file. Reason: Attributes names are not unique! Causes: '2' '1'.

Can anyone tell me how to fix these issues? I am using Weka 3.8 on a Windows 10 64 bit laptop.

Thanks in advance.

Upvotes: 1

Views: 8353

Answers (4)

Kamil Kaplan
Kamil Kaplan

Reputation: 1

I was getting the same error when I uploaded a dataset to weka. When I examined the columns of the dataset, I found that the same column name was present. When I changed the name of one of the two different columns of the 'fwd header length' value, the error was fixed.

enter image description here

Upvotes: 0

ReyNoon
ReyNoon

Reputation: 21

Just make sure to have a column name that's going to be unique vis-a-vis attribute values. This happens for me when I applied StringtoWordVector and get strings which are of the same name as my column name. Just give a good column name :)

Upvotes: 2

user1035292
user1035292

Reputation: 1378

It happens when attribute name is same, in more than one column of the excel sheet. Just rename the column name which are same. It should be unique. This worked for me

Upvotes: 0

G5W
G5W

Reputation: 37641

WEKA will assume that the first row of data is the names of the columns, but the version of the NSL-KDDCup Dataset that I looked at on github did not have column headers. Since the first row had some repeated values, you get this error message. I will suggest two solutions.

  1. The above noted github has a weka-friendly arff file with the data.

  2. Add column headers to the csv file. What should the column headers be? They are listed in the arff file. :-)

Upvotes: 0

Related Questions