I'm trying to use LibSVM in Weka. In my .arff dataset I have @attribute attr1 String. But when I checked the LibSVM capabilities I figured out LibSVM doesn't support String attributes. Is there any way to convert the string to numeric value , so I can keep it in my data set.
1 Answers
3
votes
If it really is a string (and not a nominal value), you can use StringToWordVector
Converts String attributes into a set of attributes representing word occurrence (depending on the tokenizer) information from the text contained in the strings. The set of words (attributes) is determined by the first batch filtered (typically training data).
It really depends on what you want to get out of the String. If it is not "normal" text, but something like DNA sequences, you'd need something completely different.