在公众号「python风控模型」里回复关键字:学习资料

在数据挖掘中,我们经常用到逻辑回归算法。逐步回归又是筛选变量的一个自动化算法,被诸多大学教授讲述。我在机器学习项目中累计经验说明逐步回归有时是有用的,特别是存在较多相关性高的变量时,逐步回归可以很好降低模型维度,降低逻辑回归模型多重共线性。当然逐步回归不是完全消除模型多重共线性,而是很好改善情况,多重共线性是很难完全消除的。

下图是对乳腺癌数据集的逐步回归项目,模型维度降低一半,模型性能反而略有提高。这说明逐步回归是有效的。

当变量相关性不高情况下,我认为可以不用逐步回归,用了后模型性能反而下降。下图是give me some credit数据集测试,逐步回归后模型性能反而略有下降。

我今天看了国内某知名大学教授讲述逐步回归视频,案例是青岛市财政收入分析。他把很多自己观念强行和逐步回归结果联系起来。此教授过于强调GDP在经济中作用,我认为是不可取的。他认可制造业和工业这点我是赞同的。经济是一个非常复杂模型,变量之间存在复杂交互关系,我认为他光用逐步回归来解释是不全面的。

我认为逐步回归是一种变量筛选方法,但不能神话逐步回归。逐步回归还是有争议的。变量自动化筛选过程始终用的是同样数据集,这容易过渡拟合。逐步回归容易导致排除有价值变量,造成模型过于简单。其它争议还有很多,不一一阐述。

还是那句话,逐步回归是一种方法,只要能降低模型维度,得到满意模型性能,变量能够被业务方所解释,就是可以用的,但不能神话它和夸大它的作用。

机器学习是一门严谨学科,希望各位同学今后使用时要谨慎对待,要全面了解一种算法的利和弊以及什么时候可以使用。

最后附上一些逐步回归英文的解释

Criticism

Stepwise regression procedures are used in data mining, but are controversial. Several points of criticism have been made.

The tests themselves are biased, since they are based on the same data.Wilkinson and Dallal (1981)computed percentage points of the multiple correlation coefficient by simulation and showed that a final regression obtained by forward selection, said by the F-procedure to be significant at 0.1%, was in fact only significant at 5%.

When estimating the degrees of freedom, the number of the candidate independent variables from the best fit selected may be smaller than the total number of final model variables, causing the fit to appear better than it is when adjusting the r2 value for the number of degrees of freedom. It is important to consider how many degrees of freedom have been used in the entire model, not just count the number of independent variables in the resulting fit.

Models that are created may be over-simplifications of the real models of the data.

Such criticisms, based upon limitations of the relationship between a model and procedure and data set used to fit it, are usually addressed by verifying the model on an independent data set, as in the PRESS procedure.

Critics regard the procedure as a paradigmatic example of data dredging, intense computation often being an inadequate substitute for subject area expertise. Additionally, the results of stepwise regression are often used incorrectly without adjusting them for the occurrence of model selection. Especially the practice of fitting the final selected model as if no model selection had taken place and reporting of estimates and confidence intervals as if least-squares theory were valid for them, has been described as a scandal.Widespread incorrect usage and the availability of alternatives such as ensemble learning, leaving all variables in the model, or using expert judgement to identify relevant variables have led to calls to totally avoid stepwise model selection.

参考资料

1.《python机器学习-乳腺癌细胞挖掘》

2.《python信用评分卡建模(附代码)》

