Supervised Learning MCQs for the NSCT

By the NSCT Exam Editorial Team · Updated 2026-11-24 · Facts checked against official sources on 2026-11-24

Supervised learning trains a model on examples that already carry the correct answer (a label), so it can predict that answer for new inputs: a number in regression, a category in classification. It is the sixth of the 17 topics in the AI / Machine Learning and Data Analytics area, which carries 10% of the NSCT according to HEC's Areas of Competencies.

Expect hand calculations (a regression prediction, a KNN distance, Gini or entropy) and diagnosis questions about overfitting and the choice of algorithm. Clean, scaled inputs from Data Collection & Pre-processing are assumed throughout.

Regression

Regression predicts a continuous value. Linear regression fits y = b0 + b1x1 + ... + bnxn, and ordinary least squares (OLS) chooses the coefficients that minimise the sum of squared residuals. With y = 50 + 4x, a student who studies 10 hours is predicted to score 90.

Common error measures: MSE (mean of squared errors), RMSE (its square root, in the target's units) and MAE (mean absolute error). Ridge (L2) and Lasso (L1) add a penalty on coefficient size to curb overfitting.

Exam angle: a U-shaped residual plot means the straight line misses curvature. Add polynomial terms or use a non-linear model.

Classification

Classification predicts a discrete class: binary (spam or not) or multi-class (digit 0 to 9).

Logistic regression computes a linear score z and turns it into a probability with the sigmoid, 1 / (1 + e^-z). At z = 0 the probability is 0.5; at z = 2 it is about 0.88. A threshold, 0.5 by default, gives the class. Naive Bayes applies Bayes' theorem with the assumption that features are independent given the class.

Exam angle: logistic regression is a classifier despite its name. Lowering its threshold flags more positives, raising recall and usually lowering precision.

KNN

k-nearest neighbours stores the training data and, for a query, finds the k closest points and takes a majority vote (or an average for regression). It is a lazy, instance-based learner.

Distance Formula for (3, 4) to (6, 8) Result
Euclidean (L2) sqrt(3² + 4²) 5
Manhattan (L1) 3 + 4 7

Small k gives low bias and high variance (overfitting); large k smooths the boundary, and k equal to the training-set size always predicts the majority class. Choose k by cross-validation and use an odd k for two classes to avoid ties.

Exam angle: KNN needs feature scaling, and it degrades with many irrelevant features (the curse of dimensionality).

SVM

A support vector machine finds the hyperplane w.x + b = 0 with the widest margin between classes. The margin width is 2 / ||w||, and only the support vectors, the points on or inside the margin, define it.

Exam angle: deleting a point that is not a support vector leaves the boundary unchanged.

Decision trees

A decision tree tests one feature at each internal node and gives a prediction at each leaf. It picks the split that most reduces impurity.

Measure Formula Pure node 50/50 two-class node
Entropy (ID3, C4.5) -Σ p log2 p 0 1
Gini (CART) 1 - Σ p² 0 0.5

For a node with 3 positive and 1 negative, entropy is 0.811 and Gini is 0.375. Information gain is parent entropy minus the weighted entropy of the children. It favours attributes with many values, which is why C4.5 uses the gain ratio.

Trees need no scaling and are easy to read, but deep trees overfit. Pre-pruning (max depth, minimum samples per leaf) or post-pruning helps, and Ensemble Learning combines many trees.

Common traps

Worked examples

1. Understanding. A bank predicts whether an applicant will default (yes or no) from past labelled loans. Which learning type and task is this? Answer: supervised binary classification. The labels are known for past loans and the target has two classes.

2. Application. A node has 8 'yes' and 2 'no' samples. What is its Gini impurity? Answer: 1 - (0.8² + 0.2²) = 1 - (0.64 + 0.04) = 0.32.

3. Analysis. An unpruned decision tree scores 99% on training data and 70% on validation data. What should you change first? Answer: the tree is overfitting. Limit its growth with a maximum depth or minimum samples per leaf, chosen by cross-validation, or prune it after training. A random forest is a stronger next step.

Practise

The quiz below has 100 questions on this topic, filterable by tier and difficulty.

Practise: 100 questions

Interactive quiz loading. The first 10 questions are shown below.

  1. What distinguishes supervised learning from unsupervised learning?

    1. Supervised learning needs no data
    2. Supervised learning trains on examples that come with known target labels
    3. Supervised learning only works on images
    4. Supervised learning never uses a test set
    Show answer

    Answer: B. Supervised learning trains on examples that come with known target labels

    In supervised learning each training example pairs inputs with a known output (a label or value), and the model learns the mapping. Unsupervised learning, such as clustering, finds structure in data without labels.

  2. Predicting the selling price of a house in rupees is which kind of task?

    1. Regression
    2. Binary classification
    3. Clustering
    4. Multi-class classification
    Show answer

    Answer: A. Regression

    The target is a continuous number, so this is regression. Classification predicts a discrete category, such as whether the house sells within a month.

  3. An email filter labels each message as 'spam' or 'not spam'. What type of problem is this?

    1. Regression
    2. Multi-label regression
    3. Dimensionality reduction
    4. Binary classification
    Show answer

    Answer: D. Binary classification

    There are exactly two possible discrete classes, so this is binary classification. Logistic regression, Naive Bayes, SVMs and decision trees are all common choices for it.

  4. Despite its name, logistic regression is mainly used for what?

    1. Predicting continuous values such as prices
    2. Clustering unlabelled data
    3. Classification, by passing a linear score through the sigmoid to get a probability
    4. Reducing the number of features
    Show answer

    Answer: C. Classification, by passing a linear score through the sigmoid to get a probability

    Logistic regression computes z = w.x + b and maps it to a probability with the sigmoid 1 / (1 + e^-z). A threshold, usually 0.5, turns the probability into a class. It is 'regression' only in that it models a probability.

  5. Why is k-nearest neighbours (KNN) called a lazy learner?

    1. It always uses k = 1
    2. It trains slowly with gradient descent
    3. It ignores most of the training data
    4. It builds no model during training and does its work at prediction time
    Show answer

    Answer: D. It builds no model during training and does its work at prediction time

    KNN simply stores the training set. All the computation, measuring distances to every stored point and voting, happens when a new query arrives, so prediction is costly while 'training' is almost free.

  6. In a support vector machine (SVM), what are the support vectors?

    1. All points of the majority class
    2. The points farthest from the boundary
    3. The training points closest to the decision boundary, which define the margin
    4. The weights of the hyperplane
    Show answer

    Answer: C. The training points closest to the decision boundary, which define the margin

    An SVM chooses the hyperplane with the widest margin between classes. Only the points lying on or inside the margin determine it; these are the support vectors. Other points could move without changing the boundary.

  7. What does the kernel trick allow an SVM to do?

    1. Train without any labels
    2. Reduce training data to a single support vector
    3. Find a non-linear boundary by working in a higher-dimensional space without computing that mapping explicitly
    4. Turn a regression problem into clustering
    Show answer

    Answer: C. Find a non-linear boundary by working in a higher-dimensional space without computing that mapping explicitly

    A kernel such as RBF or polynomial computes inner products as if the data had been mapped into a richer feature space. A linear separator there corresponds to a curved boundary in the original space, at little extra cost.

  8. In a decision tree, what does a leaf node hold?

    1. A test on a feature
    2. The root of the tree
    3. The final prediction (a class or a value)
    4. The training error of the whole tree
    Show answer

    Answer: C. The final prediction (a class or a value)

    Internal nodes test a feature, such as age < 30, and branches carry the outcomes. Following the tests from the root ends at a leaf, which stores the predicted class (or, for regression trees, a value).

  9. Ordinary least squares (OLS) linear regression chooses coefficients that minimise what?

    1. The sum of squared residuals between predictions and actual values
    2. The number of misclassified points
    3. The sum of absolute coefficients
    4. The distance to the nearest neighbour
    Show answer

    Answer: A. The sum of squared residuals between predictions and actual values

    OLS minimises the sum of squared errors (equivalently MSE). Squaring penalises large errors heavily and gives a closed-form solution. Adding the sum of absolute coefficients would be Lasso regularisation.

  10. How does a very small k (such as k = 1) usually affect a KNN classifier?

    1. High bias and low variance: it underfits
    2. Low bias but high variance: it follows noise and tends to overfit
    3. It removes the need for feature scaling
    4. It makes predictions identical for every query
    Show answer

    Answer: B. Low bias but high variance: it follows noise and tends to overfit

    With k = 1 each prediction copies a single neighbour, so the boundary bends around every noisy point. Larger k averages more neighbours, smoothing the boundary but eventually underfitting.

FAQs

What is the difference between regression and classification?

Both are supervised. Regression predicts a continuous number, such as a price or temperature, and is judged with MSE, RMSE or MAE. Classification predicts a category, such as spam or not spam, and is judged with accuracy, precision, recall and F1. Some algorithms, such as KNN and decision trees, can do either.

How do I choose k in KNN?

Try a range of values and keep the one with the best cross-validated score. Small k follows noise and overfits; large k blurs class boundaries and underfits. For binary problems an odd k avoids tied votes. Always scale features first, because distance is dominated by the feature with the largest range.

When should I use an SVM instead of logistic regression?

Both draw linear boundaries by default. An SVM focuses on the hardest points near the boundary and, with a kernel, handles non-linear patterns well on small to medium datasets. Logistic regression gives calibrated probabilities directly and is easier to interpret. Try both and compare on validation data.

Is Gini or entropy better for decision trees?

In practice they usually produce very similar trees. Gini is slightly faster because it needs no logarithms, which is why CART and scikit-learn use it by default. Entropy, used in ID3 and C4.5, comes from information theory and is the basis of information gain. Exam questions may ask you to compute either.

Next step

Continue with Ensemble Learning, the next topic in HEC's order. You can also return to the AI & ML MCQs hub or test yourself in an NSCT mock test.