什么时候该去除相关(correlated)的features以及缺失值处理的思考

做机器学习时, 大家经常会看一下数据之间的相关性, 毕竟pandas也就一句话的事:
dataframe.corr(). 但是有没有想过为什么要做? 是不是不管什么模型都需要做?

为什么要做?

Correlated features, in general, don't improve models (although it depends on the specifics of the problem like the number of variables and the degree of correlation), but they affect specific models in different ways and to varying extents:

  1. For linear models (e.g., linear regression or logistic regression), multicolinearity can yield solutions that are wildly varying and possibly numerically unstable.

  2. Random forests can be good at detecting interactions between different features, but highly correlated features can mask these interactions.

More generally, this can be viewed as a special case of Occam's razor. A simpler model is preferable, and, in some sense, a model with fewer features is simpler. The concept of minimum description length makes this more precise.

树相关的集成模型要不要做?

不需要. 例如xgboost, 在计算gini index时候会给相同的feature 50%/50%的机会.
而相反, 处理缺失值, 却是对模型影响很大的.

那到底要不要做?

这个链接里有个人提到可以用相关性恢复缺失值, 这个直观上应该可行, 不过需要具体实验才知道, 并且这个相关性不能很强. 设想, 如果很强那么对于你的模型不就没有帮助了么?(那我在想, 那干嘛不直接把缺失值当作一个预测量来用其他变量预测呢...)
事实上, 本身不管用相关性(线性关系, 例如 皮尔逊积差系数)还是各种fancy的插值方法? 本质上是假设了数据之间的某种关系.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 难得放了两天假,昨天去市区逛了逛,还例行采购了一次。今天是清明节,吃完早饭发现出门肯定会很堵,就放弃了出远门的想法...
    李壹壹阅读 250评论 5 0
  • 源码地址(github) 堆叠滑动控件,类似于社交软件探探的效果,并增加以下扩展: 支持滑动方向控制 支持消失方向...
    wensefu阅读 2,555评论 1 3
  • 导 语 这次,舒淇冯德伦携手合作《侠盗联盟》夫妻同心、其利捞金。连老帅的刘德华,也沦为灯泡。 正 文 舒淇与冯德伦...
    飘雨桐V阅读 342评论 0 0