Docsity

Advanced Algorithms: MB Model, Perceptron Algorithm and PAC Model, Study notes of Advanced Algorithms

Toggle sidebar
bg1
CS787: Advanced Algorithms
Scribe: Dan Wong, Blayne Field Lecturer: Shuchi Chawla
Topic: MB Model, Perceptron Alg. and PAC Model Date: November 14, 2007
24.1 Introduction
Continuing from the last lecture, we resume our discussion of concept learning in the mistake bound
(MB) model. Recalling from last time, we want to give an online algorithm for learning a function
from a concept (aka hypothesis) class C. We are given examples with nfeatures, and we wish to
predict the value of our target function. After each step, we learn if our prediction was correct
or not, and update our future predictions accordingly. Our goal is to do this in a manner that
guarantees some bound on the number of mistakes that our algorithm makes.
Definition 24.1.1 A class C is said to be learnable in the MB model if there exists an online algo-
rithm that given examples labeled by a target function f∈Cmakes O(log|C|)prediction mistakes
and the run time for each step is bounded by O(n, log|C|)
It turns out that this requirement for the run time is necessary, since without it, the halving
algorithm (discussed in a previous lecture) would give us a O(log|C|) bound for any concept class
C. It was demonstrated in the last lecture that the class of boolean OR functions is learnable in the
MB model, along with boolean OR functions with at most k literals. We also saw that the winnow
algorithm (described below) solves (rof k) majority functions in the MB model.
24.2 Winnow Algorithm
Consider the problem of learning a (rof k) concept class. Here the class we are trying to learn
is one where the target function contains kattributes and if at least rof them are present in the
example then it is true otherwise it is false.
Recall the Winnow Algorithm:
- Start with wi,0= 1∀i
- Predict 1 if Pwi,txi,t ≥nelse predict 0.
- Update weights on mistake as follows:
– Positive Example: For every iwith xi,t = 1 set wi,t+1 = (1 + ²)wi,t
– Negative Example: For every iwith xi,t = 1 set wi,t+1 =wi,t
(1+²)
Note that if the weight of an attribute is greater than n, it will never increase further.
Let P= The number of mistakes on positive examples, and likewise Nbe the number of mistakes
on negative examples.
Recall: Piwi,0=n
1
pf3
pf4

Partial preview of the text

Download Advanced Algorithms: MB Model, Perceptron Algorithm and PAC Model and more Study notes Advanced Algorithms in PDF only on Docsity!

CS787: Advanced Algorithms Scribe: Dan Wong, Blayne Field Lecturer: Shuchi Chawla Topic: MB Model, Perceptron Alg. and PAC Model Date: November 14, 2007

24.1 Introduction

Continuing from the last lecture, we resume our discussion of concept learning in the mistake bound (MB) model. Recalling from last time, we want to give an online algorithm for learning a function from a concept (aka hypothesis) class C. We are given examples with n features, and we wish to predict the value of our target function. After each step, we learn if our prediction was correct or not, and update our future predictions accordingly. Our goal is to do this in a manner that guarantees some bound on the number of mistakes that our algorithm makes.

Definition 24.1.1 A class C is said to be learnable in the MB model if there exists an online algo- rithm that given examples labeled by a target function f ∈ C makes O(log|C|) prediction mistakes and the run time for each step is bounded by O(n, log|C|)

It turns out that this requirement for the run time is necessary, since without it, the halving algorithm (discussed in a previous lecture) would give us a O(log|C|) bound for any concept class C. It was demonstrated in the last lecture that the class of boolean OR functions is learnable in the MB model, along with boolean OR functions with at most k literals. We also saw that the winnow algorithm (described below) solves (r of k) majority functions in the MB model.

24.2 Winnow Algorithm

Consider the problem of learning a (r of k) concept class. Here the class we are trying to learn is one where the target function contains k attributes and if at least r of them are present in the example then it is true otherwise it is false.

Recall the Winnow Algorithm:

  • Start with wi, 0 = 1∀i
  • Predict 1 if

wi,txi,t ≥ n else predict 0.

  • Update weights on mistake as follows:
  • Positive Example: For every i with xi,t = 1 set wi,t+1 = (1 + ²)wi,t
  • Negative Example: For every i with xi,t = 1 set wi,t+1 = (^) (1+wi,t²)

Note that if the weight of an attribute is greater than n, it will never increase further.

Let P = The number of mistakes on positive examples, and likewise N be the number of mistakes on negative examples. Recall:

i wi,^0 =^ n

The total increase in

i wi^ ≤^ P ²n The total decrease in

i wi^ ≥^

N ²n 1+²

Since our weights never go negative we get an inequality:

n + P ²n ≥

N ²n 1 + ²

To make another inequality we will count the total number of increases or decreases to any relevant attribute seen by our set of k attributes. Consider the analogy of throwing coins in buckets again where every bucket is one of the relevant attributes and every time we increase an attributes weight we add a coin and every time we decrease its weight we remove one. We add at least r new coins for each positive example since there must have been at least r target attributes in our example since it was labeled positive. For each negative example we remove at most (r − 1) coins since there must have been at most (r − 1) target attributes since the example was labeled negative. The maximum net increase seen by any single one of the k attributes is log1+² n.

Therefore the number of increases minus the decreases should be less than or equal to the maximum net increase:

P r − (r − 1)N ≤ klog(1+²)n

Solving the 2 inequalities for P and N yields:

P, N = O(rk log n), for ² =

2 r

24.3 Linear Threshold Functions

One class of functions that we are interested in learning is that of linear threshold functions. A linear threshold function in n dimensions is a hyperplane that splits the space in two, where the points on different sides correspond to positive and negative labels. The function is defined by a set of weights W = {w 1 , w 2 , ..., wn}, where the label of the function then becomes sign[

wixi − w 0 ]. This type of function may arise in many applications, such as if we were given examples of people

24.5 Extensions to the prediction problem

It also turns out that we extend the weighted majority algorithm to solve variations of the prediction problem as well. These variations include the situation where we don’t learn the costs of the experts we did not pick (a very real possibility in a real-world situation). It may also be the case that not all experts are available or relevant at all time steps, and the algorithm must be modified to deal with these changes. Another possible situation is that we may want to assign some random initial offset to our experts.

24.6 Introduction to PAC Model

The PAC Model, Probably Approximately Correct Model, is a learning model where we claim that the function we are trying to learn is approximately correct.

Definition 24.6.1 A concept class, C, is PAC learnable if there exists an algoirthm, A, such that ∀², δ > 0 for every distribution D, and any target function, f ∈ C, given a set S of examples drawn from D labled by f , A produces with probability (1−δ) a function h such that Prx∼D [h(x) = f (x)] ≥ (1 − ²).

Note that by allowing the constructed function h to differ from f with some probability ², we are protected against negligible weight examples. In a similar sense δ protects against the event that when sampling S from D that we get an unrepresentative set S. Since low weight examples are unlikely to be seen in the sample, it would be unreasonable to expect the algorithm to perform well in either case.

In addition we require the algorithm to work in reasonable amount of time and only use a reason- able amount of examples. Specifically:

The size of S,|S| should be poly( (^1) ² , (^) γ^1 , n, log |C|) Runtime should be poly( (^1) ² , (^1) γ , n, log |C|)