Docsity

Machine Learning 10-601 Final Exam Review: Preparation Guide and Sample Questions, Study notes of Machine Learning

Partial preview of the text

Download Machine Learning 10-601 Final Exam Review: Preparation Guide and Sample Questions and more Study notes Machine Learning in PDF only on Docsity!

Final Exam Review

10 -­‐601 Introduction to Machine Learning

Matt Gormley

Lecture 29

May 3, 2016

Machine Learning Department

School of Computer Science

Carnegie Mellon University

Readings:

Murphy (all chapters)

Bishop (all chapters)

HTF (all chapters)

Mitchell (all chapters)

Reminders

  • Homework 9: Applications of ML
    • Release: Mon, Apr. 24
    • Due: Wed, May 3 at 11:59pm
  • Final Exam (Evening Exam)
    • Mon, May 08 at 5:30pm – 8:30pm
    • See Piazza for details about location

EXAM LOGISTICS

Final Exam

  • Time / Location
    • Time: Evening Exam

Mon, May 8 at 5:30pm – 8:30pm

  • Room : We will contact each student individually with your room

assignment. The rooms are not based on section.

  • Seats: There will be assigned seats. Please arrive early.
  • Please watch Piazza carefully for announcements regarding room / seat

assignments.

  • Logistics
    • 8 -­‐ 9 Sections
    • Format of questions:
      • Multiple choice
      • True / False (with justification)
      • Derivations
      • Short answers
      • Interpreting figures
    • No electronic devices
    • You are allowed to bring one 8½ x 11 sheet of notes (front and back)

Final Exam

  • How to Prepare
    • Attend the final recitation session:

Tue, Dec. 6

th

at 5:30pm

  • Review prior year’s exams and solutions

(we will post them)

  • Review this year’s homework problems
  • Flip through the “What you should know” points

(see ‘More’ links on ‘Schedule’ page of course

website)

Final Exam

  • Advice (for during the exam)
    • Solve the easy problems first

(e.g. multiple choice before derivations)

  • if a problem seems extremely complicated you’re likely

missing something

  • Don’t leave any answer blank!
  • If you make an assumption, write it down
  • If you look at a question and don’t know the

answer:

  • we probably haven’t told you the answer
  • but we’ve told you enough to work it out
  • imagine arguing for some answer and see if you like it

Topics covered before Midterm

  • Foundations
    • Probability
    • MLE, MAP
    • Optimization
  • Classifiers
    • KNN
    • Naïve Bayes
    • Logistic Regression
    • Perceptron
    • SVM
      • Regression
        • Linear Regression
      • Important Concepts
        • Kernels
        • Regularization and

Overfitting

  • Experimental Design

Topics covered after Midterm

  • Unsupervised Learning
    • K-­‐means / Lloyd’s method
    • PCA
    • EM / GMMs
  • Neural Networks
    • Feedforward Neural Nets
    • Basic architectures
    • Backpropagation
    • CNNs
      • Graphical Models
        • Bayesian Networks
        • HMMs
        • Learning and Inference
      • Learning Theory
        • Statistical Estimation

(covered right before

midterm)

  • PAC Learning
  • Other Learning

Paradigms

  • Matrix Factorization
  • Reinforcement Learning
  • Information Theory

Samples Questions

13

10-601: Machine Learning Page 4 of 16 4/27/

2 K-Means Clustering [16 pts.]

2.1 General K-means questions (circle one answer)

(a) [3 pts] We are given n data points, x 1

, ..., x n

and asked to cluster them using K-means.

If we choose the value for k to optimize the objective function how many clusters will

be used (i.e. what value of k will we choose)? No justification required.

(i) 1 (ii) 2 (iii) n (iv) log(n)

Solution: n. Since the objective function would be minimized with k = n since there

is no regularization for the value of k.

(b) [3 pts] Why do we use Lloyds algorithm to find the K-means clustering assignments

instead of the brute force algorithm? Recall that the brute force algorithm for some

value k requires searching over all possible assignments of the data points into k clusters.

No justification required.

(i) Lloyd’s algorithm is guaranteed to find a clustering assignment.

(ii) Lloyd’s algorithm is guaranteed to converge in a linear number of steps.

(iii) The brute force algorithm can take an exponential number of steps (in worst case).

(iv) The brute force algorithm can take a polynomial number of steps (in worst case).

10-601: Machine Learning Page 4 of 16 4/27/

2 K-Means Clustering [16 pts.]

2.1 General K-means questions (circle one answer)

(a) [3 pts] We are given n data points, x 1

, ..., x n

and asked to cluster them using K-means.

