title: Non-Integer Class Labels Scikit-Learn
body: <p>Quick SVM question for scikit-learn. When you train an SVM, it's something like</p>
  
  <pre><code>from sklearn import svm
  s = svm.SVC()
  s.fit(training_data, labels)
  </code></pre>
  
  <p>Is there any way for <code>labels</code> to be a list of a non-numeric type? For instance, if I want to classify vectors as 'cat' or 'dog,' without having to have some kind of external lookup table that encodes 'cat' and 'dog' into 1's and 2's. When I try to just pass a list of strings, I get ...</p>
  
  <p><code>ValueError: invalid literal for float(): cat</code></p>
  
  <p>So, it doesn't look like just shoving strings in <code>labels</code> will work. Any ideas?</p>