Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

COMP 551 Applied Machine Learning Midterm 2 Exam sample questions and answers 2025 McGill University

Rating
-
Sold
-
Pages
12
Grade
A+
Uploaded on
06-11-2025
Written in
2025/2026

COMP 551 Applied Machine Learning Midterm 2 Exam sample questions and answers 2025 McGill University Name: Student ID number: 1 Multiple-choice questions (30 points) 1. (5 points) Suppose we know that apriori majority of the input features are irrelevant to the target label. Which method will likely perform the worst when using all features for prediction? A. KNN B. Decision tree C. Logistic regression 2. (5 points) After training a binary classifier that can produce probability for the positive class, what threshold guarantees to produce 100% Recall Rate on the test data? Note we set the predicted class to 1 if the model predicted probability is greater than the threshold. A. -1 B. 0.01 C. 0.5 D. 1 E. 2 3. (5 points) Suppose you have a hate-speech detection model to detect hate-speech in online com- ments (hate-speech = 1, normal = 0). Training was successful and you have a pretty good model which performs much better than random but is less than perfect. You can control the threshold pa- rameter α such that if you label a comment as hate-speech if p(hate-speech|comment) α. If you increase α, what happens to the model’s precision and recall? Select one for each of precision and recall? A. recall decreases; precision decreases B. recall decreases; precision increases C. recall increases; precision decreases D. recall increases; precision increases

Show more Read less
Institution
McGill COMP 551
Course
McGill COMP 551

Content preview

COMP 551 Applied Machine Learning Midterm 2 Exam sample
questions and answers 2025 McGill University


Name:

Student ID number:



• You have 60 minutes to write the exam.
• Hard-copies notes, books, and printed slides are allowed but electronic devices are NOT allowed.
• This exam contains 16 questions on 12 pages.
• 6 multiple-choice questions: circle only ONE correct answer per question.
• 4 multiple-select questions, circle ALL correct answers per question. Scoring: Right minus Wrong.
• 6 short-answer questions: write your answer directly below each question.
• Advice: Try not to spend too much time searching answers through your notes as it will slow you
down and you will not have enough time to complete this exam in 1 hour. Good luck!




1 Multiple-choice questions (30 points)
1. (5 points) Suppose we know that apriori majority of the input features are irrelevant to the target label.
Which method will likely perform the worst when using all features for prediction?
A. KNN
B. Decision tree
C. Logistic regression


Solution: KNN will perform the worst as the distance function takes into account all features. DT
and LR will perform relatively well as they have internal feature selection.


2. (5 points) After training a binary classifier that can produce probability for the positive class, what
threshold guarantees to produce 100% Recall Rate on the test data? Note we set the predicted class
to 1 if the model predicted probability is greater than the threshold.
A. -1
B. 0.01
C. 0.5
D. 1

, E. 2


Solution: For Recall or TPR=TP/(TP+FN), we can have TPR equal to 1 when the threshold is
-1. That is, every data point is predicted to be positive and have zero false negative.


3. (5 points) Suppose you have a hate-speech detection model to detect hate-speech in online com-
ments (hate-speech = 1, normal = 0). Training was successful and you have a pretty good model
which performs much better than random but is less than perfect. You can control the threshold pa-
rameter α such that if you label a comment as hate-speech if p(hate-speech|comment) > α. If you
increase α, what happens to the model’s precision and recall? Select one for each of precision and
recall?
A. recall decreases; precision decreases
B. recall decreases; precision increases
C. recall increases; precision decreases
D. recall increases; precision increases


Solution: Increasing α increases the number of negatives, both TN and FN, and decreases the
number of positives, both TP and FP, if the model does better than chance FP should be reduces

increase. 2.5 pts for each.


4. (5 points) What loss does the estimate ŵ = (X⊤X)−1X⊤y minimize?

A. J(w) = (n) − ŷ (n) ) 2 , where yˆ(n) = x(n)w
n(y
Σ
B. J(w) = n |y(n) − ŷ (n) |, where yˆ(n) = x(n)w
Σ
C. J(w) = n(y(n) − ŷ (n) ) 2 , where yˆ(n) = x(n)w
Σ
D. J(w) = n −y(n) log yˆ(n) − (1 − y(n)) log(1 − ŷ (n) ), where yˆ(n) = 1+exp(−x
1 (n)
w)

5. (5 points) Which of the following methods can only be trained using gradient decent?
A. Decision tree
B. Linear regression
C. Linear regression with basis transformed features
D. Logistic regression


Solution: DT are not trained by GD. Linear regression and linear regression with basis-transformed
feature can be fit by analytical solution. Only Logistic regression can only be trained with GD.


6. (5 points) For C = 3 classes and D = 2 features, what is the class probabilities for input x = [1 0],
when using a multiclass regression with the following weights (assuming natural log ln):

0 ln 3 0
W =
ln 3 0 ln 4
A. [1/3, 1/3, 1/3]

Written for

Institution
McGill COMP 551
Course
McGill COMP 551

Document information

Uploaded on
November 6, 2025
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$15.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
smartzone Liberty University
View profile
Follow You need to be logged in order to follow users or courses
Sold
3397
Member since
6 year
Number of followers
2296
Documents
14705
Last sold
13 hours ago
AMAIZING EDUCATION WORLD

GET ALL KIND OF EXAMS ON THIS PAGE ,COMPLETE TEST BANKS,SUMMARIES,STUDY GUIDES,PROJECT PAPERS,ASSIGNMENTS,CASE STUDIES, YOU CAN ALSO COMMUNICATE WITH THE SELLER FOR ANY PRE-ORDER,ORDER AND ETC.

3.6

613 reviews

5
271
4
96
3
109
2
32
1
105

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions