0% found this document useful (0 votes)
286 views13 pages

ML Quiz 1: Course Content

The document describes a graded machine learning quiz consisting of 10 multiple choice questions. The student scored 10/10 on the quiz by selecting the correct answer for each question. The questions covered topics such as: - Calculating conditional probabilities from given prior probabilities and accuracy rates - Effects of changing the k value in k-Nearest Neighbors (kNN) algorithms - Appropriate uses of KD Trees and Minkowski distance - Performance of Naive Bayes classifiers on specific datasets - Recall scores for different target classes when evaluating a Naive Bayes model on test data

Uploaded by

AbhijitSinha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
286 views13 pages

ML Quiz 1: Course Content

The document describes a graded machine learning quiz consisting of 10 multiple choice questions. The student scored 10/10 on the quiz by selecting the correct answer for each question. The questions covered topics such as: - Calculating conditional probabilities from given prior probabilities and accuracy rates - Effects of changing the k value in k-Nearest Neighbors (kNN) algorithms - Appropriate uses of KD Trees and Minkowski distance - Performance of Naive Bayes classifiers on specific datasets - Recall scores for different target classes when evaluating a Naive Bayes model on test data

Uploaded by

AbhijitSinha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Go Back to Machine Learning

Course Content

ML Quiz 1

Type : Graded Quiz

Attempts : 1/1

Questions : 10

Time : 45m

Due Date : Jan 30, 11:59 PM

Your Score : 10/10

Instructions

Attempt History

Attempt #1
Jan 30, 7:19
PM
Marks: 10

Q No: 1 Correct
Answer Marks:
1/1

It is estimated that 50% of emails are spam emails. Some software has been
applied to filter these spam emails before they reach your inbox. A certain brand
of software claims that it can detect 95% of spam emails and the probability for a
false positive (a non-spam email detected as spam) is 8%.

Now if an email is detected as spam, then what is the probability that it is in fact a
non-spam email?

1/8
0.077 You Selected

0.00004

0.892

0.034

P(Actual Spam) = 0.5 P(SD |Actual Spam) = 0.95 P(SD |Not Spam) = 0.08
(P(SD | Not Spam) * P(Not Spam)) / (P(SD |Not Spam) *P(Not Spam) + P(SD |Spam)
*P(Spam))

= (0.08 *0.5) /( (0.08*0.5) + (0.95*0.5) ) = 0.077

Correct Answer
Q No: 2
Marks:
1/1

A doctor knows that cold causes fever 55% of the time. The prior probability of
any patient having a cold is 1/51,000. The prior probability of any patient having a
fever is 1/25

If a patient has a fever, what’s the probability he/she has a cold?

0.000269 You Selected

0.222231

0.000002

0.022019
Given,

P(F) = 1/25 ; P(F |C) = 0.55 ; P (C) = 1/51000


P (C | F) = (P ( F | C) * P(C) ) / P(F) = 0.0002696

Q No: 3 Correct Answer


Marks:
1/1
On increasing k in kNN, the decision
boundary :

Gets Smoother You Selected

Decision boundary vanishes

Gets more complex

k does not affect the decision boundary

The only parameter that can adjust the complexity of KNN is the number of neighbors k. The larger k is, the sm

Correct Answer
Q No: 4
Marks:
1/1
Which of the following is true wrt. to kNN when the value of k=1 and infinity,
respectively:

High variance, high variance

high variance, low variance You Selected

Low variance, low variance

Low variance, high variance


Ans: Very high k has low variance unlike a very low k but is not useful for prediction.
Q No: 5 Correct Answer
Marks:
1/1
Which distance is a generalization of euclidean and manhattan
distances:
Minkowski distance You Selected

None of the mentioned

Mahalanobis distance

Cosine similarity

Correct Answer
Q No: 6
Marks:
1/1
Choose the most appropriate answer wrt the KD Tree nearest
Neighbour:

It is generally used when there are a very large number of data points in a lesser no of dimensions.

It is also a neighborhood search algorithm.

All of the mentioned. You Selected

It is computationally less expensive.

Ans: All are correct with respect to the KDT NN

Q No: 7 Correct Answer


Marks:
1/1
Select the true statement regarding
KNN:
Complex to implement and understand

It outputs a model and a new point is quickly calculated without actually calculating distances.

It can work on multi classes simultaneously. You Selected

It is not computationally intensive.

Ans: Whatever may be the classes in the neighborhood, KNn can work with them simultaneously and gives the

Q No: 8 Correct Answer


Marks:
1/1

To answer the below question, please follow the


instructions:

1. Load this dataset


2. Take the Target variable as 'default'
3. Do not scale the data
4. Split the data using test_size=0.30 and
random_state=1
5. Make a Naive Bayes model

What is the accuracy/Model Score of the model on the


Train set?

~0.6883

~0.7821

~0.9698 You Selected


~0.8377

x train x test y train y test = train test split(x y test size=0 30 random state=1)
model = GaussianNB() model.fit(x_train, y_train) y_predict = model.predict(x_test)
model_score = model.score(x_train, y_train) print(model_score)
0.9698924731182795

Q No: 9 Correct Answer


Marks:
1/1

To answer the below question, please follow the


instructions:

1. Load this dataset


2. Take the Target variable as 'default'
3. Do not scale the data
4. Split the data using test_size=0.30 and
random_state=1
5. Make a Naive Bayes model

What is the accuracy/Model Score of the model on the


Test set?

~0.9113

~0.9749 You Selected

~0.8932

~0.8327
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.30, random_state=1) model = GaussianNB()
model.fit(x_train, y_train) y_predict = model.predict(x_test)
model_score = model.score(x_test, y_test) print(model_score)
Q No: 10 Correct Answer
Marks:
1/1

To answer the below question, please follow the


instructions:

1. Load this dataset


2. Take the Target variable as 'default'
3. Do not scale the data
4. Split the data using test_size=0.30 and
random_state=1
5. Make a Naive Bayes model
6. Print a classification_report on test data.

What is the recall for target classes-No and Yes for the
test data?

1.00 and 0.12 You Selected

1.00 and 0.53

0.70 and 0.42

1.00 and 0.37

x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.30,


random_state=1)

model = GaussianNB()
model.fit(x_train, y_train)
test_predict =
model.predict(x_test)
print(metrics.classification_report(y_test, test_predict))
Comments:

+ Add comments

You might also like