Re: Convertion from nominal to numeric
Peter Reutemann <[email protected]> Mon, 9 Jan 2023 11:44:09 +1300
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <CAHoQ12KZMB9A=tZTzgxy1nzv8EqyowrOzjOLUPEx9LmE9DY26A@mail.gmail.com> |
> Yes! I just noticed that. There is a space before each of the attribute values. > How can I handle that? > Should there be quotes around the entire expression? If you had that for GB and GK below? > weka.filters.unsupervised.attribute.RenameNominalValues -R 1 -N " GB:11, GK:12" > Or quotes around each value? > weka.filters.unsupervised.attribute.RenameNominalValues -R 1 -N " GB":11," GK":12 > Should they be single quotes or double quotes? I just had a quick look at the code of the filter and it performs a "trim" (ie removes leading/trailing white spaces like spaces), so including spaces in the labels won't work unfortunately. The simplest approach, if you want to stick with Weka, is to just open the file in a text editor and replace the leading spaces. If the data is stored in an ARFF file, then values with spaces should be enclosed in single quotes, which will make it easy to replace. If you want to automate these manual preprocessing steps, you might consider switching to ADAMS (https://adams.cms.waikato.ac.nz/) and its workflow system. It includes Weka (when downloading an "ml-app" snapshot or release) and a lot more operators for dealing with spreadsheets. We had to deal with a lot of data in spreadsheet format, which resulted in writing a lot of components/operators for dealing with these things. On top of that, the Weka Investigator that comes with ADAMS is a more flexible/powerful interface compared to the Weka Explorer. :-) (Disclaimer: I'm the lead developer of ADAMS) Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, Hamilton, 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