0

I'm new to svm and I've been looking for a svm to use. From all the ones that I've seen, the training label vector is basically a m by 1 vector of 1 and -1. I don't understand why this is so. I was under the assumption that each row of the training vector should be a unique number that labels its respective trained instance.

So a m by n matrix, of m training instances each with n features should have m labels that labels each instance.

That seems logical to me. But it seems like I'm not quite understanding this. Can someone explain?

mugetsu
  • 421
  • 1
  • 5
  • 11
  • 4
    An SVM for classification is trying to partition the data into two subsets, so you need one label for each of the subsets. Traditionally the labels are $\pm 1$. This is for algebraic niceness - it allows you to express two constraints (that the margin doesn't contain data points of either class) as a single equation. – Chris Taylor Jun 21 '12 at 17:34
  • @ChrisTaylor how would I determine which subset a set of data belongs to? and when I test out my model, how would I interpret the +/-1 of the predicted labels? I'm confused as to how this will help me determine which set of my trained data would match my test data. – mugetsu Jun 21 '12 at 17:47
  • @mugetsu See also the [wiki page about supervised learning](http://en.wikipedia.org/wiki/Supervised_learning) and [this question about SVM](http://stats.stackexchange.com/questions/3947/help-me-understand-support-vector-machines). HTH –  Jun 21 '12 at 22:47
  • 1
    @mugetsu SVM is a **supervised learning** method - it supposes that in your training set, you already know what subset each data point belongs to! When you run your model on some previously unseen data, the $\pm 1$ predicted labels tell you which of the two subsets your model is predicting the new data points belong to. – Chris Taylor Jun 22 '12 at 08:39

0 Answers0