逻辑回归-逐步回归(stepwise regression)的一些思考相关推荐

  1. 使用聚类算法(Kmeans)进行数据降维并作为分类算法逻辑回归(logistic Regression)的数据预处理步骤实战

    使用聚类算法(Kmeans)进行数据降维并作为分类算法逻辑回归(logistic Regression)的数据预处理步骤实战 目录

  2. [机器学习] Coursera ML笔记 - 逻辑回归(Logistic Regression)

    引言 机器学习栏目记录我在学习Machine Learning过程的一些心得笔记,涵盖线性回归.逻辑回归.Softmax回归.神经网络和SVM等等.主要学习资料来自Standford Andrew N ...

  3. 逻辑回归模型(Logistic Regression, LR)基础

    逻辑回归模型(Logistic Regression, LR)基础 逻辑回归(Logistic Regression, LR)模型其实仅在线性回归的基础上,套用了一个逻辑函数,但也就由于这个逻辑函数, ...

  4. 逻辑回归模型(Logistic Regression, LR)基础 - 文赛平

     逻辑回归模型(Logistic Regression, LR)基础 - 文赛平 时间 2013-11-25 11:56:00 博客园精华区 原文  http://www.cnblogs.com/ ...

  5. Python机器学习算法 — 逻辑回归(Logistic Regression)

    逻辑回归--简介 逻辑回归(Logistic Regression)就是这样的一个过程:面对一个回归或者分类问题,建立代价函数,然后通过优化方法迭代求解出最优的模型参数,然后测试验证我们这个求解的模型 ...

  6. logisticregression参数_通俗地说逻辑回归【Logistic regression】算法(二)sklearn逻辑回归实战...

    前情提要: 通俗地说逻辑回归[Logistic regression]算法(一) 逻辑回归模型原理介绍 上一篇主要介绍了逻辑回归中,相对理论化的知识,这次主要是对上篇做一点点补充,以及介绍sklear ...

  7. 牛顿法python代码_python 牛顿法实现逻辑回归(Logistic Regression)

    本文采用的训练方法是牛顿法(Newton Method). 代码 import numpy as np class LogisticRegression(object): ""&q ...

  8. 机器学习算法与Python实践之逻辑回归(Logistic Regression)

    转载自:http://blog.csdn.net/zouxy09/article/details/20319673 机器学习算法与Python实践这个系列主要是参考<机器学习实战>这本书. ...

  9. 逻辑回归(Logistic Regression)

    一. 逻辑回归 在前面讲述的回归模型中,处理的因变量都是数值型区间变量,建立的模型描述是因变量的期望与自变量之间的线性关系.比如常见的线性回归模型: 而在采用回归模型分析实际问题中,所研究的变量往往不 ...

  10. 逻辑回归(Logistic Regression)原理详细总结

    逻辑回归(Logistic Regression)是一个分类算法,既可以用来解决二分类问题也可以解决多分类问题.那么为什么名为"回归"的算法却是用来解决分类问题的呢?本文将对逻辑回 ...

最新文章

  1. 《C++ primer》--第1,2章小结
  2. 【案例】弱电机房用电负荷计算意义及计算方法
  3. DCMTK:DcmAttributeFilter类的测试程序
  4. 计算机系统基础:设备管理采用的相关技术知识笔记
  5. CCF 201512-1 数位之和
  6. 开源无人机_开源无人机,欧洲开源等等
  7. 网络编程套接字Socket
  8. cocos js 3.8.1 clippingNode 不能被 ccui.ScrollView 或者ccui.Layout裁剪的bug
  9. (zz)最大子序列和问题
  10. Fiddler4抓包筛选条件方法
  11. telnet 测试IP和端口命令
  12. android.net.http.AndroidHttpClient Android6.0 API23以后失效
  13. snort 错误 (CentOS 8)
  14. ​SIGIR 2022 | 港大、武大提出KGCL:基于知识图谱对比学习的推荐系统
  15. mysql事务应该多复杂_可能是全网最好的MySQL重要知识点/面试题总结
  16. 手把手教用matlab做无人驾驶(二十三)--LMPC
  17. python爬虫进阶案例,Python进阶(二十)-Python爬虫实例讲解
  18. HDU3713 Double Maze(BFS)
  19. 央企招聘:中国航空油料集团2023公开招聘
  20. 99.扩展183.信息系统运维维护服务

热门文章

  1. gitee如何搭建mysql_Gitee的下载安装配置及使用步骤详解
  2. linux安装jdk详细步骤,需要有一定的语法基础
  3. 1个app的完整测试用例_APP测试流程
  4. 判断当前线程是否有管理者权限
  5. Android 虚线切割线
  6. CentOS 6.5 shell中su切换自动输入密码
  7. Mysql 时间戳类型使用心得
  8. log4j.xml配置示例
  9. [原创]jQuery的this和$(this)
  10. 正视苦难,民族的心灵史——1942