1. Home
  2. Explore
  3. Computer Science
  4. Neural Networks Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Neural Networks Overview

  • 19Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Motivation for Interpretability
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

Why might someone choose an interpretable model like a decision tree over a more complex model like a neural network, even if the neural network has higher predictive performance?

Tap to flipClick to flipspace

Interpretability allows experts to verify model behavior, detect issues like Simpson's paradox, and builds trust with non-experts (e.g., election officials, medical practitioners).

Or swipe the card

19 cards

  1. Why might someone choose an interpretable model like a decision tree over a more complex model like a neural network, even if the neural network has higher predictive performance?

    Interpretability allows experts to verify model behavior, detect issues like Simpson's paradox, and builds trust with non-experts (e.g., election officials, medical practitioners).

  2. What is an example of Simpson's paradox in a medical context that was discovered because of an interpretable model?

    Patients with asthma and pneumonia were found to have lower risk of death from pneumonia because they were admitted to the ICU and received aggressive care, which decreased their risk. This was detected because the interpretable model made this pattern clear.

  3. What is the difference between the forward mode of a decision tree and the forward mode of a neural network in terms of parameter learning?

    In a decision tree, prediction is deterministic: follow splits to a leaf and output the leaf's label. The parameters (split dimensions, split values, tree structure, leaf labels) are not fixed-dimensional and the loss is not differentiable, requiring heuristic learning rather than gradient descent.

  4. What are the components of a decision tree for classification or regression?

    A binary tree with internal nodes and leaf nodes. Each internal node specifies a dimension index j and a split value s, defining a split: if feature xj>=sx_j >= sxj​>=s, go to right child; else go to left child. Each leaf node has a label (for classification, a class; for regression, a real value).

  5. How does a decision tree define a partition of the feature space?

    Each internal node splits the current region into two half-spaces along an axis-aligned hyperplane (e.g., xj>=sx_j >= sxj​>=s). Recursively, this yields a partition of the feature space into axis-aligned rectangles, where each rectangle is assigned a constant prediction (the leaf label).

  6. What is the difference between a classification tree and a regression tree?

    The structure is identical (internal nodes with splits, leaves). The difference is the label: classification tree leaves predict a class label (e.g., high/low risk), while regression tree leaves predict a real-valued number (e.g., kilometers run).

  7. In the BuildTree algorithm for regression with squared error loss, what is the label assigned to a leaf node?

    The average of the training labels in that leaf: y^=1∣I∣∑i∈Iy(i)\hat{y} = \frac{1}{|I|} \sum_{i \in I} y^{(i)}y^​=∣I∣1​∑i∈I​y(i).

  8. How does the BuildTree algorithm handle continuous features when selecting a split value?

    Instead of considering all infinitely many possible split values, it only considers splits between data points (e.g., midpoints) because splits between data points yield the same training loss. This reduces to a finite set of candidate splits, roughly one per data point per dimension.

  9. What is the greedy criterion used to select the best split (dimension j and value s) in the BuildTree algorithm?

    The algorithm chooses the split that minimizes the sum of squared errors after splitting: Ej,s=∑i∈I−(y(i)−yˉI−)2+∑i∈I+(y(i)−yˉI+)2E_{j,s} = \sum_{i \in I^-} (y^{(i)} - \bar{y}_{I^-})^2 + \sum_{i \in I^+} (y^{(i)} - \bar{y}_{I^+})^2Ej,s​=∑i∈I−​(y(i)−yˉ​I−​)2+∑i∈I+​(y(i)−yˉ​I+​)2, where yˉI−\bar{y}_{I^-}yˉ​I−​ and yˉI+\bar{y}_{I^+}yˉ​I+​ are the averages of the labels in the left and right child subsets.

  10. Why does the BuildTree algorithm use a stopping criterion based on minimum number of points per leaf (k) rather than stopping when error is low?

    Stopping when error is low can be short-sighted; a split may not reduce error immediately but enable future splits that significantly reduce error (e.g., axis-aligned splits may need multiple cuts to separate intertwined regions). Using a small k grows a large tree, then pruning handles overfitting.

  11. What is cost-complexity pruning and how does it regularize a decision tree?

    Cost-complexity pruning defines an objective: Cα(T)=∑i=1nL(y(i),T(x(i)))+α⋅∣leaves(T)∣C_\alpha(T) = \sum_{i=1}^n L(y^{(i)}, T(\mathbf{x}^{(i)})) + \alpha \cdot |\text{leaves}(T)|Cα​(T)=∑i=1n​L(y(i),T(x(i)))+α⋅∣leaves(T)∣, where α≥0\alpha \ge 0α≥0 trades off training loss and tree complexity (number of leaves). Larger α\alphaα penalizes more leaves, leading to simpler trees. Pruning removes subtrees that do not improve the objective.

  12. In cost-complexity pruning, if a subtree (internal node + its children) yields the same training loss as replacing it with a leaf, what happens as α\alphaα increases from 0?

    For α=0\alpha=0α=0, both trees have the same cost. For any α>0\alpha>0α>0, replacing the subtree with a leaf reduces the cost because the number of leaves decreases by (leaves in subtree - 1) without increasing training loss, so the pruned tree is preferred.

  13. What is bagging (bootstrap aggregating) and how does it create an ensemble?

    Bagging generates B fake datasets by sampling with replacement from the original training data (bootstrap). A predictor is trained on each fake dataset. For regression, the final prediction is the average of the B predictors; for classification, it is the majority vote.

  14. In bagging, why is sampling with replacement used instead of without replacement?

    Sampling with replacement ensures that each bootstrap sample has the same size as the original dataset, and some original points are repeated while others are omitted. This creates variability among the datasets, which leads to diverse predictors. Without replacement, each sample would be a smaller dataset with no repeats, losing the 'bootstrap' effect.

  15. How does a random forest differ from bagging decision trees?

    Random forest includes additional randomness: when building each tree, at each split, a random subset of m features (out of d total) is selected, and the split is chosen only from these m features. Bagging decision trees would use all d features. This extra randomness decorrelates the trees, improving ensemble performance.

  16. In a random forest, how is the final prediction made for regression and classification?

    For regression: average the predictions of all B trees. For classification: take the majority vote (class with most votes) across trees.

  17. What is the trade-off between a single decision tree and a random forest in terms of interpretability and predictive performance?

    A single decision tree is highly interpretable (easy to understand and explain) but has lower predictive performance due to high variance. A random forest has much higher predictive performance (by reducing variance through averaging) but loses interpretability because it is a complex ensemble of many trees.

  18. What is the 'bootstrap' part of bagging?

    The bootstrap refers to creating B new datasets by randomly sampling with replacement from the original training data, each of the same size as the original.

  19. Why might an ensemble of trees (like random forest) be preferred over a neural network for many tabular datasets?

    Ensembles of trees (e.g., XGBoost, LightGBM, random forest) often achieve the best predictive performance on tabular data, as evidenced by Kaggle competitions. Neural networks excel in vision and NLP but are not always optimal for structured data.

Card 1 of 19
Card 1 of 19

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent