Ensemble Learning MCQs for NSCT

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

Ensemble learning combines several base models, such as many decision trees, so that their joint prediction is more accurate and more stable than any one of them. It is topic 7 of the AI, Machine Learning & Data Analytics area, which carries 10% of the NSCT according to HEC's Areas of Competencies. In 2026 candidates averaged 50.8% accuracy in this area, per the HEC NSCT report and APP.

Revise Supervised Learning first, because ensembles are built from supervised base learners such as decision trees.

Bagging

Bagging (bootstrap aggregating, Breiman 1996) trains each model on a bootstrap sample: n rows drawn with replacement from the n training rows. Classification combines the models by majority vote and regression by averaging.

Because each row is missed by one draw with probability (1 - 1/n), it is left out of a whole sample with probability (1 - 1/n)^n, which tends to 1/e = 0.368. So each sample holds about 63.2% of the distinct rows, and the other 36.8% are out-of-bag (OOB) rows that can score the model for free.

Exam angle: bagging mainly reduces variance, so it helps unstable, low-bias learners such as deep trees, and does little for an underfitting model.

Boosting

Boosting trains learners sequentially, each one correcting the ensemble so far. In AdaBoost each weak learner (often a one-split decision stump) gets a vote weight alpha = (1/2) ln((1 - e)/e), where e is its weighted error. Misclassified rows are multiplied by e^alpha and correct rows by e^-alpha, then the weights are normalised.

With e = 0.2, alpha = 0.5 ln 4 = 0.693 and e^alpha = 2, so the misclassified rows end up holding exactly half the total weight. Gradient boosting instead fits each new tree to the negative gradient of the loss; for squared error that is simply the residual y - F(x), and each tree is added with a learning rate (shrinkage) eta.

Exam angle: boosting mainly reduces bias, and because it chases hard rows it is more sensitive to label noise than bagging.

Bagging / random forest Boosting
Training Parallel, independent Sequential, dependent
Data per learner Bootstrap sample Re-weighted rows or residuals
Mainly reduces Variance Bias
Typical base learner Deep, unpruned tree Stump or shallow tree
More estimators Error flattens Can overfit without early stopping

Random forest

A random forest is bagged trees plus feature randomness: every split looks at only a random subset of features. The usual default is sqrt(p) features for classification (8 of 64, for example). Breiman suggested about p/3 for regression, although scikit-learn's regressor now defaults to all features, so sources disagree here.

The reason is correlation. For n models with variance sigma^2 and pairwise correlation rho, the average has variance rhosigma^2 + (1 - rho)sigma^2/n. Adding trees shrinks only the second term, so decorrelating the trees lowers the floor.

Exam angle: expect a question on why max_features helps, or on why OOB accuracy is below training accuracy. Training accuracy near 100% is normal for a forest.

XGBoost

XGBoost (eXtreme Gradient Boosting, Chen and Guestrin 2016) is regularised gradient boosting. Its objective adds Omega = gammaT + (1/2)lambdasum(w^2), where T is the number of leaves and w the leaf weights. Using gradients g and Hessians h, the best leaf weight is w = -G/(H + lambda). A split is kept only if its gain, 1/2[GL^2/(HL+lambda) + GR^2/(HR+lambda) - (GL+GR)^2/(HL+HR+lambda)] - gamma, is positive.

Exam angle: gamma acts as a minimum loss reduction for a split, and lambda shrinks leaf weights towards zero.

Stacking and voting

Hard voting counts labels; soft voting averages probabilities. Stacking trains a meta-learner on out-of-fold base-model predictions.

Common traps

Worked examples

1. Understanding. Which ensemble method trains its learners independently on bootstrap samples and averages them? Answer: bagging. Boosting trains sequentially, and stacking learns a combiner on top of the base models.

2. Application. Three independent classifiers are each 80% accurate. What is the accuracy of their majority vote? Answer: 0.896. The vote is right when at least two are right: 3(0.8^2)(0.2) + 0.8^3 = 0.384 + 0.512 = 0.896.

3. Analysis. A gradient-boosting model with learning rate 0.3 has validation error that falls until about 400 rounds and then rises. Which change is most sensible? Answer: lower the learning rate and use early stopping on validation error. Rising error means extra rounds are fitting noise. Adding trees makes it worse, and switching to deeper trees raises variance further.

Practise

The quiz below has 100 Ensemble Learning questions, filterable by tier and difficulty.

