Re: Problem with WEKA

Peter Reutemann <[email protected]> Tue, 18 Oct 2022 08:54:17 +1300
Newsgroups gmane.comp.ai.weka
Message-ID <CAHoQ12KQDOE6+H9FOP-VX3TxQrc_DmMYmUSS1dX+eSnacgnaHQ@mail.gmail.com>
> I have two files in .csv format. I open the files in WEKA and delete fields from both files and then save them as WEKA files.
>
> When I tried to open them, I got Error saying that the format is not recognized.
>
> The two files are attached
>
> For diabetic_training.csv  file, i need to remove (5 fields)      “encounter_id”,“patient_nbr” , “diag_1”, “diag_2”,  and “diag_3”,   then save it as diabetic_training.arff.
>
> For diabetic_test.csv, remove “encounter_id”, “patient_nbr”, “diag_1”, “diag_2”,  and “diag_3” and save it as diabetic_test.arff
>
>
> Thanks much for your help if you either let me know what the problem is and produce two new .arff files

Working with CSV files is always problematic for various reasons:
- different values in columns
- different order of values per column
- different number of values can mean difference between STRING or
NOMINAL attribute

I was able to load both of the attached CSV files in the Weka Explorer
with the default settings of the CSV loader (Weka 3.9.6).

Here's what I would do:
- combine the two CSV files into a third one (that way we will
encounter ALL values)
- load each CSV file in the Weka Explorer and save it as ARFF
- open all three ARFF files in a text editor
- copy the header section (between @relation and @data) from the
combined file and replace the ones in your train/test ARFF files with
that
- save your train/test files

The two files should be compatible now.

Cheers, Peter
-- 
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
https://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html