M2-069M2: Classical Machine LearningFeature SelectionMedium
⚡Flashcard Drill➔Mastery:
Feature Selection Strategies Under Severe Multicollinearity
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Diagnose with VIF, correlation heatmaps, or condition indices; resolve via Ridge/ElasticNet regularization, PCA orthogonalization, or hierarchical clustering pruning.
📌 Key Takeaways
- •VIF diagnostic: ; values or indicate severe collinearity
- •L1 vs L2: Lasso arbitrarily picks one correlated feature, whereas Ridge shares weights stably
- •Hierarchical clustering: group collinear features by correlation and retain the single most interpretable feature
📐 Mathematical Derivations
Variance Inflation Factor (VIF): For feature , regress it against all other features . The variance of the estimated coefficient is: . When , , causing explosive variance in parameter estimates and arbitrary sign flips. Matrix Condition: High condition number indicates near-singularity, making numerically unstable.
🏭 Production Trade-offs
Resolution strategies: ① Regularization: Ridge regression adds to , guaranteeing non-singular inversion. ElasticNet combines L1 (sparsity) and L2 (grouping effect), keeping groups of correlated features together. ② Clustering & Pruning: Cluster features using Spearman/Pearson correlation distance () and select the feature with the highest univariate target correlation or lowest missing rate from each cluster. ③ Dimensionality Reduction: Apply PCA to project correlated features onto orthogonal principal axes.
⚠️ Common Interview Pitfalls
- ✕Assuming tree models are completely immune to collinearity; while predictions remain accurate, feature importance becomes split and unreliable
- ✕Blindly using Lasso to interpret feature significance, unaware that it randomly drops all but one of a group of collinear features
🎯 Interviewer Follow-up Inquiries
- ?How does ElasticNet address the limitation of Lasso when dealing with groups of highly correlated features?
- ?Why does multicollinearity destabilize coefficient estimation in linear models without affecting overall prediction accuracy?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚
Associated Knowledge Base Guides & Mindmaps
Explore the comprehensive technical article, exam cards, and global architecture tree.
中文速览与面试要点
解释多重共线性下的特征选择策略
共线特征可任选其一或用正则(L2/EN)保留组信息;不宜按 p 值逐个删。
核心要点
- 共线下的问题:当两个特征高度相关时,它们的系数 不可单独识别 (有无穷多组系数给出相同的拟合),表现为系数方差巨大、符号不稳定、p 值不可靠。 为什么不能按 p 值逐个删 ——因为 p 值本身在共线下就不可靠(标准误被 VIF 放大),按不可靠的指标做决策会误删真正重要的特征(且删除一个后另一个的 p 值会突变,导致决策反复)。 四种策略 :① 保留全部 + L2 正则(岭回归) ——L2 把系数'均摊'到相关特征上(收缩但都保留),方差稳定,适合'预测优先、不需解释系数'的场景;② ElasticNet ——L1+L2 结合,既稀疏又在相关组上稳定('分组效应':相关特征倾向同进同出);③ 分组 Lasso / 稀疏组 Lasso ——显式把相关特征划为一组,整组选择或整组保留,符合'同组特征应同进同出'的直觉;④ PCA/降维 ——把相关特征合并为主成分(消除共线但牺牲可解释性)。
- 实践要点:① 诊断先行 ——计算 VIF(>10 严重)、条件数(>30 需注意)、相关矩阵,识别共线组;不要盲目删特征。② L1 的不稳定性机制 ——当两特征完全相关时,LASSO 的目标函数在'全给 A'与'全给 B'之间形成平坦的脊(ridge),数据微小扰动会使解跳到另一端;这是选择不稳定的根源。③ 业务导向的取舍 ——若两个共线特征中一个更易获取、更稳定、或业务含义更清晰,则保留它;这是'数据 + 业务'的综合决策,不能纯统计决定。④ 不要为了'系数显著'而删特征 ——这是常见的 p-hacking 形式;应明确研究目的:若为预测,保留并正则化;若为因果解释,需用专门方法(如工具变量、正交化)而非删特征。⑤ 树模型不受共线影响 ——树的分裂只依赖单特征的最优切分,共线不影响其预测性能(但会稀释重要度,见前文)。
- L1 在共线组中随机选一个(不稳定)
- ElasticNet/分组 Lasso 更稳
常见陷阱
- 按 p 值逐个删除共线特征
- 用 LASSO 处理强共线特征组(选择不稳定)