M2-100M2: Classical Machine LearningBias-Variance Tradeoff & Model SelectionMedium
⚡Flashcard Drill➔Mastery:

AIC, BIC, and Adjusted R-squared: Penalized Metrics vs Cross-Validation

📐 Mathematical Definition
AIC=2k−2log⁡L^,BIC=klog⁡n−2log⁡L^\text{AIC}=2k-2\log\hat L,\qquad \text{BIC}=k\log n-2\log\hat L
⚡ One-Sentence Core Answer
AIC and BIC penalize model complexity analytically based on likelihood; AIC asymptotically equates to Leave-One-Out CV, while BIC enforces selection consistency.

📌 Key Takeaways

  • •
    AIC: 2k−2ln⁡L^2k - 2\ln \hat{L}; optimizes predictive KL-divergence, asymptotically equivalent to LOO-CV
  • •
    BIC: kln⁡n−2ln⁡L^k \ln n - 2\ln \hat{L}; penalizes parameters more heavily for n>7n > 7, consistent model identification
  • •
    Adjusted R2R^2: 1−(1−R2)(n−1)n−k−11 - \frac{(1-R^2)(n-1)}{n-k-1}; degree-of-freedom correction restricted to linear regression

📐 Mathematical Derivations

Mathematical Formulations:
① Akaike Information Criterion (AIC): AIC=2k−2ln⁡L^\text{AIC} = 2k - 2\ln \hat{L}. Asymptotically estimates the expected Kullback-Leibler (KL) divergence between true data generating distribution g(x)g(x) and candidate model f(x∣θ^)f(x|\hat{\theta}). Stone (1977) proved that AIC is asymptotically equivalent to Leave-One-Out Cross-Validation (LOO-CV).
② Bayesian Information Criterion (BIC): BIC=kln⁡n−2ln⁡L^\text{BIC} = k \ln n - 2\ln \hat{L}. Derived from Laplace approximation of the marginal log-likelihood ln⁡P(D∣M)\ln P(D|M). BIC is consistent: as n→∞n \to \infty, the probability of selecting the true model converges to 1 (if true model is in the candidate set).
③ Adjusted $R^2$: Rˉ2=1−SSres/(n−k−1)SStot/(n−1)\bar{R}^2 = 1 - \frac{\text{SS}_{\text{res}} / (n - k - 1)}{\text{SS}_{\text{tot}} / (n - 1)}. Penalizes adding non-significant predictors but does not apply across non-nested or non-linear models.

🏭 Production Trade-offs

Efficiency vs Assumptions: AIC and BIC require only a single training fit on the full dataset, making them computationally instant compared to KK-fold cross-validation. However, they rely strictly on parametric likelihood assumptions. KK-fold CV is non-parametric, robust to model mis-specification, and directly measures test error.
⚠️ Common Interview Pitfalls
  • ✕
    Comparing AIC or BIC scores across models fit using different sample sizes nn or different response variable transformations
  • ✕
    Assuming lower AIC implies the simpler model is true; AIC prioritizes predictive accuracy and tends to overfit compared to BIC
🎯 Interviewer Follow-up Inquiries
  • ?
    Why is AIC asymptotically equivalent to Leave-One-Out Cross-Validation (LOO-CV)?
  • ?
    Under what conditions will BIC consistently recover the true data-generating model while AIC overfits?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
📚

Associated Knowledge Base Guides & Mindmaps

Explore the comprehensive technical article, exam cards, and global architecture tree.

← PreviousM2-099: Stochastic Depth (DropPath) vs Standard Dropout: Mechanisms and Differences📋Back to BankNext →M2-101: Learning Curves vs Validation Curves: Formulations and Diagnostic Workflows
中文速览与面试要点

解释 AIC、BIC 与调整 R²,以及它们与交叉验证的关系

信息准则 = 拟合优度 − 复杂度惩罚;AIC/BIC 用解析惩罚近似 CV,BIC 惩罚更强且有一致性。

核心要点

  • 三者的构造与含义:① AIC = 2k − 2log L̂——衡量'拟合优度(对数似然)减去参数个数的 2 倍惩罚';理论依据是 AIC 渐近无偏地估计了模型的 KL 风险 (预测分布与真实分布的差异),故目标偏向 预测最优 (可能选出比真模型更复杂的模型)。② BIC = k·log n − 2log L̂——惩罚更重(当 n>7 时 log n>2),且具有 一致性 :n→∞ 时以概率 1 选出真模型(若真模型在候选集中);故目标偏向 识别真模型 (更保守、更简洁)。③ 调整 R² = 1 − (1−R²)(n−1)/(n−k−1)——对 R² 做自由度校正,惩罚增加特征;但它只适用于 线性回归 且 不适用于比较非嵌套模型 (不同响应变量时不可比)。 与交叉验证的关系 :AIC/BIC 是 CV 的 解析近似 ——AIC 渐近等价于留一交叉验证(LOO-CV),BIC 则近似于某种加权的 CV;它们的优势是 只需一次拟合 (无需 K 次重训),在大数据上成本极低;劣势是依赖渐近假设(大样本、真模型在候选集中、似然正确指定)。
  • 实践选择与要点:① AIC vs BIC ——若目标是 预测 (不假设真模型在候选集中),用 AIC;若目标是 识别真模型 (如变量选择、科学推断),用 BIC。实践中 BIC 更常用(倾向简洁模型)。② 何时用 CV 而非信息准则 ——(a) 小样本(渐近近似不准);(b) 模型非嵌套或包含正则化(似然不标准);(c) 目标指标不是似然(如 AUC、F1)——此时 CV 更直接可靠。③ 信息准则的适用条件 ——需 极大似然估计 、 样本量足够 、 模型正确指定 (若模型误设,AIC/BIC 的解读需谨慎);且只能比较 同一响应变量 的模型(比较不同变换的 y 无意义)。④ 与正则化的关系 ——Lasso 等路径上的 λ 选择不能用 AIC/BIC 直接做(因为自由度定义模糊),应改用 BIC 的推广(EBIC) 、 CV 或 稳定性选择 。⑤ 自由度 k 的定义 ——对正则化模型 k 应是 有效自由度 (如岭回归的 tr(H)、Lasso 的非零系数个数),而非参数总数。⑥ 报告规范 ——报告多个准则(AIC/BIC/调整 R²/CV)并说明一致性;若结论冲突,应说明依据(预测 vs 解释)。
  • AIC 惩罚 2k,BIC 惩罚 k·log n(n>7 时更严)
  • BIC 具有模型选择一致性(n→∞ 选出真模型)

常见陷阱

  • 用 AIC/BIC 比较不同响应变量变换的模型
  • 把正则化模型的参数总数当作自由度 k