1What is the main idea behind the -nearest neighbors method?
Lazy learning: Nearest neighbors
Easy
A.Classify a point using a fixed equation
B.Classify a point using random labels
C.Classify a point using only the oldest data
D.Classify a point using nearby labeled points
Correct Answer: Classify a point using nearby labeled points
Explanation:
-nearest neighbors classifies a new example based on the labels of the closest training examples.
Incorrect! Try again.
2In -nearest neighbors, what does represent?
Lazy learning: Nearest neighbors
Easy
A.The number of features in the dataset
B.The number of classes in the target
C.The number of training passes performed
D.The number of nearest examples considered
Correct Answer: The number of nearest examples considered
Explanation:
is the number of nearby training examples used to make a prediction.
Incorrect! Try again.
3Naïve Bayes is based mainly on which type of probability?
Naïve Bayes
Easy
A.Conditional probability
B.Sequential probability
C.Uniform probability
D.Geometric probability
Correct Answer: Conditional probability
Explanation:
Naïve Bayes uses conditional probabilities to estimate the probability of each class.
Incorrect! Try again.
4What simplifying assumption does Naïve Bayes make about features?
Naïve Bayes
Easy
A.Features must be measured in meters
B.Features are conditionally independent
C.Features always have equal values
D.Features contain no missing values
Correct Answer: Features are conditionally independent
Explanation:
Naïve Bayes assumes that features are conditionally independent given the class.
Incorrect! Try again.
5What is the basic structure of a decision tree?
Divide and Conquer: Decision Trees and Rules
Easy
A.Inputs, weights, and epochs
B.Vectors, margins, and kernels
C.Rows, columns, and cells
D.Nodes, branches, and leaves
Correct Answer: Nodes, branches, and leaves
Explanation:
Decision trees use nodes for tests, branches for outcomes, and leaves for final predictions.
Incorrect! Try again.
6In a decision tree, what does a leaf usually represent?
Divide and Conquer: Decision Trees and Rules
Easy
A.A final class prediction
B.A probability distribution only
C.A distance calculation
D.A feature measurement
Correct Answer: A final class prediction
Explanation:
A leaf is the endpoint of a decision path and usually gives the predicted class.
Incorrect! Try again.
7A decision rule commonly has which form?
Divide and Conquer: Decision Trees and Rules
Easy
A.For each row, remove a feature
B.If a condition, then an outcome
C.When a model ends, start training
D.While a condition, repeat a dataset
Correct Answer: If a condition, then an outcome
Explanation:
Classification rules commonly use an if-then format to connect conditions with class outcomes.
Incorrect! Try again.
8What does a support vector machine try to find for classification?
Support vector machine
Easy
A.A random sample of features
B.A table containing only labels
C.A boundary separating classes
D.A list of missing observations
Correct Answer: A boundary separating classes
Explanation:
An SVM finds a separating decision boundary, called a hyperplane, between classes.
Incorrect! Try again.
9In an SVM, what is the margin?
Support vector machine
Easy
A.The number of classes in the dataset
B.The distance around the separating boundary
C.The average value of the target
D.The percentage of missing values
Correct Answer: The distance around the separating boundary
Explanation:
The margin is the distance between the decision boundary and the closest training points.
Incorrect! Try again.
10What does classification accuracy measure?
Accuracy
Easy
A.The proportion of correct predictions
B.The size of the training dataset
C.The proportion of positive predictions
D.The number of input variables
Correct Answer: The proportion of correct predictions
Explanation:
Accuracy is calculated as the number of correct predictions divided by the total number of predictions.
Incorrect! Try again.
11If a classifier makes 90 correct predictions out of 100, what is its accuracy?
Accuracy
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
Accuracy is , which equals .
Incorrect! Try again.
12What does logarithmic loss evaluate?
Logarithmic Loss
Easy
A.The quality of predicted probabilities
B.The number of training features
C.The number of tree branches
D.The distance between data points
Correct Answer: The quality of predicted probabilities
Explanation:
Logarithmic loss evaluates how close predicted probabilities are to the actual class outcomes.
Incorrect! Try again.
13For logarithmic loss, which result is generally better?
Logarithmic Loss
Easy
A.A loss with no probability inputs
B.A loss equal to the sample size
C.A smaller loss value
D.A larger loss value
Correct Answer: A smaller loss value
Explanation:
Lower logarithmic loss indicates that the predicted probabilities are generally better calibrated and more accurate.
Incorrect! Try again.
14What does the area under the ROC curve measure?
Area Under Curve
Easy
A.How well classes are ranked
B.How many rows contain errors
C.How many features are selected
D.How quickly a tree is built
Correct Answer: How well classes are ranked
Explanation:
AUC measures how well a classifier distinguishes and ranks positive cases above negative cases.
Incorrect! Try again.
15What does an AUC value of usually indicate?
Area Under Curve
Easy
A.Perfect classification performance
B.Performance similar to random ranking
C.No positive examples in the data
D.A model with zero prediction errors
Correct Answer: Performance similar to random ranking
Explanation:
An AUC of generally means the classifier ranks examples no better than random chance.
Incorrect! Try again.
16Precision answers which question?
Precision
Easy
A.How many actual positives are found?
B.How many actual negatives are found?
C.How many predictions are correct overall?
D.How many predicted positives are correct?
Correct Answer: How many predicted positives are correct?
Explanation:
Precision is the fraction of predicted positive cases that are truly positive.
Incorrect! Try again.
17Recall is also commonly called which of the following?
Recall
Easy
A.Sensitivity
B.Error rate
C.Accuracy
D.Specificity
Correct Answer: Sensitivity
Explanation:
Recall, or sensitivity, measures the proportion of actual positive cases that are correctly identified.
Incorrect! Try again.
18The F1 score combines which two measures?
F1 Score
Easy
A.AUC and logarithmic loss
B.Mean and standard deviation
C.Accuracy and specificity
D.Precision and recall
Correct Answer: Precision and recall
Explanation:
The F1 score is the harmonic mean of precision and recall.
Incorrect! Try again.
19What information is shown in a confusion matrix?
Confusion Matrix
Easy
A.Actual and predicted class counts
B.Model parameters and learning rates
C.Feature names and data types
D.Training time and memory use
Correct Answer: Actual and predicted class counts
Explanation:
A confusion matrix compares actual classes with predicted classes, including correct and incorrect outcomes.
Incorrect! Try again.
20What is a true positive?
Confusion Matrix
Easy
A.A positive case incorrectly predicted as negative
B.A positive case correctly predicted as positive
C.A negative case incorrectly predicted as positive
D.A negative case correctly predicted as negative
Correct Answer: A positive case correctly predicted as positive
Explanation:
A true positive occurs when the actual class is positive and the model also predicts positive.
Incorrect! Try again.
21A 3-nearest neighbors classifier finds the three closest training instances with labels A, A, and B. Assuming uniform voting, how will the new instance be classified?
Lazy learning: Nearest neighbors
Medium
A.Both classes equally
B.Classification is impossible
C.Class A
D.Class B
Correct Answer: Class A
Explanation:
Class A receives two of the three votes, so the majority-vote prediction is A.
Incorrect! Try again.
22A dataset has two features: annual income measured in dollars and age measured in years. Before applying k-nearest neighbors with Euclidean distance, what is the most appropriate preprocessing step?
Lazy learning: Nearest neighbors
Medium
A.Sort examples by age
B.Convert labels to distances
C.Scale both features
D.Remove the income feature
Correct Answer: Scale both features
Explanation:
Without scaling, the numerically larger income values would dominate the Euclidean distance calculation.
Incorrect! Try again.
23For a message containing words and , a Naïve Bayes classifier uses , , and , where means spam. What quantity is proportional to the posterior probability of spam?
Naïve Bayes
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Naïve Bayes multiplies the class prior by the conditionally independent feature likelihoods.
Incorrect! Try again.
24In a text classifier, a word appears in a test document but never appeared in the training documents of one class. Which technique prevents that class probability from becoming zero?
Naïve Bayes
Medium
A.Cost-complexity pruning
B.Laplace smoothing
C.Min-max scaling
D.Majority voting
Correct Answer: Laplace smoothing
Explanation:
Laplace smoothing adds a small count to each word-class combination, preventing zero likelihoods.
Incorrect! Try again.
25A decision-tree node contains 40 positive and 40 negative examples. Split X produces two pure child nodes, while Split Y produces two child nodes with the same 50-50 class ratio as the parent. Which split has the larger information gain?
Divide and Conquer: Decision Trees and Rules
Medium
A.Neither can be measured
B.Split X
C.Both are equal
D.Split Y
Correct Answer: Split X
Explanation:
Split X completely removes class impurity, while Split Y leaves the impurity unchanged.
Incorrect! Try again.
26A fully grown decision tree achieves 100% training accuracy but performs poorly on validation data. Which modification is most likely to improve generalization?
Divide and Conquer: Decision Trees and Rules
Medium
A.Apply tree pruning
B.Remove stopping criteria
C.Duplicate training rows
D.Increase maximum depth
Correct Answer: Apply tree pruning
Explanation:
Pruning removes branches that capture training noise and can therefore reduce overfitting.
Incorrect! Try again.
27A root-to-leaf path in a decision tree tests Age > 30, then Income > 50000, and predicts Approve. Which rule correctly represents this path?
Divide and Conquer: Decision Trees and Rules
Medium
A.If neither condition holds, approve
B.If both conditions hold, approve
C.If either condition holds, approve
D.If income alone holds, approve
Correct Answer: If both conditions hold, approve
Explanation:
Conditions along one root-to-leaf path are joined by logical AND to form a classification rule.
Incorrect! Try again.
28Two linear classifiers separate the training data perfectly. Classifier M has a wider margin between the classes than classifier N. Which classifier would a standard hard-margin support vector machine prefer?
Support vector machine
Medium
A.Classifier M
B.Either with equal preference
C.Classifier N
D.Neither without probabilities
Correct Answer: Classifier M
Explanation:
A hard-margin SVM selects the separating hyperplane that maximizes the margin.
Incorrect! Try again.
29A dataset cannot be separated effectively by a straight line in its original feature space. Which SVM approach can create a nonlinear decision boundary without explicitly constructing all transformed features?
Support vector machine
Medium
A.Pruning method
B.Majority method
C.Kernel method
D.Bagging method
Correct Answer: Kernel method
Explanation:
The kernel method computes similarities in an implicit higher-dimensional feature space, enabling nonlinear boundaries.
Incorrect! Try again.
30A classifier produces , , , and . What is its accuracy?
Accuracy
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Accuracy is .
Incorrect! Try again.
31In a dataset where 98% of transactions are legitimate, a model predicts every transaction as legitimate and obtains 98% accuracy. What is the main limitation of using accuracy here?
Accuracy
Medium
A.It ignores class imbalance
B.It excludes correct negatives
C.It measures ranking quality
D.It requires probability outputs
Correct Answer: It ignores class imbalance
Explanation:
High accuracy can hide complete failure on the rare fraud class when the classes are strongly imbalanced.
Incorrect! Try again.
32For a binary example whose true class is positive, a model predicts a positive-class probability of . Approximately what is the logarithmic loss for this example?
Logarithmic Loss
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
For a positive example, log loss is .
Incorrect! Try again.
33Two models correctly classify the same positive example at a threshold of . Model A predicts , while Model B predicts . Which statement about their log losses is correct?
Logarithmic Loss
Medium
A.Loss depends only on threshold
B.Model A has lower loss
C.Both have equal loss
D.Model B has lower loss
Correct Answer: Model B has lower loss
Explanation:
For the true positive class, a higher assigned probability gives a smaller value of .
Incorrect! Try again.
34A classifier has an ROC AUC of . Which interpretation is most appropriate?
Area Under Curve
Medium
A.It is 82% accurate at every threshold
B.It predicts 82% of examples as positive
C.It ranks a random positive above a random negative about 82% of the time
D.It has precision equal to 82%
Correct Answer: It ranks a random positive above a random negative about 82% of the time
Explanation:
ROC AUC measures ranking ability across thresholds and can be interpreted using random positive-negative pairs.
Incorrect! Try again.
35Two positive examples receive scores and , while two negative examples receive scores and . Assuming no ties, what is the ROC AUC?
Area Under Curve
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
The positive score is higher in three of the four positive-negative comparisons, so AUC is .
Incorrect! Try again.
36A spam filter marks 40 messages as spam. Of these, 30 are actually spam. What is the filter's precision?
Precision
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Precision is .
Incorrect! Try again.
37A medical dataset contains 30 patients with a disease. A classifier correctly identifies 24 of them and misses 6. What is its recall for the disease class?
Recall
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Recall is .
Incorrect! Try again.
38A classifier has precision and recall . What is its F1 score?
F1 Score
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
The F1 score is .
Incorrect! Try again.
39In a disease-detection confusion matrix, an infected patient is classified as healthy. How is this prediction recorded?
Confusion Matrix
Medium
A.True positive
B.True negative
C.False positive
D.False negative
Correct Answer: False negative
Explanation:
The actual class is positive, but the model predicts negative, so the result is a false negative.
Incorrect! Try again.
40The decision threshold of a binary classifier is lowered from to . Assuming all predicted probabilities remain fixed, which change is generally expected in the confusion matrix?
Confusion Matrix
Medium
A.Both TN and FN may increase
B.Both TP and FP may increase
C.FP decreases while FN increases
D.TP decreases while TN increases
Correct Answer: Both TP and FP may increase
Explanation:
Lowering the threshold labels more cases as positive, which can convert false negatives to true positives and true negatives to false positives.
Incorrect! Try again.
41A one-dimensional training set contains , , , and . Using 1-nearest-neighbor classification with Euclidean distance, what is the leave-one-out cross-validation accuracy?
Lazy learning: Nearest neighbors
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
After excluding each point in turn, the points at and are misclassified, while those at and are classified correctly. Thus, accuracy is .
Incorrect! Try again.
42Independent, irrelevant binary features are appended to data used by a Euclidean -NN classifier. Each added feature is equally likely to match or differ between two observations. What is the most likely asymptotic effect as many such features are added?
Lazy learning: Nearest neighbors
Hard
A.Cross-validation always selects
B.Nearest distances approach zero while farthest distances diverge
C.Class boundaries become linear in the enlarged space
D.Nearest and farthest distances become relatively similar
Correct Answer: Nearest and farthest distances become relatively similar
Explanation:
Irrelevant dimensions add comparable amounts to most pairwise distances. Distance contrast decreases, so identifying meaningfully close neighbors becomes difficult.
Incorrect! Try again.
43A binary feature is duplicated exactly, and both copies are supplied to a Naïve Bayes classifier. Assuming no smoothing issues, what is the principal consequence?
Naïve Bayes
Hard
A.Its contribution disappears from the posterior
B.Its likelihood ratio is effectively counted twice
C.Its class-conditional probability becomes one-half
D.Its likelihood ratio is cancelled by normalization
Correct Answer: Its likelihood ratio is effectively counted twice
Explanation:
Naïve Bayes treats the copies as conditionally independent evidence, so their identical likelihood factors are multiplied. This can alter decisions and produce overconfident posteriors.
Incorrect! Try again.
44For classes and , suppose , , , , and . Under the Naïve Bayes assumption, what is ?
Naïve Bayes
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The unnormalized probabilities are and . Normalization gives .
Incorrect! Try again.
45A node contains positive and negative examples. A split produces children with class counts and , where each pair is (positive, negative). Using base-2 entropy, what is the information gain?
Divide and Conquer: Decision Trees and Rules
Hard
A.Approximately
B.Approximately
C.Approximately
D.Approximately
Correct Answer: Approximately
Explanation:
The parent entropy is . Each child has entropy , so the gain is .
Incorrect! Try again.
46A dataset contains all four combinations of two binary attributes , with target , and each combination occurs equally often. What happens if a greedy tree algorithm stops whenever no candidate split has positive information gain?
Divide and Conquer: Decision Trees and Rules
Hard
A.It stops at the root despite a perfect depth-2 tree
B.It requires a depth-3 tree to represent the target
C.It obtains positive gain only by duplicating the records
D.It selects either attribute and immediately classifies perfectly
Correct Answer: It stops at the root despite a perfect depth-2 tree
Explanation:
For XOR, either attribute alone leaves both child nodes perfectly balanced, giving zero immediate information gain. Splitting on both attributes would nevertheless classify every example correctly.
Incorrect! Try again.
47Positive examples are and , while negative examples are and . For a hard-margin linear SVM in canonical form , which parameters define the maximum-margin separator?
Support vector machine
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The separating boundary is . With and , negative points have score and positive points have score , satisfying canonical scaling.
Incorrect! Try again.
48Every training observation is duplicated exactly times in the soft-margin SVM objective , while is left unchanged. Relative to the original dataset, this is equivalent to using which penalty parameter?
Support vector machine
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Duplicating every observation multiplies the total hinge-loss term by without changing the regularizer. On the original data, this is equivalent to replacing with .
Incorrect! Try again.
49A classifier has sensitivity and specificity . It is deployed where the positive-class prevalence is . Assuming these rates remain stable, what is its expected accuracy?
Accuracy
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Expected accuracy is .
Incorrect! Try again.
50For three labels , the true label sets are , , and . Predictions are , , and . What is the multilabel subset accuracy?
Accuracy
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Subset accuracy requires an exact match of the complete label set. Only the second prediction matches exactly, so the result is .
Incorrect! Try again.
51For binary observations with labels , a model assigns positive-class probabilities . Using natural logarithms, what is the mean logarithmic loss?
Logarithmic Loss
Hard
A.Approximately
B.Approximately
C.Approximately
D.Approximately
Correct Answer: Approximately
Explanation:
The loss is . The confident error on the third observation contributes most of the loss.
Incorrect! Try again.
52Among observations with identical features, the true conditional positive rate is . Which constant predicted probability uniquely minimizes the expected binary logarithmic loss for these observations?
Logarithmic Loss
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Logarithmic loss is a strictly proper scoring rule. Its expected value is minimized when the reported probability equals the true conditional probability.
Incorrect! Try again.
53Three positive examples receive scores , and three negative examples receive scores . Treating a tied positive-negative pair as half a correct ranking, what is the ROC AUC?
Area Under Curve
Hard
A.Approximately
B.Approximately
C.Approximately
D.Approximately
Correct Answer: Approximately
Explanation:
Across positive-negative pairs, the positives obtain strict wins and one tie worth . Thus, .
Incorrect! Try again.
54A strictly increasing nonlinear transformation is applied to every classifier score. No scores were tied originally. Which statement is necessarily true?
Area Under Curve
Hard
A.ROC AUC remains unchanged
B.The optimal probability threshold remains unchanged
C.Logarithmic loss remains unchanged
D.The transformed scores remain calibrated
Correct Answer: ROC AUC remains unchanged
Explanation:
ROC AUC depends only on score ordering. A strictly increasing transformation preserves every ranking, although calibration, log loss, and numerical thresholds may change.
Incorrect! Try again.
55A classifier has true-positive rate and false-positive rate in a population with positive prevalence . What precision should be expected?
Precision
Hard
A.Approximately
B.Approximately
C.Approximately
D.Approximately
Correct Answer: Approximately
Explanation:
Precision is .
Incorrect! Try again.
56At one threshold, a classifier has and precision . After increasing the threshold, true positives decrease by and false positives decrease by . What is the new precision?
Precision
Hard
A.Approximately
B.Approximately
C.Approximately
D.Approximately
Correct Answer: Approximately
Explanation:
Initial precision implies . The new counts are and , giving precision .
Incorrect! Try again.
57For a fixed set of continuously scored observations, the positive decision threshold is lowered without changing any scores. Which statement about positive-class recall is necessarily correct?
Recall
Hard
A.Recall must strictly increase
B.Recall remains exactly constant
C.Recall cannot decrease
D.Recall changes only if precision increases
Correct Answer: Recall cannot decrease
Explanation:
Lowering the threshold can convert false negatives into true positives but cannot convert existing true positives into false negatives. Recall may remain unchanged if no positive score crosses the threshold.
Incorrect! Try again.
58A classifier has precision and F1 score . What must its recall be?
F1 Score
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Using gives , so .
Incorrect! Try again.
59A three-class confusion matrix has rows as actual classes and columns as predicted classes: What is the macro-averaged F1 score?
Confusion Matrix
Hard
A.Approximately
B.Approximately
C.Approximately
D.Approximately
Correct Answer: Approximately
Explanation:
The classwise F1 scores are , , and . Their unweighted mean is approximately .
Incorrect! Try again.
60A test set has observations and positive prevalence . A classifier has recall and precision . Which confusion matrix counts are correct?
Confusion Matrix
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
There are actual positives. Recall gives and . Precision gives , leaving .
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →