CP3501 Β· Week 7 Random Forests & scikit-learn Quiz
0 / 30
Week 7  Β·  Assessment Quiz

Random Forests & scikit-learn

25 multiple-choice questions on decision trees, random forests, feature importance and sklearn, plus 5 short-answer questions.

πŸ“‹ 30 questions total ⭐ 30 marks πŸ• No time limit πŸ”’ Answers not revealed
PART A

Multiple Choice  (25 marks)

Select the single best answer for each question. Each question is worth 1 mark.

Q1

A decision tree makes predictions by:

Q2

A random forest is best described as:

Q3

Bagging (Bootstrap Aggregating) works by:

Q4

Feature importance in a random forest is typically measured by:

Q5

The out-of-bag (OOB) error is:

Q6

n_estimators in sklearn's RandomForestClassifier controls:

Q7

Setting a very small max_depth on a decision tree results in:

Q8

Random forests use feature subsampling at each split to:

Q9

Compared to a single decision tree, a random forest generally has:

Q10

max_features in sklearn's RandomForestClassifier controls:

Q11

Pruning a decision tree achieves:

Q12

Gini impurity at a node measures:

Q13

A decision tree will overfit when:

Q14

The key advantage of random forests over single decision trees is:

Q15

oob_score=True in sklearn:

Q16

In sklearn, model.fit(X_train, y_train):

Q17

The difference between predict() and predict_proba() in sklearn is:

Q18

Cross-validation is used in model evaluation to:

Q19

A model with high bias and low variance is likely:

Q20

A feature importance of 0.0 for a column means:

Q21

An ensemble method improves prediction by:

Q22

A decision tree grown without any depth limit will typically:

Q23

Random forests reduce variance compared to a single tree because:

Q24

What is grid search used for in model development?

Q25

Which of the following would you use to visualise the relative importance of features in a trained sklearn random forest?

PART B

Short Answer  (5 marks β€” marked by lecturer)

Answer each question in 2–4 sentences. Precise technical language is expected. Code snippets are welcome where relevant.

Q26

Explain how a random forest makes a prediction for a new data point. What role does each individual tree play and how are their outputs combined?written

Your answer
0 / 700
Q27

What is the out-of-bag (OOB) error in a random forest? Why does it provide a useful estimate of generalisation performance without needing a separate validation set?written

Your answer
0 / 700
Q28

Explain how feature importance is computed in a random forest. How could you use feature importances practically to improve a model or understand your data?written

Your answer
0 / 700
Q29

Explain the bias-variance tradeoff. Where does a fully-grown single decision tree sit on this spectrum, and where does a random forest sit? Why?written

Your answer
0 / 700
Q30

Compare and contrast decision trees and random forests across three dimensions: interpretability, variance, and computational cost. When would you choose a single decision tree over a random forest?written

Your answer
0 / 700

Complete all 30 questions then click Submit. Your MCQ score (25/25) will be shown. Short answers are marked separately.

MCQ Score
0 / 25
✏️ Your 5 short-answer responses are recorded for your lecturer.
Full total: MCQ + short-answer marks = / 30