Decision Tree (Part 1): Machine Learning Interview Prep 05

Shahidullah Kawsar
4 min readJun 1, 2021

--

A decision tree is like a flowchart that helps make decisions based on different conditions. It starts with a question, like “Is it sunny today?”, and then branches out into different paths based on the answer, leading to different decisions. Each branch represents a possible outcome or choice, helping to visualize the decision-making process. Decision trees are commonly used in various fields, from business to medicine, to help analyze data and make informed choices.

Let’s check your basic knowledge of the Decision Tree. Here are 10 multiple-choice questions for you and there’s no time limit. Have fun!

Figure: Decision tree [1]

Question 1: Decision trees are also known as CART. What is CART?
(A) Classification and Regression Trees
(B) Customer Analysis and Research Tool
(C) Communication Access Real-time Translation
(D) Computerized Automatic Rating Technique

Question 2: What are the advantages of Classification and Regression Trees (CART)?
(A) Decision trees implicitly perform variable screening or feature selection
(B) Can handle both numerical and categorical data
(C) Can handle multi-output problems.
(D) All of the above

Question 3: What are the advantages of Classification and Regression Trees (CART)?
(A) Decision trees require relatively less effort from users for data preparation
(B) Nonlinear relationships between parameters do not affect tree performance.
(C) Both (A) and (B)
(D) None of these

Question 4: What are the disadvantages of Classification and Regression Trees (CART)?
(A) Decision trees can be unstable because small variations in the data might result in a completely different tree being generated
(B) Decision trees require relatively less effort from users for data preparation
(C) Nonlinear relationships between parameters do not affect tree performance.
(D) Decision trees implicitly perform variable screening or feature selection

Question 5: Decision tree learners may create biased trees if some classes dominate. What’s the solution of it?
(A) balance the dataset prior to fitting
(B) imbalance the dataset prior to fitting
(C) balance the dataset after fitting
(D) No solution possible

Question 6: Decision tree can be used for ______.
(A) classification
(B) regression
(C) Both
(D) None of these

Question 7: Decision tree is a ______ algorithm.
(A) supervised learning
(B) unsupervised learning
(C) Both
(D) None of these

Question 8: Suppose, your target variable is whether a passenger will survived or not using Decision Tree. What type of tree do you need to predict the target variable?
(A) classification tree
(B) regression tree
(C) clustering tree
(D) dimensionality reduction tree

Question 9: Suppose, your target variable is the price of a house using Decision Tree. What type of tree do you need to predict the target variable?
(A) classification tree
(B) regression tree
(C) clustering tree
(D) dimensionality reduction tree

Question 10: What is the maximum depth in a decision tree?
(A) the length of the longest path from a root to a leaf
(B) the length of the shortest path from a root to a leaf
(C) the length of the longest path from a root to a sub-node
(D) None of these

The solutions will be published in the next quiz Machine Learning Quiz 06: Decision Tree (Part 2). Happy learning.

If you like the questions and enjoy taking the test, please subscribe to my email list for the latest ML questions, follow my Medium profile, and leave a clap for me. Feel free to discuss your thoughts on these questions in the comment section. Don’t forget to share the quiz link with your friends or LinkedIn connections. If you want to connect with me on LinkedIn: my LinkedIn profile.

The solution of Machine Learning Quiz 04: Logistic Regression1(A), 2(B), 3(B, D), 4(C), 5(C), 6(A), 7(B), 8(A), 9(D), 10(C)

References:

[1] https://clevertap.com/blog/numerical-vs-categorical-variables-decision-trees/

[2] Decision Trees in Machine Learning: https://towardsdatascience.com/decision-trees-in-machine-learning-641b9c4e8052

--

--

Shahidullah Kawsar
Shahidullah Kawsar

Written by Shahidullah Kawsar

Data Scientist, IDARE, Houston, TX

Responses (2)