# M14 Practice Exam Problems

📗 Enter your ID (the wisc email ID without @wisc.edu) here: and click (or hit enter key)

📗 The same ID should generate the same set of questions. Your answers are not saved when you close the browser. You could print the page: , solve the problems, then enter all your answers at the end.
📗 Please do not refresh the page: your answers will not be saved.

# ID: test


# Question 1

📗 [4 points] Given two items x1 = 8 and x2 = 2, suppose the feature map for a kernel SVM (Support Vector Machine) is φ(x) = [exp(x)xx], what is the kernel (Gram) matrix?
📗 Answer (matrix with multiple lines, each line is a comma separated vector): .

# Question 2

📗 [4 points] Given the counts, find the maximum likelihood estimate of P{A=1|B+C=s}, for s = 2.
A B C counts
0 0 0 5
0 0 1 10
0 1 0 4
0 1 1 4
1 0 0 3
1 0 1 5
1 1 0 2
1 1 1 8

📗 Answer: .

# Question 3

📗 [4 points] Given the following training data, what is the 6 fold cross validation accuracy if 1NN (Nearest Neighbor) classifier with Manhattan distance is used. The first fold is the first 1 instances, the second fold is the next 1 instances, etc. Break the tie (in distance) by using the instance with the smaller index. Enter a number between 0 and 1.
xi 8 5 4 3 1 10
yi 1 0 0 1 1 0

📗 Answer: .

# Question 4

📗 [4 points] If P{A|B} is 6 times the value of P{B|A}, and P{A} = 0.4. What is P{B}?
📗 Answer: .

# Question 5

📗 [4 points] Consider a linear model ai=wxi+b, with the cross entropy cost function C = yiln(ai)(1yi)ln(1ai). The initial weight is [wb] = [41]. What is the updated weight and bias after one (stochastic) gradient descent step if the chosen training data is x = 5, y = 0? The learning rate is 3.
📗 Answer (comma separated vector): .

# Question 6

📗 [4 points] What is the convolution between the image [9410333517] and the filter [000010001] using zero padding? Remember to flip the filter first.
📗 Answer (matrix with multiple lines, each line is a comma separated vector): .

# Question 7

📗 [4 points] A convolutional neural network has input image of size 84 x 84 that is connected to a convolutional layer that uses a 7 x 7 filter, zero padding of the image, and a stride of 1. There are 2 activation maps. (Here, zero-padding implies that these activation maps have the same size as the input images.) The convolutional layer is then connected to a pooling layer that uses 3 x 3 max pooling, a stride of 3 (non-overlapping, no padding) of the convolutional layer. The pooling layer is then fully connected to an output layer that contains 4 output units. There are no hidden layers between the pooling layer and the output layer. How many different weights must be learned in this whole network, not including any bias.
📗 Answer: .

# Question 8

📗 [4 points] In a convolutional neural network, suppose the activation map of a convolution layer is [8210435185209910610]. What is the activation map after a non-overlapping (stride 2) 2 by 2 average-pooling layer?
📗 Answer (matrix with multiple lines, each line is a comma separated vector): .

# Question 9

📗 [4 points] Given the following transition matrix for a bigram model with words "I", "am" and "Groot": [0.380.20.420.330.370.30.350.130.52]. Row i column j is P{wt=j|wt1=i}. What is the probability that the third word is "am" given the first word is "am"?
📗 Answer: .

# Question 10

📗 [4 points] What is the gradient magnitude of the center element (pixel) of the image [8210435185]. Use the x gradient filter: [101], and the y gradient filter: [101]. Remember to flip the filters.
📗 Answer: .

# Question 11

📗 [4 points] In a problem where each example has 10 real-valued attributes (i.e. features), where each attribute can be split at 3 possible thresholds (i.e. binary splits), to select the best attribute for a decision tree node at depth 6, where the root is at depth 0, how many conditional entropies must be calculated (at most)?
📗 Answer: .

# Question 12

📗 [3 points] Let a dataset consist of n = 6 points in R, specifically, the first n1 points are [432810] and the last point xn is unknown. What is the smallest value of xn above which xn1 is among xn's 3-nearest neighbors, but xn is NOT among xn1's 3-nearest neighbor? Note that the 3-nearest neighbors of a point in the training set include the point itself.
📗 Answer: .

# Question 13

📗 [3 points] Assume the prior probability of having a female child (girl) is the same as having a male child (boy) and both are 0.5. The Smith family has 5 kids. One day you saw one of the Smith children, and she is a girl. The Wood family has 5 kids, too, and you heard that at least one of them is a girl. What is the chance that the Smith family has a boy? What is the chance that the Wood family has a boy?
📗 Answer (comma separated vector): .

# Question 14

📗 [5 points] Andy is a three-month old baby. He can be happy (state 0), hungry (state 1), or having a wet diaper (state 2). Initially when he wakes up from his nap at 1pm, he is happy. If he is happy, there is a 0.38 chance that he will remain happy one hour later, a 0.2 chance to be hungry by then, and a 0.42 chance to have a wet diaper. Similarly, if he is hungry, one hour later he will be happy with 0.33 chance, hungry with 0.37 chance, and wet diaper with 0.3 chance. If he has a wet diaper, one hour later he will be happy with 0.35 chance, hungry with 0.13 chance, and wet diaper with 0.52 chance. He can smile (observation 0) or cry (observation 1). When he is happy, he smiles 0.47 of the time and cries 0.53 of the time; when he is hungry, he smiles 0.5 of the time and cries 0.12 of the time; when he has a wet diaper, he smiles of the time and cries of the time.
What is the probability that the particular observed sequence cry, smile (or Y1,Y2 = 1, 0) happens (in the first two periods)?

Note: if the weights are not shown clearly, you could move the nodes around with mouse or touch.
📗 Answer: .

# Question 15

📗 [1 points] Please enter any comments including possible mistakes and bugs with the questions or your answers. If you have no comments, please enter "None": do not leave it blank.
📗 Answer: .


# Grade


 * * * *

 * * * * *


📗 You could save the text in the above text box to a file using the button or copy and paste it into a file yourself .
📗 You could load your answers from the text (or txt file) in the text box below using the button . The first two lines should be "##m: 14" and "##id: your id", and the format of the remaining lines should be "##1: your answer to question 1" newline "##2: your answer to question 2", etc. Please make sure that your answers are loaded correctly before submitting them.







Last Updated: April 09, 2025 at 11:27 PM