Decision Trees Flashcards

(54 cards)

1
Q

What type of data structure, used in machine learning for both regression and classification, is based on a binary tree structure?

A

A decision tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In a decision tree, what is the term for a node that represents a decision point and has two child nodes?

A

An internal node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does a decision tree process a single data point to arrive at a classification or prediction?

A

It passes the data point down from the root to a leaf node, making a decision at each internal node based on a feature value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the final outcome for a data point once it reaches a leaf node in a decision tree?

A

It is assigned the label or prediction value associated with that leaf node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

List three common use cases for decision trees in business.

A

Credit scoring, fraud detection, and customer segmentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In the context of decision trees, what does the term “serving” refer to?

A

The process where the trained model is used to make predictions on new, unseen data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A decision tree is what type of machine learning model: supervised or unsupervised?

A

Supervised.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

For a classification task, what two outputs does a decision tree typically emit for a given data point?

A

The class label and the probability of belonging to that class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the key advantage of decision trees regarding input data features compared to other models?

A

They can handle numerical and categorical features with equal ease, often without extensive data pre-processing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In the decision tree training process, what hyperparameter defines the maximum depth the tree can grow to?

A

The max_depth.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What hyperparameter in decision tree training sets the minimum number of samples a node must have to be eligible for splitting?

A

The min_samples.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

During training, a decision tree algorithm splits a node by selecting the feature and threshold that achieves the greatest reduction in a ____ _____.

A

score function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

For a classification tree, what label is assigned to a leaf node during training?

A

The majority class label of the training data points that occupy that leaf node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

For a regression tree, what prediction value is assigned to a leaf node during training?

A

The average of the target values among all the training data points that occupy that leaf node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What score function is typically used to decide the split for a classification decision tree?

A

Entropy reduction or Gini impurity gain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What score function is used as the splitting criterion for a regression decision tree?

A

The reduction in variance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How is feature importance calculated in a decision tree?

A

By calculating the weighted reduction in impurity (like entropy or Gini) attributable to a feature across all nodes where it was used for splitting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The term “random” in random forests signifies that the subsample of data points, features, and feature _____ are randomly chosen at each node.

A

thresholds

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a major limitation of vanilla decision trees regarding the training data?

A

The entire dataset must be loaded into memory, which can impose size limitations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What popular decision tree algorithm uses Gini impurity values for classification, chosen for computational efficiency?

A

CART (Classification and Regression Trees).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the formula for calculating Entropy at a node D?

A

$Entropy(D) = -\sum_{i=1}^{k} p_i \log_2(p_i)$, where $p_i$ is the proportion of data points belonging to class i.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

When is entropy at a node at its maximum value?

A

When the data is evenly split among all classes, reflecting maximum uncertainty.

23
Q

What are the two main reasons the Gini index is often preferred over entropy for splitting nodes in decision trees?

A

Computational efficiency (no logarithms) and greater robustness to small changes in class probabilities.

24
Q

What is the formula for the Gini index at node t?

A

$Gini(t) = 1 - \sum_{y=0}^{k} [p(y|t)]^2$, where $p(y|t)$ is the proportion of cases for class y.

25
In a regression tree, how is the variance at a node D calculated?
$Var(D) = \frac{1}{r} \sum_{i=1}^{r} (y_i - \mu)^2$, where $r$ is the number of data points and $\mu$ is the mean of their target values.
26
What is the term for the limitation of decision trees where small changes in training data can lead to significantly different tree structures?
Brittleness or instability.
27
What is a common ensemble method used to address the brittleness and improve the robustness of decision trees?
Random forests or gradient boosted decision trees.
28
Finding the optimal feature and threshold for each split in a decision tree is computationally exhaustive, known as an __-_______ problem.
NP-complete
29
What is the primary risk associated with growing a decision tree that is too deep?
Overfitting to the training data, which harms its ability to generalize to new data.
30
What is a common technique used to prevent decision trees from overfitting?
Tree pruning, such as limiting the maximum depth or setting a minimum number of samples per leaf.
31
Why is using batches of data not practical for training a single, vanilla decision tree?
Training a single tree requires the entire dataset to be loaded into memory to effectively select feature thresholds at each node.
32
How can ensemble methods be used to train on a dataset that is too large to fit into memory?
By training multiple decision trees, each on a different subset of the dataset.
33
What is a Hoeffding tree?
A type of decision tree that can grow incrementally as new data arrives, making it suitable for online learning.
34
What is the general approach for updating an existing decision tree ensemble with new incremental data?
Mini-batch the new data to train a new decision tree, which is then incorporated into the existing ensemble, possibly replacing an older tree.
35
In decision analysis, a decision tree is a flowchart-like structure where each internal node represents a _____ on an attribute.
test
36
What do the leaf nodes in a decision tree represent?
A class label or a final decision taken after computing all attributes.
37
What are the three types of nodes in a decision tree used for decision analysis?
Decision nodes, chance nodes, and end nodes.
38
In a decision analysis flowchart, what shape typically represents a decision node?
A square.
39
In a decision analysis flowchart, what shape typically represents a chance node?
A circle.
40
A decision tree can be linearized into a set of if-then statements known as _____ _____.
decision rules
41
What is a major disadvantage of decision trees regarding categorical variables with many levels?
Information gain is biased in favor of attributes with more levels.
42
What is meant by a "pure node" in a decision tree?
A node where all the data belongs to a single class.
43
While increasing tree depth can increase accuracy, what are two potential negative consequences?
Increased runtime and a higher risk of overfitting.
44
What is a major drawback of using information gain as a splitting criterion?
It tends to select features that have more unique values.
45
An ensemble method that generates many decision trees and uses their collective votes to make a final classification is called a _____ _____.
random forest
46
What is the formula for Accuracy based on a confusion matrix?
Accuracy = (TP + TN) / (TP + TN + FP + FN).
47
What evaluation metric, also known as the true positive rate (TPR), is calculated as TP / (TP + FN)?
Sensitivity or Recall.
48
What does a low sensitivity score indicate about a classification model?
It indicates the model does not do well at identifying actual positive samples.
49
What evaluation metric, also known as the true negative rate (TNR), is calculated as TN / (TN + FP)?
Specificity.
50
What evaluation metric, also known as positive predictive value (PPV), measures the proportion of positive predictions that were actually correct?
Precision.
51
What is the formula for Precision?
Precision = TP / (TP + FP).
52
What is a key difference in structure between a decision tree and an influence diagram?
An influence diagram can represent information more compactly, focusing on relationships between events, whereas a decision tree shows explicit paths.
53
In regression, the training process for a decision tree aims to select splits that maximize the reduction in _____.
variance
54
What is a key difference between the Gini index and entropy regarding their mathematical computation?
The Gini index uses straightforward arithmetic (squaring), while entropy requires logarithmic calculations, making Gini computationally faster.