views:

494

answers:

3

Hello,

In every book and example always they show only binary classification (two classes) and new vector can belong to any one class.

Here the problem is I have 4 classes(c1, c2, c3, c4). I've training data for 4 classes.

For new vector the output should be like

C1 80% (the winner)

c2 10%

c3 6%

c4 4%

How to do this? I'm planning to use libsvm (because it most popular). I don't know much about it. If any of you guys used it previously please tell me specific commands I'm supposed to use.

A: 

You can always reduce a multi-class classification problem to a binary problem by choosing random partititions of the set of classes, recursively. This is not necessarily any less effective or efficient than learning all at once, since the sub-learning problems require less examples since the partitioning problem is smaller. (It may require at most a constant order time more, e.g. twice as long). It may also lead to more accurate learning.

I'm not necessarily recommending this, but it is one answer to your question, and is a general technique that can be applied to any binary learning algorithm.

Larry Watanabe
+2  A: 

Commonly used methods are One vs. Rest and One vs. One. In first case you get n classifiers and the resulting class with have highest score In the second class the resulting class is obtained by majority vote of all classifiers.

AFAIR, libsvm supports both strategies of multiclass.

Anton Kazennikov
I thought libsvm only supports one vs. one. But it works really well, though.
Steve
A: 

There's a terrific chapter about SVM in Toby Segaren's "Programming Collective Intelligence". I recommend it highly.

duffymo
Isn't the matchmaker example in this chapter, a binary classification example?
mlguy