Docsity

CMPS 242 Homework: VC-Dimension, Probability, and Learning Algorithms, Assignments of Computer Science

Toggle sidebar
bg1
CMPS 242 First Homework, Winter 2009
3 Problems, due start of class Thursday, Jan. 20
This homework in to be done in groups of 2-4. Each group members should completely
understand the group’s solutions and must acknowledge all sources of inspiration, techniques,
and/or helpful ideas (web, people, books, etc.) other than the instructor and class text.
1. Consider the hypothesis class of homogeneous half-spaces in the <dwhere the instance
are vectors in <dand the hypothesis class His the set of all hwhaving the form
h(x) = +1 if and only if w·x>0. This means that 0, the zero vector, is mapped
to −1 by every hypothesis in the class. Determine the VC-dimension of homogeneous
half-spaces in <d. In other words, for each d≥1 find a set S⊂ <dis shattered by
Hand prove that no set S0⊂ <dwith |S0|>|S|is shattered by H. (Since if S0is
shattered, then every subset of S0is also shattered, it suffices to show that no set S0
with |S0|=|S|+ 1 is shattered). You may use the fact that in any set Sof d+ 1 points
in <d, there is at least one point x∈Sthat can be expressed as a linear combination
of the other points in S.
For significant partial credit, find the VC-dimension of homogeneous half-spaces on the
real line (d= 1), the real plane (d= 2), and 3-dimensional space <3.
2. Consider the following experiment. A magician has three coins in his pocket, a two-
headed coin, a two-tailed coin, and a fair coin. The magician picks a coin from his
pocket with each coin equally likely. The magician then flips the coin twice, and sees
what the comes up (either hh, ht, th, or tt). To make this more formal, consider three
random variables coin ∈ {0,1
2,1},flipA ∈ {0,1}, and flipB ∈ {0,1}where the value of
coingives the probability that a ”head” results when the coin is flipped (and 1 −coin
is the probability that a ”tail” results) and flipA and flipB are indicator functions for
the events ”the first flip is a head” and ”the second flip is a head” respectively. Let
each triple of values (coin,flipA,flipB ) correspond to a point (atomic event) in Ω, and
assume that P(coin = 0) = P(coin = 1/2) = P(coin = 1) = 1/3.
First, what is |Ω|? Second, how many points in Ω have zero probability? Third (main
part), what is P(flipB = 1|flipA = 1)?
3. Consider a domain (instance space) with 3 points: a,b, and c, and a hypothesis class
with three hypotheses: h1, h2, h3that assign the following probabilities of the label +
to each instance (the probability of the label −is 1 minus the probability of +).
h1h2h3
a0.8 0.25 0.5
b0.8 0.75 0.5
c0.2 0.75 0.5
Assume we have the prior probabilities P(h1)=1/2, P(h2) = 4/10, and P(h3)=1/10
and then see the sample, (a, +),(b, −),(c, +).
pf2

Partial preview of the text

Download CMPS 242 Homework: VC-Dimension, Probability, and Learning Algorithms and more Assignments Computer Science in PDF only on Docsity!

