pandas - 单热编码的多重共线性

标签 pandas scikit-learn data-science

我们是否总是需要为单热编码删除一列以防止多重共线性? 在这里的解决方案(https://www.kaggle.com/omarelgabry/titanic/a-journey-through-titanic/comments#138896)中提到

@Kevin Chang You need to delete one column of the dummy variables to avoid the state of Multicollinearity. It's a state of very high correlations among the columns(independent variables); meaning that one can be predicted from the others. It is therefore, a type of disturbance in the data, and if present in the data the statistical conclusions made about the data may not be reliable.

在此处的解决方案中,没有考虑到多重共线性 https://www.kaggle.com/sharmasanthosh/allstate-claims-severity/exploratory-study-on-ml-algorithms

我可以知道这是必须的吗,或者在什么情况下我们需要满足它?

最佳答案

如果我必须回答您的问题“我们是否总是需要删除单热编码的列以防止多重共线性?”,答案是肯定的。

防止多重共线性的常用方法是从模型中删除高度相关的预测变量。如果您有两个或更多具有高 VIF 的因子,请从模型中删除一个。因为它们提供了冗余信息,所以移除其中一个相关因素通常不会降低 R 平方。

或者您可以使用偏最小二乘回归 (PLS) 或主成分分析,这些回归方法可将预测变量的数量减少到更小的不相关成分集。

关于pandas - 单热编码的多重共线性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42224430/

相关文章:

opencv - 如何使用一些 ML 技术使用可用的 ROI 掩码从真菌图像中提取 ROI

Python pandas : insert rows for missing dates, groupby 数据帧中的时间序列

python - 如何在 Python 中循环 GET 请求以从数据帧中的分页 API 接收所有数据

python - Seaborn Regplot 和 Scikit-Learn 逻辑模型的计算方式不同?

python - 混淆矩阵错误 "Classification metrics can' t 处理多标签指示符和多类目标的混合”

python - 线性回归 - 图像

python - 如果 pandas 中两个日期之间的日期,则查找每个 ID 的值总和

python - 使用 Pandas 的数据透视表的大数据

python - 如何提取新的子字符串作为列列

python - 一种使 pandas 中的转置等转换更快的优雅方法