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. Compress data into smaller files
B. Calculate the average of all values
C. Arrange data in chronological order
D. Assign data to predefined categories

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

Introduction to classification algorithms Easy
A. A database identifier variable
B. A categorical target 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. Calculating the mean monthly income
B. Predicting whether an email is spam
C. Predicting a person's exact height
D. Grouping customers without known labels

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. Clustering involving exactly two groups
B. Classification involving more than two classes
C. Regression involving several numeric outputs
D. Classification using more than two datasets

6 What does the letter represent in KNN?

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

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

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

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

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

9 Why is feature scaling often useful before applying KNN?

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

10 What does KNN need to retain when making predictions?

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

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

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

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

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

13 Which application commonly uses Naïve Bayes?

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

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

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

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

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

16 What is the main purpose of cross-validation?

Cross-validation and metrics Easy
A. To increase the number of target classes
B. To estimate performance on unseen data
C. To remove every incorrect prediction
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 distance between training observations
B. The time required to collect the data
C. The number of features used by the model
D. The proportion of predictions that are correct

19 What information does a confusion matrix summarize?

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

20 What does precision measure in binary classification?

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

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. More customers will be classified as likely to cancel
C. Every predicted probability will increase by
D. Fewer 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 a flower's species from three species
B. Predicting whether a transaction is fraudulent
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 target variable has been standardized
C. The decision threshold equals
D. The model is underfitting the training data

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. Convert both features into class labels
B. Scale both features to comparable ranges
C. Sort all observations by annual income
D. Remove the feature with the smaller range

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 two votes
B. Class , because it appears last
C. Class , because it appears first
D. Class , because it has three votes

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 boundary becomes smoother with higher bias
B. The boundary becomes rougher with lower bias
C. The model stores fewer training observations
D. The distance metric becomes unnecessary

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. Replace distances with random values
C. Weight votes by inverse distance
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. Distances become less informative in high dimensions
B. Class labels become continuous in high dimensions
C. Irrelevant features always create missing values
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. Classes always have equal prior probabilities
B. Features are conditionally independent given the class
C. Predictions must use a threshold of
D. Features must follow identical distributions

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. Removal of all repeated words
B. Conversion of counts into labels
C. Laplace smoothing of feature counts
D. Standardization of document lengths

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. Gaussian Naive Bayes
C. Multinomial Naive Bayes
D. Categorical 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 posterior is larger
C. Class , because its prior is smaller
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. Once
B. Four times
C. Twice
D. Five 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. Specificity for the negative class
B. Overall prediction accuracy
C. Recall for the positive class
D. Precision for the positive class

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 fails to identify any positive cases
D. It correctly identifies every positive case

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

Cross-validation and metrics Medium
A. It removes the need for a test set
B. It guarantees perfect scores on each fold
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 log-loss on every observation remains unchanged
C. Its probability calibration remains unchanged
D. Its accuracy at threshold 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. No unique class follows without an aggregation rule
B. Class is uniquely selected by transitivity
C. Class is uniquely selected by majority voting
D. Class is uniquely selected by score averaging

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. Normalize each observation to have unit vector length
C. One-hot encode both continuous features before fitting
D. Rank-transform labels before calculating neighbor distances

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 whose nearest other point has a different label
B. The fraction whose nearest other point has the same label
C. The resubstitution error obtained by retaining each point itself
D. The fraction belonging to the training set's minority class

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. Class A because it has two of the three neighbors
C. A tie because both classes have total weight four
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
B. while stays bounded
C. for every
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 its joint likelihood is
C. Class because the present feature has probability
D. A tie because the class priors are equal

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. Neither; the ratio depends on training sample size
B. Class A;
C. Class B;
D. A tie;

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. It changes only class priors, leaving conditional likelihoods and predictions exactly unchanged
B. Its evidence is counted twice, potentially changing posterior calibration and the predicted class
C. It is merged into one sufficient statistic, preserving all posterior probabilities exactly
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. Select the setting on all data and report its resubstitution score
B. Use inner folds for selection and outer folds for performance estimation
C. Increase the same cross-validation run from 10 folds to 20 folds
D. Average only the three highest scores from the original folds

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. Stratify individual measurements while ignoring patient identity
B. Assign all measurements from each patient to the same fold
C. Randomly distribute every patient's measurements across all folds
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. Combining predictions forces every fold to have identical class prevalence
B. Threshold selection reuses evaluation data and makes the reported maximum optimistic
C. Out-of-fold probabilities cannot be used to select any classification threshold
D. F1 is invariant to thresholds, so the maximization has no statistical meaning