CMPS 242 First Homework, Winter 2009 3 Problems, due start of class Thursday, Jan. 20 This homework in to be done in groups of 2-4. Each group members should completely understand the group’s solutions and must acknowledge all sources of inspiration, techniques, and/or helpful ideas (web, people, books, etc.) other than the instructor and class text.

  1. Consider the hypothesis class of homogeneous half-spaces in the <d^ where the instance are vectors in <d^ and the hypothesis class H is the set of all hw having the form h(x) = +1 if and only if w · x > 0. This means that 0 , the zero vector, is mapped to −1 by every hypothesis in the class. Determine the VC-dimension of homogeneous half-spaces in <d. In other words, for each d ≥ 1 find a set S ⊂ <d^ is shattered by H and prove that no set S′^ ⊂ <d^ with |S′| > |S| is shattered by H. (Since if S′^ is shattered, then every subset of S′^ is also shattered, it suffices to show that no set S′ with |S′| = |S| + 1 is shattered). You may use the fact that in any set S of d + 1 points in <d, there is at least one point x ∈ S that can be expressed as a linear combination of the other points in S. For significant partial credit, find the VC-dimension of homogeneous half-spaces on the real line (d = 1), the real plane (d = 2), and 3-dimensional space <^3.
  2. Consider the following experiment. A magician has three coins in his pocket, a two- headed coin, a two-tailed coin, and a fair coin. The magician picks a coin from his pocket with each coin equally likely. The magician then flips the coin twice, and sees what the comes up (either hh, ht, th, or tt). To make this more formal, consider three random variables coin ∈ { 0 , 12 , 1 }, flipA ∈ { 0 , 1 }, and flipB ∈ { 0 , 1 } where the value of coingives the probability that a ”head” results when the coin is flipped (and 1 − coin is the probability that a ”tail” results) and flipA and flipB are indicator functions for the events ”the first flip is a head” and ”the second flip is a head” respectively. Let each triple of values (coin, flipA, flipB ) correspond to a point (atomic event) in Ω, and assume that P (coin = 0) = P (coin = 1/2) = P (coin = 1) = 1/3. First, what is |Ω|? Second, how many points in Ω have zero probability? Third (main part), what is P (flipB = 1|flipA = 1)?
  3. Consider a domain (instance space) with 3 points: a, b, and c, and a hypothesis class with three hypotheses: h 1 , h 2 , h 3 that assign the following probabilities of the label + to each instance (the probability of the label − is 1 minus the probability of +).

h 1 h 2 h 3 a 0. 8 0. 25 0. 5 b 0. 8 0. 75 0. 5 c 0. 2 0. 75 0. 5

Assume we have the prior probabilities P (h 1 ) = 1/2, P (h 2 ) = 4/10, and P (h 3 ) = 1/ 10 and then see the sample, (a, +), (b, −), (c, +).

(a) What is the prior probability of + for each point before seeing the data? (b) Which hypothesis is the maximum likelihood hypothesis after seeing the data? (c) Which hypothesis is the maximum a’posteriori hypothesis after seeing the data? (d) What is the mean posterior (full Bayesian) probabilities of + for each point after seeing the data? (e) Consider the situation if we saw the sample twice, i.e. the sample was (a, +), (b, −), (c, +), (a, +), ( Which of the preceding answers would change?

Exercises. The following problems are for the student’s benefit are are not to be turned in.

  1. Prove that no subset of 5 points in the plane can be shattered by rectangles.
  2. Consider the Monte-Hall problem where the host always shows the lowest numbered door that does not contain the prize. Evaluate when it is beneficial for the contestant to to switch doors in this situation.
  3. Let the domain be the 1000 consecutive integers { 0 , 1 , 2 , 3 ,... , 999 }, the hypothesis class be intervals (each hypothesis maps an interval of these points to + and everything else to −) and the target concept map the integers between 400 and 600 to + and everything else to −. Assume that the distribution is uniform over the domain so each point has probability 1/1000. Consider the most-specific learning algorithm that always returns the smallest interval containing the data. This problem investigates how well the learning algorithm works as a function of the number of samples. The error rate of a hypothesis is the probability that it mis-labels a new random instance. First, assume that we can tolerate an error-rate of 0.05 (5% errors), so producing any hypothesis with a larger error-rate is a failure. Estimate the probability that the most-specific algorithm has an error rate at most 0.05 when trained on 100, 200, 300, etc. random examples by training on each sample size many times. How does the failure probability drop as a function of the number of random examples? Next, consider how the median accuracy of the hypotheses produced by the most- specific algorithm decreases as the sample size increases. Again run on each training set size many times and see how the median accuracy of the produced hypotheses drops as a function of sample size. Which drops faster with sample size, median accuracy or failure rate (or do they both drop at the same rate)?