Unit 8: Supervised Learning - Practice Quiz

ECAP792 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the main goal of a classification algorithm?

Introduction to classification algorithms Easy
A. Calculate the average of all values
B. Compress data into smaller files
C. Assign data to predefined categories
D. Arrange data in chronological order

2 Which type of variable does a classification model usually predict?

Introduction to classification algorithms Easy
A. A categorical target variable
B. A database identifier variable
C. A random indexing variable
D. A continuous measurement variable

3 Which task is an example of binary classification?

Introduction to classification algorithms Easy
A. Predicting whether an email is spam
B. Grouping customers without known labels
C. Calculating the mean monthly income
D. Predicting a person's exact height

4 In supervised classification, what does the training dataset contain?

Introduction to classification algorithms Easy
A. Input features and known class labels
B. Random values without any structure
C. Only input features without labels
D. Only class labels without features

5 What is multiclass classification?

Introduction to classification algorithms Easy
A. Regression involving several numeric outputs
B. Classification using more than two datasets
C. Classification involving more than two classes
D. Clustering involving exactly two groups

6 What does the letter represent in KNN?

KNN (k-nearest neighbors) algorithm Easy
A. The number of dataset columns
B. The number of neighbors considered
C. The number of target classes
D. The number of training rounds

7 How does KNN commonly assign a class to a new observation?

KNN (k-nearest neighbors) algorithm Easy
A. By selecting the least frequent class
B. By taking a vote among nearby neighbors
C. By choosing a class at random
D. By averaging all target class names

8 Which measure is commonly used by KNN to identify nearby observations?

KNN (k-nearest neighbors) algorithm Easy
A. Cross-validation score
B. Classification accuracy
C. Euclidean distance
D. Correlation coefficient

9 Why is feature scaling often useful before applying KNN?

KNN (k-nearest neighbors) algorithm Easy
A. It converts classification into regression
B. It automatically creates additional class labels
C. It removes the need to choose
D. It prevents large-scale features from dominating distance

10 What does KNN need to retain when making predictions?

KNN (k-nearest neighbors) algorithm Easy
A. The stored training observations
B. Only the final accuracy score
C. The folds from cross-validation
D. Only the names of the features

11 Naïve Bayes is based on which mathematical theorem?

Naïve Bayes algorithm Easy
A. The central limit theorem
B. Pythagoras' theorem
C. Bayes' theorem
D. Taylor's theorem

12 What simplifying assumption does Naïve Bayes make about features?

Naïve Bayes algorithm Easy
A. Features must be arranged alphabetically
B. Features must always have identical values
C. Features are conditionally independent given the class
D. Features are unrelated to every class

13 Which application commonly uses Naïve Bayes?

Naïve Bayes algorithm Easy
A. Database table sorting
B. Email spam classification
C. Image file compression
D. Screen brightness adjustment

14 How does Naïve Bayes usually select a predicted class?

Naïve Bayes algorithm Easy
A. It chooses the class with the lowest prior probability
B. It chooses the class with the longest label
C. It chooses the class with the fewest features
D. It chooses the class with the highest posterior probability

15 What is a prior probability in Naïve Bayes?

Naïve Bayes algorithm Easy
A. The probability of a class before observing features
B. The distance between two neighboring observations
C. The fraction of predictions that are incorrect
D. The number of folds used during validation

16 What is the main purpose of cross-validation?

Cross-validation and metrics Easy
A. To remove every incorrect prediction
B. To increase the number of target classes
C. To estimate performance on unseen data
D. To replace all training observations

17 In -fold cross-validation, how many subsets is the dataset divided into?

Cross-validation and metrics Easy
A. subsets
B. subsets
C. subsets
D. subsets

18 What does classification accuracy measure?

Cross-validation and metrics Easy
A. The number of features used by the model
B. The time required to collect the data
C. The proportion of predictions that are correct
D. The distance between training observations

19 What information does a confusion matrix summarize?