If we choose the value for k to optimize the objective function how many clusters will

be used (i.e. what value of k will we choose)? No justification required.

(i) 1 (ii) 2 (iii) n (iv) log(n)

Solution: n. Since the objective function would be minimized with k = n since there

is no regularization for the value of k.

(b) [3 pts] Why do we use Lloyds algorithm to find the K-means clustering assignments

instead of the brute force algorithm? Recall that the brute force algorithm for some

value k requires searching over all possible assignments of the data points into k clusters.

No justification required.

(i) Lloyd’s algorithm is guaranteed to find a clustering assignment.

(ii) Lloyd’s algorithm is guaranteed to converge in a linear number of steps.

(iii) The brute force algorithm can take an exponential number of steps (in worst case).

(iv) The brute force algorithm can take a polynomial number of steps (in worst case).

Samples Questions

10-601: Machine Learning Page 5 of 16

− 1 −0.5 0 0.5 1 1.5 2 2.5 3

− 1

−0.

0

1

2

3

Figure 2: Initial data and cluster centers

Circle the image which depicts

the cluster center positions after 1

iteration of Lloyd’s algorithm.

(iii) The brute force algorithm can take an exponential number of steps (in worst case).

(iv) The brute force algorithm can take a polynomial number of steps (in worst case).

Solution: (c) The brute force algorithm can take an exponential number of steps (in

worst case).

2.2 Lloyd’s algorithm

We are given data drawn from two independent multivariate Gaussian distributions. The

data are shown in Figure 2 with the initial cluster centers as red crosses.

Sample Questions

18

Machine Learning 10-601 Midterm II 8 of 13 April 29, 2015

Question 4: Expectation Maximization

Given a set of observed variables X, a set of latent variables Z, and a set of model parameters with the

current estimate being ✓, a single iteration of the EM algorithm updates the parameters estimate ✓ as follows:

✓ arg max

✓

0

Q(✓

0 |✓) ⌘ E P (Z|X,✓) [log P (X, Z|✓

0 )]

where log P (X, Z|✓

0 ) = log

Q n

i=

P (X i , Z i |✓

0 ) is known as the complete log likelihood of the data.

4.1 Short Answer [6 pt.]

(a) [2 pts] True or False: In the case of fully observed data, i.e. when Z is an empty set, the EM algorithm

reduces to a maximum likelihood estimate.

(b) [2 pts] True or False: Since the EM algorithm guarantees that the value of its objective function will

increase on each iteration, it is guaranteed to eventually reach a global maximum.

(c) [2 pts] Suppose you introduce some prior on the parameters ✓ and you want to modify an EM algorithm

so that it computes MAP estimates of the model parameters instead of MLE estimates. Which step(s)

of the algorithm would you need to change?

i. This modification is not possible

ii. Only the E step

iii. Only the M step

iv. Both the E and M steps

4.2 Deriving EM [10 pt.+3 Extra Credit]

Machine Learning 10-601 Midterm II 8 of 13 April 29, 2015

Question 4: Expectation Maximization

Given a set of observed variables X, a set of latent variables Z, and a set of model parameters with the

current estimate being ✓, a single iteration of the EM algorithm updates the parameters estimate ✓ as follows:

✓ arg max

✓

0

Q(✓

0 |✓) ⌘ E P (Z|X,✓)

[log P (X, Z|✓

0 )]

where log P (X, Z|✓

0 ) = log

Q n

i=

P (X i , Z i |✓

0 ) is known as the complete log likelihood of the data.

4.1 Short Answer [6 pt.]

(a) [2 pts] True or False: In the case of fully observed data, i.e. when Z is an empty set, the EM algorithm

reduces to a maximum likelihood estimate.

(b) [2 pts] True or False: Since the EM algorithm guarantees that the value of its objective function will

increase on each iteration, it is guaranteed to eventually reach a global maximum.

(c) [2 pts] Suppose you introduce some prior on the parameters ✓ and you want to modify an EM algorithm

so that it computes MAP estimates of the model parameters instead of MLE estimates. Which step(s)

of the algorithm would you need to change?

i. This modification is not possible

ii. Only the E step

iii. Only the M step

iv. Both the E and M steps

4.2 Deriving EM [10 pt.+3 Extra Credit]

Machine Learning 10-601 Midterm II 8 of 13 April 29, 2015

Question 4: Expectation Maximization

Given a set of observed variables X, a set of latent variables Z, and a set of model parameters with the

current estimate being ✓, a single iteration of the EM algorithm updates the parameters estimate ✓ as follows:

✓ arg max

✓

0

