Re: Convertion from nominal to numeric
Peter Reutemann <[email protected]> Sat, 31 Dec 2022 16:52:28 +1300
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <CAHoQ12Ld59Q=iyWQ4GL8M2pYgJ1XRByhaL1CX0GWQvYNACyY4A@mail.gmail.com> |
> Let's say you have a dataset with a nominal attribute: education with values like HighSchool, College, GraduateSchool., etc The values can be ranked. I would like to convert them so that their numerical value is consistent with the ranking of the meaning, rather than the ranking in Weka which seems to come from the order the values were found in the CSV file.
> How can I reorder the values in a meaningful ranking and then assign a numerical value?
You can use the RenameNominalValues filter to replace the current
labels with numeric labels:
https://weka.sourceforge.io/doc.dev/weka/filters/unsupervised/attribute/RenameNominalValues.html
Once saved, open the ARFF file in a text editor and replace the
"{0,1,2,3,...}" of the relevant attribute with "numeric".
For reference:
https://waikato.github.io/weka-wiki/formats_and_processing/arff_stable/
Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
Mobile +64 22 190 2375
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