Practise: 100 questions

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

  1. What is the core idea of ensemble learning?

    1. Train one very deep model and stop early to prevent overfitting
    2. Pick the single best model from a list using cross-validation and discard the rest
    3. Merge several datasets into one before training a single model
    4. Combine the predictions of several base models so the group performs better than any single member
    Show answer

    Answer: D. Combine the predictions of several base models so the group performs better than any single member

    An ensemble trains several base learners (for example many decision trees) and aggregates their outputs by voting, averaging or a learned combiner. Because individual errors partly cancel, the combined prediction is usually more accurate and more stable than one model alone. Model selection keeps one model, which is not an ensemble.

  2. In machine learning, the word 'bagging' is short for:

    1. Batch aggregating
    2. Bayesian aggregation of gradients
    3. Boosted gating
    4. Bootstrap aggregating
    Show answer

    Answer: D. Bootstrap aggregating

    Breiman (1996) coined bagging from bootstrap aggregating: draw bootstrap samples of the training set, train one model per sample, then aggregate by majority vote (classification) or averaging (regression).

  3. Which error component does bagging mainly reduce?

    1. Bias
    2. Variance
    3. Irreducible noise in the labels
    4. Training time
    Show answer

    Answer: B. Variance

    Averaging many models trained on different bootstrap samples smooths out their fluctuations, so bagging mainly cuts variance. It works best with low-bias, high-variance learners such as fully grown decision trees. It cannot remove label noise, and it usually increases training time.

  4. How does boosting train its base learners?

    1. In parallel, each on an independent bootstrap sample
    2. Sequentially, with each new learner concentrating on the mistakes of the ensemble so far
    3. Independently, each on a disjoint subset of the features
    4. Once, then their outputs are averaged with equal weights
    Show answer

    Answer: B. Sequentially, with each new learner concentrating on the mistakes of the ensemble so far

    Boosting is sequential. AdaBoost re-weights misclassified examples so the next learner focuses on them; gradient boosting fits the next learner to the residual errors (negative gradients). Parallel training on bootstrap samples describes bagging.

  5. What does a random forest add on top of plain bagging of decision trees?

    1. At each split, only a random subset of the features is considered
    2. Each tree is pruned to a single split
    3. Misclassified samples get larger weights in the next tree
    4. Each tree is trained on the full dataset without resampling
    Show answer

    Answer: A. At each split, only a random subset of the features is considered

    A random forest is bagged decision trees plus feature randomness: every split chooses the best feature from a random subset (for example sqrt(p) of p features for classification). This decorrelates the trees, so averaging them removes more variance than bagging alone.

  6. How is a bootstrap sample of a training set with n rows created?

    1. Draw n/2 rows at random without replacement
    2. Split the rows into k equal folds and keep one fold
    3. Keep every row but shuffle their order
    4. Draw n rows at random with replacement
    Show answer

    Answer: D. Draw n rows at random with replacement

    A bootstrap sample has the same size n as the original set and is drawn with replacement, so some rows appear more than once and others not at all. That difference between samples is what makes bagged models disagree usefully.

  7. What is the out-of-bag (OOB) error of a random forest?

    1. The training error of the single best tree in the forest
    2. The error on a separate test set held back before training
    3. The error of the forest on rows that were sampled more than once
    4. The error when each training row is predicted only by trees whose bootstrap sample did not include it
    Show answer

    Answer: D. The error when each training row is predicted only by trees whose bootstrap sample did not include it

    About 36.8% of rows are left out of each bootstrap sample. Predicting every row with only the trees that never saw it gives a nearly unbiased estimate of generalisation error without a separate validation set.

  8. In stacking (stacked generalisation), what does the meta-learner learn from?

    1. The raw features only, after the base models are discarded
    2. The residual errors of the previous tree, as in gradient boosting
    3. The bootstrap samples that the base models did not use
    4. The predictions of the base models, used as its input features
    Show answer

    Answer: D. The predictions of the base models, used as its input features

    Stacking trains several different base models, then trains a second-level model (often logistic or linear regression) on their predictions. To avoid leakage those predictions should be out-of-fold, produced on data each base model was not trained on.

  9. How does soft voting differ from hard voting in a classification ensemble?

    1. Soft voting counts labels; hard voting averages probabilities
    2. Soft voting averages the predicted class probabilities; hard voting counts predicted class labels
    3. Soft voting is used for regression; hard voting for classification
    4. Soft voting lets a meta-learner choose weights; hard voting uses bootstrap samples
    Show answer

    Answer: B. Soft voting averages the predicted class probabilities; hard voting counts predicted class labels

    Hard voting takes the majority of the predicted labels. Soft voting averages each class's predicted probability across models and picks the class with the highest mean, so a very confident model can outweigh two unsure ones. Soft voting needs well-calibrated probabilities.

  10. Which base learner is most commonly used in AdaBoost?

    1. A fully grown, unpruned decision tree
    2. A deep neural network
    3. A decision stump (a tree with a single split)
    4. A k-nearest-neighbour model with k = 1
    Show answer

    Answer: C. A decision stump (a tree with a single split)

    AdaBoost combines many weak learners, models only slightly better than chance. A decision stump is the classic choice: cheap, high bias and low variance. Boosting then reduces bias by adding many re-weighted stumps.

FAQs

Is random forest bagging or boosting?

Random forest is a bagging method. Each tree is trained independently on a bootstrap sample, and the forest votes or averages. What makes it more than plain bagging is the random subset of features considered at every split, which makes the trees less correlated.

Which is better, XGBoost or random forest?

Neither always wins. Tuned gradient boosting such as XGBoost often leads on tabular benchmarks, but it has more hyperparameters and can overfit if the learning rate and number of rounds are not controlled. A random forest is easier to tune and more robust to noisy labels, so it is a strong baseline.

Does boosting reduce bias or variance?

Mainly bias. Each new learner corrects the remaining errors, so a set of weak, high-bias stumps becomes a strong model. Shrinkage and subsampling also reduce variance a little, but if a question asks for the main effect, the answer is bias, while bagging mainly reduces variance.

Next step

Continue with Unsupervised Learning MCQs, go back to the AI & ML MCQ hub, or test yourself across every area in an NSCT mock test.