Q(✓

0 |✓) ⌘ E P (Z|X,✓)

[log P (X, Z|✓

0 )]

where log P (X, Z|✓

0 ) = log

Q n

i=

P (X i , Z i |✓

0 ) is known as the complete log likelihood of the data.

4.1 Short Answer [6 pt.]

(a) [2 pts] True or False: In the case of fully observed data, i.e. when Z is an empty set, the EM algorithm

reduces to a maximum likelihood estimate.

(b) [2 pts] True or False: Since the EM algorithm guarantees that the value of its objective function will

increase on each iteration, it is guaranteed to eventually reach a global maximum.

(c) [2 pts] Suppose you introduce some prior on the parameters ✓ and you want to modify an EM algorithm

so that it computes MAP estimates of the model parameters instead of MLE estimates. Which step(s)

of the algorithm would you need to change?

i. This modification is not possible

ii. Only the E step

iii. Only the M step

iv. Both the E and M steps

Sample Questions 10-601: Machine Learning Page 9 of 15 4/27/

4 Principal Component Analysis [16 pts.]

(a) In the following plots, a train set of data points X belonging to two classes on R

2

are given, where the original features are the coordinates (x, y). For each, answer the

following questions:

(i) [3 pt.] Draw all the principal components.

(ii) [6 pts.] Can we correctly classify this dataset by using a threshold function after

projecting onto one of the principal components? If so, which principal component

should we project onto? If not, explain in 1–2 sentences why it is not possible.

Dataset 1:

Response to question (ii):

10-601: Machine Learning Page 9 of 15 4/27/

4 Principal Component Analysis [16 pts.]

(a) In the following plots, a train set of data points X belonging to two classes on R

2

are given, where the original features are the coordinates (x, y). For each, answer the

following questions:

(i) [3 pt.] Draw all the principal components.

(ii) [6 pts.] Can we correctly classify this dataset by using a threshold function after

projecting onto one of the principal components? If so, which principal component

should we project onto? If not, explain in 1–2 sentences why it is not possible.

Dataset 1:

Response to question (ii):

(i) [3 pt.] Draw all the principal componen

(ii) [6 pts.] Can we correctly classify this d

projecting onto one of the principal com

should we project onto? If not, explain

Dataset 1:

Response

Dataset 2:

Response

Sample Questions

the simple dataset shown in Figure 5a. Even though the crosses and circles are not linearly

separable, we can break the examples into three groups, S 1 , S 2 , and S 3 (shown in Figure 5a)

so that S 1

is linearly separable from S 2

and S 2

is linearly separable from S 3

. We will exploit

this fact to design weights for the neural network shown in Figure 5b in order to correctly

classify this training set. For all nodes, we will use the threshold activation function

(z) =

⇢

1 z > 0

0 z  0.

(a) The dataset with groups S 1 , S 2 , and S 3 .

y

h

1

h

2

x

1

x

2

w

11

w

21

w

12 w

22

w

31

w

32

(b) The neural network architecture

Figure 5

separable, we can break the examples into three groups, S 1

, S 2

, and S 3

(shown in Figure 5a)

so that S 1 is linearly separable from S 2 and S 2 is linearly separable from S 3

. We will exploit

this fact to design weights for the neural network shown in Figure 5b in order to correctly

classify this training set. For all nodes, we will use the threshold activation function

(z) =

⇢

1 z > 0

0 z  0.

0 1 2 3 4 5

0

1

2

3

4

5

x

x

S 1

S 2

S 3

(a) The dataset with groups S 1 , S 2 , and S 3

. (b) The neural network architecture

Figure 5

Can the neural network in Figure (b) correctly classify the dataset given in Figure (a)?

Neural Networks

Sample Questions

the simple dataset shown in Figure 5a. Even though the crosses and circles are not linearly

separable, we can break the examples into three groups, S 1 , S 2 , and S 3 (shown in Figure 5a)

so that S 1

is linearly separable from S 2

and S 2

is linearly separable from S 3

. We will exploit

this fact to design weights for the neural network shown in Figure 5b in order to correctly

classify this training set. For all nodes, we will use the threshold activation function

(z) =

⇢

1 z > 0

0 z  0.

(a) The dataset with groups S 1 , S 2 , and S 3 .

y

h

1

h

2

x

1

x

2

w

11

w

21

w

12 w

22

w

31

w

32

(b) The neural network architecture

Figure 5

Apply the backpropagation algorithm to obtain

the partial derivative of the mean-squared error

of y with the true value y

with respect to the

weight w

22

assuming a sigmoid nonlinear

activation function for the hidden layer.

Neural Networks