Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

FIT5021 - Exam Practice Questions

S2-2022

Relation of this  collection to the final exam:  The collection of questions below is not equivalent to an exam.  Your final exam contains questions worth a total of 60 marks that are distributed across the six modules of the unit (not necessarily equally). The total time to complete the exam is 130 minutes and you are expected to complete all questions. Hence, as a rule of thumb, you should aim to invest no more minutes into a question than two times its marks. For example, a question with 10 marks is designed to be completed in about 20 minutes.  This approach leaves you an additional 10 minutes as buffer time for the overall exam. The exam is closed book.

How to use this collection to practice:  It is fundamentally important that you attempt every question alone without help before you refer to the teaching material, discuss with your peers, or even look at the separately published reference solutions.  If you are like most students (and teachers) this approach will be scary because it requires you to confront your gaps in knowledge. However, this is exactly why it will lead you to a good exam performance (very much in contrast to just scanning the solutions). It gives yourself the opportunity to really understand what you do not understand before looking for help. This way, once you receive the information to fill the gap, you will connect it better with the other things you know, causing it to be available to you under exam conditions.

Elements of Statistical Learning

1    Classification versus Regression [2 marks]

What is the difference between a classification and a regression problem?  Answer in one to two sentences.

2    Normal Distribution and Maximum Likelihood Estimation [10 marks]

The  (uni-variate) normal distribution is an extremely important distribution describing the be- haviour of continuous random variables. It is parameterised by a mean µ and a standard deviation parameters σ  (or more typically by the corresponding variance parameter σ 2 ).  Given a dataset {x1 , . . . ,xN } of independent realisations of a normal random variable X, we can use the principal of maximum likelihood to find guesses for the unknown parameters.  In particular, these guesses have simple closed form solutions.

Answer each of the following questions with one to two sentences and give mathematical deriva- tions as appropriate.

(a) What is the definition of the normal density function p(x|µ,σ)? What is the key component of the definition that gives rise to the characteristic bell shape?

(b) What is the key idea of the maximum likelihood estimation of the parameters µ and σ, i.e., what is the defining property of the maximum likelihood estimates µML  and σML .

(c)  How can we derive the closed form solution of the maximum likelihood estimation for the mean µ? Apply this approach to derive it.

(d)  How can we derive the closed form solution of the maximum likelihood estimation for the standard deviation σ? Apply this approach to derive it.

Linear Regression

3    Derivation of Squared Error [6 marks]

For fitting the model parameters w of a linear regression model, we used the approach to minimise the squared error

N

E(w) =   (tn yn )2   ,

n=1

where {(x1 ,t1 ), . . . , (xN ,tn )} is the given training data and yn   = i(p)=1 wi ϕi (xn ) are the model predictions. To justify this error function, we showed that it can be derived as a maximum likelihood parameter estimation for a probabilistic model p(t|x,w).

Answer each of the  following  questions with one to two  sentences  (including mathematical equations as appropriate).

(a) What is the form of the probabilistic model that we assumed for the regression problem, i.e.,

how are the target values generated given the input vectors?

(b) What is the likelihood function corresponding to this model?

(c) Why is maximising this likelihood function equivalent to minimising the squared error func- tion?

Linear Classification

4    Logistic Regression [8 marks]

When using the logistic regression model for binary classification, we model the probability of the positive class (t = 1) given input x via the sigmoid transformation σ of a linear function w · x of model parameters w .

(a)  Give the log likelihood function log p(t|x,w) of the logistic regression model for a single data point  (x,t).   Hint:   We  used  the fact  that  we  encode  the  positive  class  with  t =  1  and  the negative class with t = 0 to give a compact formula.

(b)  As a step towards the gradient descent algorithm for logistic regression, derive the partial derivative of the negative log likelihood (error function) −log p(t|x,w) with respect to pa- rameter wi . Derive the result in individual steps, noting what results you are using (all correct steps give partial marks).

(c)  Extend your result from part  (b) to the full gradient of the negative log likelihood when observing a set of n training data points {(x1 ,t1 ), . . . , (xN ,tn )}.

Latent Variable Models

5    Document Clustering Model [9 marks]

Suppose we are given a collection of documents D . The data set D is represented as {x1 ,x2 ,x3 , ...,xN } where xi  a d-dimensional  count vector” representing the i-th document, based on bag-of-words  and with respect to a word vocabulary of size d.  We are interested in fitting a GMM model onto  this dataset.

(a)  An individual cluster is described by a vector of word occurrence probabilities µ where µj describes the probability of a word in a document to be the j-th word in the vocabulary. Give a formula of the probability p(x|µ) of a count vector x given word occurrence probabilities µ and give a brief explanation of the formula (one to two sentences). Hint: remember that, for simplicity, we assumed the individual counts to be independent (2 marks).

(b) Write down the  Q-function”,  which is the basis of the Expectation-Maximization  (EM) algorithm for maximizing the log-likelihood.  Notice that you do not need to write the EM algorithm in this part.(3 marks)

(c) Write down the hard” Expectation-Maximization (EM) algorithm for estimating the param- eters of the model. If necessary, provide enough explanation to understand the algorithm that you have written.(4 marks)

Neural Networks

6     Forward and Backward Propagation (9 marks)

Given a neural network f(·) and a dataset D  =  {(x1 ,y 1 ), (x2 ,y2 ), ..., (xn ,yn )} where xi  is a 2- dimensional vector and yi is a scalar value which represents the target. {w1 ,w2 , ...,wn } are learnable parameters. h represents a linear unit. For example ti  = h1 w7 +h2 w8 . The error function for training this neural network is the sum of squared error

N

E(w) =   (yi ti )2   ,

n=1

(a)  Suppose we have a sample x, where x1 =0.5, x2 =0.6. The network parameters are

w1 =2, w2 =3

w3 =2, w4 =1.5

w5

w5 =3, w6 =4

w7 =6, w8 =3

Next, let’s suppose the target value y for this example is 4.  Write down the forward steps and the prediction error for this given sample.   Hint:   you  need  to  write  down  the  detailed computational steps .

(b)  Given the prediction error in the previous question, calculate the gradient of w1 , namely

E

w1

Please also write down all involved derivatives.

Scalable Machine Learning

7    Scalable Machine Learning (4 marks)

Suppose we would like to have a Map-Reduce distributed version of K-means algorithm. We define the centre of the k-th cluster as µk . Assume we have K clusters and M mappers in total.

(a) Which quantities should be computed in each mapper (the map step)?  Hint:  You can define the number of data points in the k -th cluster and m-th mapper as nkm .

(b)  Describe the procedure of the reducer (the reduce step) for updating the parameters using the quantities sent by the mapper.