Cross-validation and metrics Easy
A. Distances compared across neighboring points
B. Training times compared across computers
C. Predicted classes compared with actual classes
D. Feature values compared with their averages

20 What does precision measure in binary classification?

Cross-validation and metrics Easy
A. The fraction of all predictions that are correct
B. The fraction of predicted positives that are correct
C. The fraction of actual positives that are identified
D. The fraction of actual negatives that are missed

21 A model predicts the probability that a customer will cancel a subscription. If the classification threshold is increased from to , what is the most likely effect?

Introduction to classification algorithms Medium
A. The model will automatically become more accurate
B. Fewer customers will be classified as likely to cancel
C. Every predicted probability will increase by
D. More customers will be classified as likely to cancel

22 Which task is most appropriately treated as a multiclass classification problem?

Introduction to classification algorithms Medium
A. Predicting whether a transaction is fraudulent
B. Predicting a flower's species from three species
C. Predicting the selling price of a house
D. Predicting the number of website visits

23 A classifier performs very well on its training data but poorly on unseen test data. What is the most likely explanation?

Introduction to classification algorithms Medium
A. The model is overfitting the training data
B. The decision threshold equals
C. The model is underfitting the training data
D. The target variable has been standardized

24 A binary classifier outputs for an observation. Using a threshold of , which class is assigned?

Introduction to classification algorithms Medium
A. Class , because
B. Class , because probabilities are rounded
C. Class , because
D. Class , because

25 A KNN classifier uses Euclidean distance on age, measured from to , and annual income, measured from to . What should be done before training?

KNN (k-nearest neighbors) algorithm Medium
A. Sort all observations by annual income
B. Convert both features into class labels
C. Remove the feature with the smaller range
D. Scale both features to comparable ranges

26 For a binary KNN classifier, the five nearest neighbors have labels . What class is predicted using unweighted voting?

KNN (k-nearest neighbors) algorithm Medium
A. Class , because it has three votes
B. Class , because it appears first
C. Class , because it has two votes
D. Class , because it appears last

27 What is the usual effect of increasing from to a much larger value in a KNN classifier?

KNN (k-nearest neighbors) algorithm Medium
A. The model stores fewer training observations
B. The boundary becomes smoother with higher bias
C. The distance metric becomes unnecessary
D. The boundary becomes rougher with lower bias

28 A KNN model gives too much influence to distant neighbors within the selected neighborhood. Which modification best addresses this issue?

KNN (k-nearest neighbors) algorithm Medium
A. Assign every observation a unique class
B. Weight votes by inverse distance
C. Replace distances with random values
D. Increase every feature by one unit

29 Why does KNN often perform poorly when a dataset contains many irrelevant features?

KNN (k-nearest neighbors) algorithm Medium
A. Class labels become continuous in high dimensions
B. Irrelevant features always create missing values
C. Distances become less informative in high dimensions
D. KNN requires exactly two input features

30 The term "naive" in Naive Bayes refers to which modeling assumption?

Naïve Bayes algorithm Medium
A. Features must follow identical distributions
B. Classes always have equal prior probabilities
C. Predictions must use a threshold of
D. Features are conditionally independent given the class

31 A spam filter has , , and . Before normalization, which value is proportional to ?

Naïve Bayes algorithm Medium
A.
B.
C.
D.

32 In a multinomial Naive Bayes text classifier, a word appears in a test document but never appeared in training documents of one class. What prevents the class probability from becoming zero?

Naïve Bayes algorithm Medium
A. Laplace smoothing of feature counts
B. Standardization of document lengths
C. Removal of all repeated words
D. Conversion of counts into labels

33 Which Naive Bayes variant is generally most suitable when features are continuous measurements such as height and weight?

Naïve Bayes algorithm Medium
A. Bernoulli Naive Bayes
B. Multinomial Naive Bayes
C. Categorical Naive Bayes
D. Gaussian Naive Bayes

