Reputation: 705
I have a classification task which takes a string as input and classifies it to some labels. The training data like:
Text1: label_1
Text2: label_2
Text3: label_1
When I use weka, lots of classifies give the exception:
weka.core.UnsupportedAttributeTypeException: weka.classifiers.functions.MultilayerPerceptron: Cannot handle string attributes!
at weka.core.Capabilities.test(Capabilities.java:979)
at weka.core.Capabilities.test(Capabilities.java:868)
at weka.core.Capabilities.test(Capabilities.java:1084)
at weka.core.Capabilities.test(Capabilities.java:1022)
at weka.core.Capabilities.testWithFail(Capabilities.java:1301)
Upvotes: 0
Views: 3413
Reputation: 178411
It is hard to understand what exactly you are trying to achieve, but in Machine Learning, most classifiers are looking for numeric/binary attributes, and not string attributes.
One thing you can do is convert your feature space to numeric/binary attributes using some model. The Bag of Words model is a common solution.
According to this model, what you have to do is:
Upvotes: 4