DSE Data Science 3 — Questions and Answers
Question 1: What distinguishes a random forest from a single decision tree?
- It uses a deeper tree with more splits
- It aggregates predictions from multiple trees trained on random subsets (Correct answer)
- It replaces missing values before training
- It applies gradient boosting to each tree
Correct answer: It aggregates predictions from multiple trees trained on random subsets
Random forests build an ensemble of trees using bootstrap sampling and feature randomness to reduce variance.
Question 2: What is the Gini impurity used for in decision trees?
- Measuring prediction error on the test set
- Evaluating how balanced classes are at a node when splitting (Correct answer)
- Pruning branches that overfit training data
- Normalizing feature values before splitting
Correct answer: Evaluating how balanced classes are at a node when splitting
Gini impurity measures the probability of misclassifying a randomly chosen element if labeled by its class distribution.
Question 3: Which activation function is most commonly used in hidden layers of deep neural networks today?
- Sigmoid
- Tanh
- ReLU (Correct answer)
- Softmax
Correct answer: ReLU
ReLU (Rectified Linear Unit) avoids the vanishing gradient problem and is computationally efficient.
Question 4: In natural language processing, what is TF-IDF designed to measure?
- Sentiment polarity of words in a document
- The importance of a word to a document relative to a corpus (Correct answer)
- The syntactic structure of sentences
- The frequency of n-grams across all documents
Correct answer: The importance of a word to a document relative to a corpus
TF-IDF weights a term by how often it appears in a document scaled by how rare it is across the corpus.
Question 5: What is meant by data leakage in a machine learning pipeline?
- Training data being accidentally deleted
- Information from outside the training set influencing model training (Correct answer)
- Model weights being exposed to attackers
- Validation data overlapping with test data only
Correct answer: Information from outside the training set influencing model training
Data leakage causes artificially inflated performance metrics because the model learns information it shouldn't have access to.
Question 6: Which statistical test is most appropriate for comparing means across three or more independent groups?
- Paired t-test
- Chi-squared test
- One-way ANOVA (Correct answer)
- Mann-Whitney U test
Correct answer: One-way ANOVA
One-way ANOVA tests whether at least one group mean differs significantly from the others.
Question 7: What does ROC-AUC measure in a binary classification model?
- The exact probability threshold that maximizes accuracy
- The model's ability to rank positive instances higher than negatives across all thresholds (Correct answer)
- The ratio of true positives to all actual positives
- The harmonic mean of precision and recall
Correct answer: The model's ability to rank positive instances higher than negatives across all thresholds
AUC represents the probability that a randomly chosen positive example is ranked higher than a randomly chosen negative one.
What distinguishes a random forest from a single decision tree?