34 Two classes have identical feature likelihoods for a particular observation, but class has a larger prior probability than class . Which prediction will Naive Bayes make?

Naïve Bayes algorithm Medium
A. A random class, because likelihoods match
B. Class , because its prior is smaller
C. Class , because its posterior is larger
D. Both classes, because classification is multilabel

35 In -fold cross-validation, how many times is each observation normally used for validation?

Cross-validation and metrics Medium
A. Five times
B. Once
C. Twice
D. Four times

36 A medical screening classifier should avoid missing patients who actually have a condition. Which metric should receive the most attention?

Cross-validation and metrics Medium
A. Recall for the positive class
B. Specificity for the negative class
C. Precision for the positive class
D. Overall prediction accuracy

37 A classifier produces true positives and false positives. What is its precision?

Cross-validation and metrics Medium
A.
B.
C.
D.

38 A dataset contains negative cases and positive cases. A model predicts every case as negative. Why is its accuracy misleading?

Cross-validation and metrics Medium
A. It produces too many false-positive cases
B. It requires fewer cross-validation folds
C. It correctly identifies every positive case
D. It fails to identify any positive cases

39 Why is stratified cross-validation preferred for an imbalanced classification dataset?

Cross-validation and metrics Medium
A. It guarantees perfect scores on each fold
B. It removes the need for a test set
C. It places all minority cases in one fold
D. It preserves class proportions across folds

40 A classifier has precision and recall . What is its score?

Cross-validation and metrics Medium
A.
B.
C.
D.

41 A binary classifier outputs a calibrated posterior probability . A false positive costs 2 units, a false negative costs 8 units, and correct predictions cost 0. Which decision rule minimizes conditional expected cost?

Introduction to classification algorithms Hard
A. Predict 1 when
B. Predict 1 when
C. Predict 1 when
D. Predict 1 when

42 A classifier trained with positive-class prior outputs . At deployment, only the class prior changes to ; the class-conditional feature distributions remain unchanged. What is the adjusted posterior probability?

Introduction to classification algorithms Hard
A.
B.
C.
D.

43 A classifier's real-valued score is transformed by a strictly increasing nonlinear function. No ties are introduced. Which statement is necessarily true?

Introduction to classification algorithms Hard
A. Its ROC curve and AUC remain unchanged
B. Its probability calibration remains unchanged
C. Its accuracy at threshold remains unchanged
D. Its log-loss on every observation remains unchanged

44 A multiclass classifier provides calibrated posteriors. A correct prediction costs 0, an incorrect prediction costs 1, and abstaining costs . Let be the largest class posterior. When is abstention strictly optimal?

Introduction to classification algorithms Hard
A. When
B. When
C. When
D. When

45 Three one-vs-one classifiers produce , , and for the same observation. What follows from these pairwise outcomes alone?

Introduction to classification algorithms Hard
A. Class is uniquely selected by majority voting
B. No unique class follows without an aggregation rule
C. Class is uniquely selected by score averaging
D. Class is uniquely selected by transitivity

46 A KNN model uses Euclidean distance with features age in years and annual income in dollars. Income has a far larger numeric range, although both features are equally relevant. What is the most defensible preprocessing step?

KNN (k-nearest neighbors) algorithm Hard
A. Scale both features using training-fold statistics only
B. One-hot encode both continuous features before fitting
C. Rank-transform labels before calculating neighbor distances
D. Normalize each observation to have unit vector length

47 Assume every pairwise feature distance is distinct. Which quantity exactly equals the leave-one-out cross-validation error of a 1-NN classifier on a training set?

KNN (k-nearest neighbors) algorithm Hard
A. The fraction belonging to the training set's minority class
B. The fraction whose nearest other point has the same label
C. The fraction whose nearest other point has a different label
D. The resubstitution error obtained by retaining each point itself

48 A distance-weighted 3-NN classifier uses weights . The neighbors are class A at distances and , and class B at distance . Which class is predicted?

