Multiclass classification one vs one

1.1k Views Asked by At

How one-vs-one method works for test set in multiclass classification? I understand how it generated subsets of each pair for training set but how it is used on test set? I read something about most votes but i can't find anything what those votes are or how they works my asumption is that votes are observations flaged as positive/negative in a pair of classes.

How i understand it:

if i have three pairs A vs B, A vs C, B vs C, and i want to predict C then i have to use A vs C if this pair has more negatives values than B vs C?

1

There are 1 best solutions below

1
On BEST ANSWER

Your intuiton is almost right, votes for each class represents the number of time a class won a duel versus another class, negative ones are just not taken in account.

To illustrate how works a One versus One Classifier, let's take a simple example, with 4 classes 'Red', 'Blue', 'Green', 'Yellow'. We will have to train K * (K -1) /2 classifiers (K is the number of class).

To train the model, each subset of 2 classes will be used to train a binary classifier, so we will train in total 4 *( 4 - 1)/2 in our case 6 classifiers :

  • Classifier 1 : Red vs Blue
  • Classifier 2 : Red vs Green
  • Classifier 3 : Red vs Yellow
  • Classifier 4 : Blue vs Green
  • Classifier 5 : Blue vs Yellow
  • Classifier 6 : Green vs Yellow

Let's now take a single test element, we run all our binary classifiers over it, here are the result :

  • Classifier 1 : Red
  • Classifier 2 : Red
  • Classifier 3 : Red
  • Classifier 4 : Blue
  • Classifier 5 : Yellow
  • Classifier 6 : Green

As you can see above, Blue, Yellow and Green won only 1 duel while Red won 3 duels. Our multiclass classifier predict that this instance is Red