Velocer › Flashcards › University of Wisconsin–Madison › STAT 451: Intro to Machine Learning · UW-Madison
STAT 451: Intro to Machine Learning · UW-Madison
Quizzing myself for STAT 451 with these. · par eigen_owl · 104 cartes
- What is the bias–variance tradeoff?The balance between a model that is too simple (high bias, underfitting) and too complex (high variance, overfitting) to achieve good generalization.
- Why must cross-validation be done without data leakage?Leakage lets information from the test or validation data influence training, producing overly optimistic performance estimates that don't generalize.
- What is the purpose of threshold-aware evaluation metrics?To assess classifier performance on imbalanced data by accounting for the decision threshold rather than relying on accuracy alone.
- What does PCA stand for and what does it do?Principal Component Analysis; it reduces dimensionality by projecting data onto directions of maximum variance.
- How does K-means clustering work?It partitions data into K clusters by iteratively assigning points to the nearest centroid and updating centroids to minimize within-cluster variance.
- What distinguishes hierarchical clustering from K-means?Hierarchical clustering builds a nested tree (dendrogram) of clusters without requiring K in advance, while K-means partitions into a fixed number of clusters.
- What is the difference between Ridge and LASSO regularization?Ridge uses an L2 penalty that shrinks coefficients, while LASSO uses an L1 penalty that can shrink some coefficients to exactly zero, performing feature selection.
- What is Elastic Net regularization?A combination of L1 (LASSO) and L2 (Ridge) penalties that balances feature selection and coefficient shrinkage.
- What is bagging?Bootstrap Aggregating: training many models on bootstrap samples and averaging their predictions to reduce variance.
- How does a Random Forest improve on bagging?It adds random feature selection at each split, decorrelating the trees and further reducing variance.
- What is gradient boosting?An ensemble method that sequentially fits weak learners to the residuals (gradients) of previous models to reduce bias.
- What is the key idea behind Support Vector Machines?They find the maximum-margin separating hyperplane, using kernels to handle non-linear boundaries.
- What does k-Nearest Neighbors predict?It predicts based on the majority class or average target of the k nearest training points, a nonparametric, instance-based method.
- What is feature engineering?Creating or transforming input variables (e.g., aggregating statistics) to improve a model's predictive performance.
- What is the goal of supervised learning in terms of expected test risk?Learn a predictor f-hat that minimizes expected test risk R(f-hat) = E[L(Y, f-hat(X))], using training pairs (x_i, y_i).
- What distinguishes regression from classification in supervised learning?Regression has continuous targets y_i in R (using squared or absolute error); classification has categorical targets (using 0-1 loss or cross-entropy).
- What does unsupervised learning aim to discover from unlabeled feature vectors?Latent low-dimensional representations (e.g., PCA) or homogeneous groupings (e.g., K-means, hierarchical clustering).
- State the bias-variance decomposition of expected test MSE at a point x_0.EPE(x_0) = Bias^2(f-hat(x_0)) + Var(f-hat(x_0)) + irreducible error sigma_epsilon^2, where Bias = E[f-hat(x_0)] - f(x_0).
- What bias-variance tradeoff characterizes low-complexity models like linear regression or large-k k-NN?High bias and low variance, leading to underfitting.
- What bias-variance tradeoff characterizes high-complexity models like deep unpruned trees or k=1 k-NN?Low bias and high variance, leading to overfitting of training noise.
- Why is training error a poor estimate of generalization error?Training error monotonically decreases with model flexibility and severely underestimates test error.
- How does K-fold cross-validation work?Partition data into K folds; for each fold k, train on the other folds and evaluate on fold k, then average the K MSEs (typically K=5 or 10).
- What are the bias-variance tradeoffs of Leave-One-Out CV versus K=5 or 10 CV?LOO (K=n) is nearly unbiased for test error but has high variance and high computational cost; K=5 or 10 achieves a better bias-variance balance.
- What is data leakage in the context of CV pipelines?Fitting preprocessing steps (scaling, imputation, PCA, feature selection, SMOTE) on the full dataset before splitting, which yields optimistically biased CV scores. All such steps must be fit inside each training fold.
- How does k-NN make predictions for regression and classification at a query point x_0?Regression averages the k nearest neighbors' y values; classification estimates class probability as the fraction of the k neighbors belonging to that class.
- Why must features be standardized before applying k-NN?So variables with large numerical units do not dominate the Euclidean distance calculation.
- What is the curse of dimensionality in the context of k-NN?In large p, pairwise distances concentrate, making nearest neighbors less meaningful.
- How does CART build a decision tree?It recursively partitions the feature space into axis-aligned rectangles via greedy top-down binary splits (X_j <= s vs X_j > s).
- What criterion does a regression tree use to choose splits?Minimize the Residual Sum of Squares (RSS) across the two resulting regions.
- Give the formulas for Gini index and cross-entropy impurity in a classification tree node.Gini: G_m = 1 - sum_k p-hat_mk^2; Cross-entropy: D_m = -sum_k p-hat_mk log p-hat_mk.
- Why is the classification error rate a poor criterion for growing trees?It is insensitive to node class probabilities; it is mainly used for pruning rather than growing.
- How is information gain (impurity reduction) computed for a split?Delta I = I(parent) - (N_left/N_parent) I(left) - (N_right/N_parent) I(right).
- What is cost-complexity pruning for decision trees?Grow a large tree T_0, then prune to a subtree T minimizing R_alpha(T) = sum_m N_m I_m + alpha|T|, with alpha tuned by cross-validation.
- How does bagging work?Draw B bootstrap samples (n observations with replacement), fit an unpruned deep tree on each, then average predictions or take a majority vote.
- What is the out-of-bag (OOB) error?An error estimate using, for each observation, only the trees for which that observation was left out of the bootstrap sample.
- In bagging, what fraction of observations are left out of each bootstrap sample, and what is this fraction approximately?About 1 - (1 - 1/n)^n ≈ e^-1 ≈ 36.8% of observations are out-of-bag (OOB) for each bootstrap sample.
- How can out-of-bag (OOB) observations provide a free cross-validation error estimate in bagging?Predict each observation using only the trees for which it was OOB, then compare predictions to actual values to estimate test error without a separate validation set.
- What is the variance formula for an ensemble of B identically distributed trees with variance σ² and pairwise correlation ρ?Var = ρσ² + (1 - ρ)σ²/B, which converges to ρσ² as B goes to infinity.
- Why does increasing the number of trees B not reduce ensemble variance below ρσ²?The correlated component ρσ² remains regardless of B; only the (1 - ρ)σ²/B term shrinks as B grows.
- How do Random Forests reduce the inter-tree correlation ρ compared to plain bagging?At every split, they consider only a random subset of candidate features—about √p for classification or p/3 for regression.
- Does increasing the number of trees B in Bagging or Random Forests cause overfitting? Why or why not?No. Increasing B only reduces the (1 - ρ)σ²/B variance term and does not increase model complexity in a way that causes overfitting.
- How does boosting differ from Random Forests in the way trees are trained?Boosting trains shallow weak learners sequentially, each fitting the negative gradient (pseudo-residuals) of the current ensemble's loss; Random Forests train trees independently in parallel.
- In gradient boosting, what does each new tree fit?Each new tree fits the negative gradient of the loss function—the pseudo-residuals r_ib = -[∂L(y_i, f(x_i))/∂f(x_i)] evaluated at the current ensemble prediction.
- What is the boosting update rule with shrinkage learning rate η?f̂^(b)(x) = f̂^(b-1)(x) + η·ĥ_b(x), where η ∈ (0, 1] shrinks each new tree's contribution.
- What tree depth is typical for weak learners in boosting (AdaBoost, GBDT, XGBoost)?Shallow trees, typically depth d = 1 to 4.
- Does boosting primarily reduce bias or variance?Boosting primarily reduces bias by sequentially correcting the ensemble's errors.
- Under what condition can boosting overfit, and which hyperparameters must be tuned jointly?Boosting can overfit if the number of trees B is too large; B, learning rate η, and tree depth d should be tuned jointly via cross-validation.
- What is the role of the learning rate η in gradient boosting?It is a shrinkage parameter in (0, 1] that scales each new tree's contribution, controlling how fast the ensemble fits the data.
- What are pseudo-residuals in gradient boosting?The negative gradient of the loss function with respect to the current ensemble prediction, which each new tree is trained to fit.
- What is the main purpose of random feature subsampling in Random Forests?To break the correlation ρ between trees caused by dominant predictors, thereby lowering the irreducible variance term ρσ².
- What is the OLS estimator formula for linear regression?β̂_OLS = (XᵀX)⁻¹Xᵀy. It is unbiased when Y = Xβ + ε but has high variance under collinearity and fails when p > n because XᵀX is singular.
- What does Ridge regression do to the coefficients?Ridge adds an ℓ2 penalty, shrinking coefficients smoothly toward zero (especially along small singular-value directions) but keeping all p features non-zero.
- Why does LASSO perform exact feature selection?The ℓ1 constraint region (diamond ball) has sharp corners on the coordinate axes, so the solution often sets coefficients exactly to zero, giving simultaneous shrinkage and selection.
- What is Elastic Net and when is it preferred?It combines ℓ1 and ℓ2 penalties: λ(α‖β‖₁ + (1−α)‖β‖₂²). It selects correlated groups of features together while retaining sparsity, unlike plain LASSO.
- What preprocessing is required before Ridge or LASSO, and what is never penalized?Always standardize predictors, and never penalize the intercept β₀.
- How does logistic regression model the probability of class 1?It models the log-odds linearly: log(p/(1−p)) = wᵀx + b, so P(Y=1|X=x) = σ(wᵀx + b) = 1/(1+e^−(wᵀx+b)).
- What loss does logistic regression minimize, and how is it optimized?It minimizes binary cross-entropy (negative log-likelihood). There is no closed-form solution, so it is optimized via gradient descent or Newton–Raphson (IRLS).
- How do LDA and QDA differ in their assumptions?LDA assumes X|Y=k ~ N(μ_k, Σ) with a shared covariance, giving a linear decision boundary; QDA allows class-specific Σ_k, giving a quadratic boundary.
- What assumption does Naive Bayes make about class-conditional densities?It assumes conditional independence of features: f_k(x) = ∏ⱼ f_kj(x_j).
- What is the hard-margin SVM optimization problem?Minimize ½‖w‖₂² subject to yᵢ(wᵀxᵢ + b) ≥ 1 for all i, which maximizes the geometric margin 2/‖w‖₂ for linearly separable data.
- How does the SVM cost parameter C affect bias and variance?Large C penalizes margin violations heavily → narrow margin, fewer support vectors, lower bias, higher variance. Small C allows a wider margin, more support vectors, higher bias, lower variance.
- What is the kernel trick in SVMs?The dual solution depends only on inner products via a kernel K(xᵢ, x), so the classifier is f̂(x) = Σ_{i∈SV} αᵢyᵢK(xᵢ, x) + b, enabling nonlinear boundaries without explicit feature maps.
- What does the RBF kernel look like and how does γ affect it?K(x, x') = exp(−γ‖x − x'‖₂²). Large γ creates wiggly, localized boundaries around training points (high variance); it corresponds to an infinite-dimensional feature space.
- Why is raw accuracy misleading for evaluating a classifier when classes are severely imbalanced?A dummy classifier predicting the majority class can achieve very high accuracy (e.g., >90%) while never detecting the minority class, so accuracy hides poor performance on the class of interest.
- Which evaluation metrics are recommended for a severely imbalanced classification problem?Precision, Recall (Sensitivity), F1-Score, ROC-AUC, and Precision-Recall AUC (PR-AUC).
- What does the probability decision threshold tau (τ) represent in a classifier?It is the cutoff in (0, 1) applied to predicted probabilities: a sample is classified as positive when its predicted probability exceeds τ.
- Why should you tune the decision threshold τ instead of defaulting to 0.5?With class imbalance, 0.5 may yield poor precision/recall trade-offs; tuning τ lets you optimize the metric that matters for the application.
- What is Recall (Sensitivity) in classification evaluation?The proportion of actual positives that are correctly identified by the model (true positives divided by all actual positives).
- What is Precision in classification evaluation?The proportion of predicted positives that are actually positive (true positives divided by all predicted positives).
- What does the F1-Score combine, and why is it useful?It is the harmonic mean of Precision and Recall, giving a single balanced measure that is useful when classes are imbalanced.
- What does PR-AUC (Precision-Recall AUC) summarize?The area under the precision-recall curve, capturing model performance across thresholds and being especially informative for imbalanced datasets.
- What does ROC-AUC measure?The area under the receiver operating characteristic curve, summarizing the trade-off between true positive rate and false positive rate across thresholds.
- Why is the MLB Hall of Fame induction dataset a severe class-imbalance problem?Only a small fraction of MLB players are inducted, so the positive class is rare relative to the negative class.
- What does the accuracy metric measure, and when is it misleading?Accuracy is the overall fraction of predictions that are correct: (TP + TN) / (TP + TN + FP + FN). It is misleading under severe class imbalance.
- What is the formula for precision (PPV)?Precision = TP / (TP + FP). It is the fraction of predicted positives that are truly positive.
- When should you prioritize precision over other metrics?When false positives are costly, such as in spam filtering or HOF selectivity.
- What does recall (sensitivity or TPR) measure, and what is its formula?Recall is the fraction of actual positives that are detected: TP / (TP + FN).
- When should you prioritize recall?When false negatives are costly, such as in disease screening.
- What is specificity (TNR) and how does it relate to FPR?Specificity = TN / (TN + FP) = 1 - FPR. It is the fraction of actual negatives that are correctly rejected.
- What is the F1-score and what does it represent?F1 = 2·(Precision·Recall)/(Precision + Recall) = 2TP/(2TP + FP + FN). It is the harmonic mean of precision and recall, penalizing extreme imbalance between them.
- What does ROC-AUC represent probabilistically?ROC-AUC is the probability that a randomly chosen positive instance is ranked higher than a randomly chosen negative instance, based on the area under the TPR vs. FPR curve.
- When is PR-AUC more informative than ROC-AUC?When the positive class is rare (TN >> FP), because PR-AUC focuses on precision and recall rather than true negatives.
- What is the formula for accuracy?Accuracy = (TP + TN) / (TP + TN + FP + FN).
- What is the formula for recall (TPR)?Recall = TP / (TP + FN).
- What is the formula for specificity (TNR)?Specificity = TN / (TN + FP) = 1 - FPR.
- What is the formula for the F1-score in terms of TP, FP, and FN?F1 = 2TP / (2TP + FP + FN).
- What does the ROC curve plot, and over what range is the threshold varied?It plots TPR (recall) against FPR across thresholds τ in [0,1]; ROC-AUC is the area under this curve.
- What does the PR-AUC measure?PR-AUC is the area under the Precision vs. Recall curve, summarizing performance when the positive class is rare.
- What does a small k value imply for k-NN's bias and variance?Small k gives low bias and high variance. k-NN also degrades in high dimensions (p >> 10).
- What happens to bias and variance in Ridge/LASSO as the penalty λ increases?Large λ implies high bias and low variance. LASSO (ℓ1) additionally produces sparse exact zeros.
- What does LASSO's ℓ1 penalty do that Ridge does not?LASSO produces sparse solutions with exact zeros, effectively performing feature selection. Ridge shrinks coefficients but doesn't zero them out.
- What do logistic regression coefficients e^β_j represent?They give odds ratios. Logistic regression also outputs well-calibrated probabilities p̂(x).
- Does logistic regression handle non-linearity?No, it is linear in the log-odds. It also requires scaling if regularized.
- Do decision trees require feature scaling?No, CART is monotone-invariant to feature scaling. Trees handle non-linearity via step functions.
- What is a key weakness of decision trees (CART)?High variance—they are unstable to small changes in the data. They are otherwise highly interpretable and handle mixed data.
- How do Random Forests decorrelate their trees?By using m ≈ √p features per split (mtry). This reduces variance without overfitting as the number of trees B → ∞.
- Do Random Forests require feature scaling?No. They handle non-linearity and reduce variance by averaging decorrelated trees.
- How does gradient boosting build its model?Through sequential residual fitting. It reduces bias and achieves top tabular accuracy but can overfit if B is too large.
- In SVM with RBF kernel, what do large C and large γ imply?A complex decision boundary with low bias and high variance. SVM requires mandatory feature scaling.
- What are the key hyperparameters of SVM with RBF kernel?C (box constraint) and γ (kernel width). Feature scaling is mandatory.
- What are the key hyperparameters of k-NN?k (number of neighbors) and the distance metric. Feature scaling is mandatory.
- Which algorithms require no feature scaling?Decision Trees, Random Forests, and Gradient Boosting. Trees are monotone-invariant to scaling.
- What are the key hyperparameters of decision trees (CART)?max_depth, min_samples_split, and pruning parameter α.
- What are the key hyperparameters of Ridge/LASSO?λ ≥ 0, the penalty strength. Feature scaling is mandatory.
Velocer est gratuit : répétition espacée et vos propres cartes à partir de n'importe quel document.
PDF to flashcards · Lecture to flashcards · Practice exam · Syllabus study plan · Anki import
Plus de paquets de University of Wisconsin–Madison
- STAT 441: Advanced Sports Analytics · UW-Madison
- STAT 310: Probability & Math Statistics II · UW-Madison
- STAT 436: Statistical Data Visualization · UW-Madison
- STAT 709: Mathematical Statistics I · UW-Madison
- comp sci 240 midterm 1
- comp sci 240 midterm 2
- COMP SCI 240 Midterm 3
- COMP SCI 240 Final
- comp sci 300 full course review
- Math 234 - every chapter (multivariable calc)
- PSYCH 202 Exam 1 Review
- PSYCH 202 Exam 2 Review