KNN (k-nearest neighbors) algorithm Hard
A. Class A because its nearest distance average is smaller
B. A tie because both classes have total weight four
C. Class A because it has two of the three neighbors
D. Class B because its total weight is four rather than three

49 Under standard regularity conditions, which asymptotic choice of supports consistency of KNN as the sample size grows?

KNN (k-nearest neighbors) algorithm Hard
A. while stays bounded
B. for every
C. while
D. for every

50 Two observations have independent irrelevant binary coordinates, each distributed as Bernoulli. For squared Euclidean distance over these coordinates, what is the coefficient of variation?

KNN (k-nearest neighbors) algorithm Hard
A.
B.
C.
D.

51 In multinomial Naïve Bayes, the prior odds for classes and are . A token occurs three times and has probabilities under and under . All other token contributions cancel. What are the posterior odds?

Naïve Bayes algorithm Hard
A. in favor of class
B. in favor of class
C. in favor of class
D. in favor of class

52 A Bernoulli Naïve Bayes model has equal class priors. For an observation, and . The probabilities are in class and in class . What is predicted?

Naïve Bayes algorithm Hard
A. Class because its likelihood is rather than
B. Class because the present feature has probability
C. A tie because the class priors are equal
D. Class because its joint likelihood is

53 A one-feature Gaussian Naïve Bayes model has equal priors and class means of 0. Class A has variance 1, and class B has variance 4. For , what does the model predict?

Naïve Bayes algorithm Hard
A. Class B;
B. A tie;
C. Class A;
D. Neither; the ratio depends on training sample size

54 In multinomial Naïve Bayes, a class contains 20 total token occurrences over a vocabulary of size 100. A particular token is absent from that class. With additive smoothing , what probability is assigned to the token?

Naïve Bayes algorithm Hard
A.
B.
C.
D.

55 An informative binary feature is duplicated exactly and both copies are supplied to Naïve Bayes. Which effect is most accurate?

Naïve Bayes algorithm Hard
A. Its evidence is counted twice, potentially changing posterior calibration and the predicted class
B. It is merged into one sufficient statistic, preserving all posterior probabilities exactly
C. It changes only class priors, leaving conditional likelihoods and predictions exactly unchanged
D. It is automatically discarded because its empirical probabilities match the original feature

56 A researcher compares 50 hyperparameter settings and reports the best mean score from the same 10-fold cross-validation used for selection. Which procedure best estimates generalization performance without selection bias?

Cross-validation and metrics Hard
A. Average only the three highest scores from the original folds
B. Select the setting on all data and report its resubstitution score
C. Increase the same cross-validation run from 10 folds to 20 folds
D. Use inner folds for selection and outer folds for performance estimation

57 A dataset contains multiple measurements from each patient, and the goal is to predict outcomes for entirely unseen patients. Which cross-validation design is appropriate?

Cross-validation and metrics Hard
A. Assign all measurements from each patient to the same fold
B. Randomly distribute every patient's measurements across all folds
C. Stratify individual measurements while ignoring patient identity
D. Sort measurements by outcome before assigning alternating folds

58 A classifier has sensitivity and false-positive rate in a population where prevalence is . Assuming these rates transfer to that population, what is its precision?

Cross-validation and metrics Hard
A. Approximately
B. Approximately
C. Approximately
D. Approximately

59 A classifier has , , , and . What is its Matthews correlation coefficient?

Cross-validation and metrics Hard
A. Approximately
B. Approximately
C. Approximately
D. Approximately

60 A decision threshold is chosen to maximize F1 using the combined out-of-fold predictions from a cross-validation run. The maximum F1 on those same predictions is then reported. What is the main problem?

Cross-validation and metrics Hard
A. Out-of-fold probabilities cannot be used to select any classification threshold
B. F1 is invariant to thresholds, so the maximization has no statistical meaning
C. Combining predictions forces every fold to have identical class prevalence
D. Threshold selection reuses evaluation data and makes the reported maximum optimistic