Docsity

Practice Exam - Machine Learning | CS 5350, Exams of Computer Science

Toggle sidebar
bg1
Machine Learning (CS 5350/CS 6350) 4 Nov 2008
Reductions
Want to turn an algorithm for solving a simple problem into an algorithm for solving a more complex
problem.
Simple example: multiclass classification with a binary classifier. Several straightforward approaches (OVA/OVR
and AVA/OVO/AP) and several non-straightforward approaches (ECOC, SECOC, etc.).
The general requirements of a reduction are:
1. A mapping from examples for the hard problem to examples for the easy problem.
2. A method for solving the hard problem based on a solution to the easy problem.
3. An error bound that guarantees that good performance on the easy problem implies good performance
on the hard problem.
One of the easiest reductions is from multiclass classification to binary classification using the “one versus
all” approach.
In multiclass classification, we are given inputs x∈ X and outputs y∈ {1,2,3, . . . , K }. The multiclass
classification loss for a hypothesis his 1[h(x)6=y], where 1[·] is an indicator function that takes value 1
when ·is true and value 0 otherwise. In the OVA reduction, we train K-many binary classifiers h1, . . . , hK.
Classifier hkattempts to distinguish between class kand not class k. In particular, the reduction words as:
1. Map a multiclass example (x, y) to K-many binary examples, one for each classifier hk. Classifier hk
is fed the binary pair (x, y =k).
2. Given binary classifiers h1, . . . , hKand a new test point ˆx, compute y1=h1(ˆx), . . . , yK=hK(ˆx).
Choose at random any of the “positive” ys. (If there are none, choose at random.)
3. It turns out that the loss on the multiclass problem is at most 4√Ktimes the loss on the binary
problems. This is pretty bad.
We can do better by using the all-versus-all reduction. Here, we train K
2classifiers, where classifier hij (for
1≤i<j≤K) distinguishes only between classes iand j. The reason the error bound for OVA was so bad
is because just one classifier screwing up can completely change our decisions. AVA has the advantage that
this is no longer true. The reduction works as follows:
1. Map a multiclass example (x, y) to K-many binary examples. In particular, for each class pair i<j,
we feed (x, +1) to hij if i=y; we feed (x, −1) to hij if j=y; and we ignore classifier hij if neither
i=ynor j=y.
2. Given binary classifiers hij and a new test point ˆx, maintain a score vector Sof length K. Compute
hij( ˆx) for every pair i,j . If hij returns “true” (i.e., it believes the correct class is i), then increment
Si. If it returns “false”, then increment Sj. Return the class with the highest score (breaking ties
randomly).
3. The error bound is much better here. The loss on the multiclass problem is at most twice the average
loss on the binary problems. This is quite good (i.e., there is no dependence on K).
There are other methods for doing multiclass-to-binary reductions:
1
pf2

Partial preview of the text

Download Practice Exam - Machine Learning | CS 5350 and more Exams Computer Science in PDF only on Docsity!

Machine Learning (CS 5350/CS 6350) 4 Nov 2008

Reductions

Want to turn an algorithm for solving a simple problem into an algorithm for solving a more complex problem.

Simple example: multiclass classification with a binary classifier. Several straightforward approaches (OVA/OVR and AVA/OVO/AP) and several non-straightforward approaches (ECOC, SECOC, etc.).

The general requirements of a reduction are:

  1. A mapping from examples for the hard problem to examples for the easy problem.
  2. A method for solving the hard problem based on a solution to the easy problem.
  3. An error bound that guarantees that good performance on the easy problem implies good performance on the hard problem.

One of the easiest reductions is from multiclass classification to binary classification using the “one versus all” approach.

In multiclass classification, we are given inputs x ∈ X and outputs y ∈ { 1 , 2 , 3 ,... , K}. The multiclass classification loss for a hypothesis h is 1 [h(x) 6 = y], where 1 [·] is an indicator function that takes value 1 when · is true and value 0 otherwise. In the OVA reduction, we train K-many binary classifiers h 1 ,... , hK. Classifier hk attempts to distinguish between class k and not class k. In particular, the reduction words as:

  1. Map a multiclass example (x, y) to K-many binary examples, one for each classifier hk. Classifier hk is fed the binary pair (x, y = k).
  2. Given binary classifiers h 1 ,... , hK and a new test point ˆx, compute y 1 = h 1 (ˆx),... , yK = hK (ˆx). Choose at random any of the “positive” ys. (If there are none, choose at random.)
  3. It turns out that the loss on the multiclass problem is at most 4

K times the loss on the binary problems. This is pretty bad.

We can do better by using the all-versus-all reduction. Here, we train

(K

2

classifiers, where classifier hij (for 1 ≤ i < j ≤ K) distinguishes only between classes i and j. The reason the error bound for OVA was so bad is because just one classifier screwing up can completely change our decisions. AVA has the advantage that this is no longer true. The reduction works as follows:

  1. Map a multiclass example (x, y) to K-many binary examples. In particular, for each class pair i < j, we feed (x, +1) to hij if i = y; we feed (x, −1) to hij if j = y; and we ignore classifier hij if neither i = y nor j = y.
  2. Given binary classifiers hij and a new test point ˆx, maintain a score vector S of length K. Compute hij (ˆx) for every pair i, j. If hij returns “true” (i.e., it believes the correct class is i), then increment Si. If it returns “false”, then increment Sj. Return the class with the highest score (breaking ties randomly).
  3. The error bound is much better here. The loss on the multiclass problem is at most twice the average loss on the binary problems. This is quite good (i.e., there is no dependence on K).

There are other methods for doing multiclass-to-binary reductions:

Reductions 2

  1. Build a classification tree. Gets an error bound of that depends on log 2 K.
  2. Use an error correcting output code (such as a Hadamard code). If the codewords have distance d apart, then we get an error bound that depends on 2K/d. Thus the Hadamard code gets an error bound of 4 because d = K/2.
  3. Many more options...

There are also other problems we can solve with reductions:

  1. Weighted binary classification to binary classification
  2. Regression to binary classification
  3. Binary classification to regression
  4. Orginal regression
  5. Ranking
  6. Structured prediction
  7. Reinforcement learning
  8. Etc...

For a fairly substantiantial bibliography, see http://hunch.net/~jl/projects/reductions/reductions.html.