Great LEarning Weekly Quiz - Bagging and Random Forest
Great LEarning Weekly Quiz - Bagging and Random Forest
Correct Answer
Marks: 2/2
Select the statement(s) that highlight the key difference(s) between Bagging and Random Forest
A) Bagging considers all the features to decide the best split while Random Forest generally selects
only a subset of features.
B) Bagging can have any number of estimators while Random Forest can not have any number of
estimators.
C) Bagging can take Logistic Regression as its base estimator while Random Forest can only have a
decision tree as its base estimator.
D) Bagging selects only a subset of features to decide the best split while Random Forest considers
all the features to decide the best split.
Only A
C and D
A and C
You Selected
B and C
Bagging considers all the features to decide the best split while Random Forest generally selects
only a subset of features. Bagging can take Logistic Regression or any other algorithm as its base
estimator while Random Forest can only have a decision tree as its base estimator.
Q No: 2
Correct Answer
Marks: 2/2
C) Ensembles are machine learning methods for combining predictions from multiple separate
models
D) The ensemble models are only used in a classification problem.
A and B
B and C
You Selected
C and D
A and D
Ensembles are more complex than base models but they are not sensitive to slight variations in the
data, hence, robust. They are machine learning methods for combining predictions from multiple
separate models. The individual base learners in an ensemble model need to be built on different
data points so that they are independent of each other and result in better predictions. Ensemble
models can be used for both classification and regression problems.
Q No: 3
Correct Answer
Marks: 1/1
The bootstrap samples created during Bootstrap aggregation (Bagging) are created by sampling the
data ______ and _______
Correct Answer
Marks: 1/1
1 only
2 only
You Selected
1 and 2
None
In bagging, we can use n number of estimators of any algorithm, however, for the random forest, we
can use n number of estimators of decision trees only.
Q No: 5
Correct Answer
Marks: 1/1
Which of the following statement is correct about Random Forest?
From the original training data, the Random Forest algorithm considers a subset of rows
(observations) as well as a subset of columns (features) at each split to build each individual tree.
You Selected
Only a subset of columns, present in the original training data, is used to build each individual tree
Only a subset of rows, present in the original training data, is used to build each individual tree.
None of these
The Random Forest algorithm considers a subset of rows (observations) from the original training
data and then considers a subset of columns (features) from those data at each split to build each
individual tree.
Q No: 6
Correct Answer
Marks: 1/1
In a given dataset, there are M columns. Out of these M, m columns are chosen each time for
creating training samples for the individual trees in a random forest. What will happen if
A - m is almost equal to M
B - m is very small
A will result in a weak tree but B will result in a very robust tree
A will result in high correlation among individual trees resulting in lack of diversity, and B will result in
very weak individual trees
You Selected
A will have weak individual trees but B will result in high correlation among individual trees
A will result in a high correlation among the individual trees resulting in a lack of diversity and the
final output won't be reliable, on the other hand, B will result in very weak individual trees
Q No: 7
Correct Answer
Marks: 2/2
Which of the following parameters can you vary to tune a random forest model?
1. The number of features to consider when looking for the best split
1 only
2 only
1 and 2
You Selected
Both the above two parameters can be varied to tune a random forest model.
Q No: 8
Correct Answer
Marks: 1/1
In a random forest, what does the out-of-bag (OOB) error rate indicate?
Mean prediction error of each training sample xᵢ, using only the trees that did have xᵢ in their
bootstrap sample
Mean prediction error of each training sample xᵢ, using only the trees that did NOT have xᵢ in their
bootstrap sample
You Selected
Mean prediction error of each testing sample xᵢ
Correct Answer
Marks: 2/2
Which of the following are true for ‘class_weight’ in the random forest for binary classification?
A) It is used when classes are balanced
B) It is used when classes are imbalanced
C) Random forest gives less importance to the class with more weight
D) Random forest gives more importance to the class with more weight
A and B
A and C
B and C
B and D
You Selected
In random forest for binary classification, the ‘class_weight’ parameter is used when classes are
imbalanced and the random forest gives more importance to the class with more weight while
building the model.
Q No: 10
Correct Answer
Marks: 2/2
Which of the following statement(s) is/are true?
In bagging, if n is the number of rows sampled and N is the total number of rows, then
A) n can never be equal to N
B) n can be equal to N
C) n can be less than N
D) n can never be less than N
Only A
Only B
A and C
B and C
You Selected
In bagging, if n is the number of rows sampled and N is the total number of rows, then n<=N since n
is the subset of N.