Decision trees MCQs

1. Which of the following is the primary criterion for splitting nodes in a decision tree?

  • A) Variance
  • B) Entropy
  • C) Gini index
  • D) Standard deviation

Answer: B) Entropy
Explanation: Entropy is commonly used to determine how to split nodes, especially in classification tasks. It measures the impurity or disorder of a dataset.


2. In a decision tree, what does a “leaf node” represent?

  • A) A decision-making point
  • B) The splitting criterion
  • C) The final prediction or output
  • D) A branching point

Answer: C) The final prediction or output
Explanation: A leaf node contains the final class label or prediction for a given set of features.


3. Which algorithm is primarily used for creating decision trees in machine learning?

  • A) K-Nearest Neighbors
  • B) Random Forest
  • C) ID3
  • D) Support Vector Machines

Answer: C) ID3
Explanation: ID3 (Iterative Dichotomiser 3) is a decision tree algorithm that uses entropy and information gain to split nodes.


4. Which of the following is true about the Gini index used in decision trees?

  • A) It ranges from 0 to 1, with 0 indicating perfect purity.
  • B) It measures the variance in a dataset.
  • C) It is used only for regression tasks.
  • D) It always results in an unbalanced tree.

Answer: A) It ranges from 0 to 1, with 0 indicating perfect purity.
Explanation: The Gini index measures how often a randomly chosen element would be incorrectly classified. A Gini index of 0 indicates that all elements belong to a single class.


5. Which of the following is a disadvantage of decision trees?

  • A) They are interpretable and easy to visualize.
  • B) They tend to overfit the data if not properly pruned.
  • C) They can only be used for classification tasks.
  • D) They require a lot of computational resources.

Answer: B) They tend to overfit the data if not properly pruned.
Explanation: Decision trees can easily overfit the data by learning overly specific patterns, which can be mitigated by techniques such as pruning.


6. What is “pruning” in the context of decision trees?

  • A) Adding more branches to the tree
  • B) Removing branches that do not provide significant information
  • C) Combining the leaf nodes into a single node
  • D) Increasing the depth of the tree

Answer: B) Removing branches that do not provide significant information
Explanation: Pruning is a technique used to reduce the complexity of the tree by removing branches that provide little predictive power.


7. In a decision tree, which of the following is used to evaluate the quality of a split?

  • A) Cost function
  • B) Entropy or Gini index
  • C) Mean squared error
  • D) Cross-validation score

Answer: B) Entropy or Gini index
Explanation: Both entropy (used in ID3) and Gini index (used in CART) are common measures to evaluate the quality of a split in a decision tree.


8. Which of the following is an advantage of decision trees?

  • A) They require a large amount of data to train effectively.
  • B) They can handle both numerical and categorical data.
  • C) They perform poorly with missing data.
  • D) They are difficult to interpret.

Answer: B) They can handle both numerical and categorical data.
Explanation: Decision trees can work with both types of data, unlike many other algorithms that only support numerical features.


9. Which of the following methods can help prevent overfitting in decision trees?

  • A) Increasing the depth of the tree
  • B) Using pruning
  • C) Reducing the number of features
  • D) Increasing the number of leaf nodes

Answer: B) Using pruning
Explanation: Pruning helps in reducing overfitting by removing branches that capture noise in the training data.


10. What is the main purpose of using a Random Forest algorithm in decision trees?

  • A) To increase interpretability
  • B) To reduce the variance of decision trees
  • C) To handle only numerical data
  • D) To create deeper trees

Answer: B) To reduce the variance of decision trees
Explanation: Random Forest is an ensemble method that uses multiple decision trees to reduce the variance and improve model performance compared to a single decision tree.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>