Non-Integer Class Labels Scikit-Learn

后端 未结 2 768
醉酒成梦
醉酒成梦 2020-12-17 09:18

Quick SVM question for scikit-learn. When you train an SVM, it\'s something like

from sklearn import svm
s = svm.SVC()
s.fit(training_data, labels)
         


        
2条回答
  •  佛祖请我去吃肉
    2020-12-17 09:41

    Passing strings as classes directly is on my todo, but it is not supported in the SVMs yet. For the moment, we have the LabelEncoder that can do the book keeping for you.

    [edit]This should work now out of the box[/edit]

提交回复
热议问题