当前位置:网站首页>1.4 机器学习方法之回归问题
1.4 机器学习方法之回归问题
2022-06-29 08:33:00 【风轻云淡_Cauchy】
1.3 机器学习方法之回归问题
回归分析用于预测输入变量和输出变量之间的关系,特别是当输入变量的值发生变化时,输出变量值也随之发生变化。


1. 线性回归
线性回归算法假设特征和结果满足线性关系。这就意味着可以将输入项分别乘以一些常量,再将结果加起来得到输出。
模型
选择拟合函数形式 h θ ( x ) = ∑ i = 0 n θ i X i = θ ⊤ X h_{\theta}(x)=\sum_{i=0}^n{\theta_iX_i}=\theta^{\top}X hθ(x)=∑i=0nθiXi=θ⊤X
用去描述特征里面的分量,比如 x 1 x_1 x1房间的面积, x 2 x_2 x2房间的朝向,等等,做出一个估计函数:
h ( x ) = h θ ( x ) = θ 0 + θ 1 x 1 + θ 2 x 2 h(x) = h_{\theta}(x) = \theta_0 + \theta_1x_1 + \theta_2x_2 h(x)=hθ(x)=θ0+θ1x1+θ2x2策略
确定损失函数形式:
J ( θ ) = 1 2 ∑ i = 1 m ( h θ ( x ( i ) ) − y ( i ) ) 2 J(\theta) = \frac{1}{2}\sum_{i=1}^m(h_{\theta}(x^{(i)})-y^{(i)})^2 J(θ)=21i=1∑m(hθ(x(i))−y(i))2
m i n θ J ( θ ) \underset{\theta}{min}J(\theta) θminJ(θ)算法
梯度下降法。首先对 θ \theta θ赋值,这个值可以是随机的,也可以让 θ \theta θ是一个全零的向量。
改变 θ \theta θ 的值,使得 J ( θ ) J(\theta) J(θ) 按梯度下降的方向进行减少,算法的结束将是在 θ \theta θ 下降到无法继续下降为止。
1.1 最小二乘法
参见《机器学习之线性回归最小二乘法》
1.2 岭回归
岭回归(英文名:ridge regression, Tikhonov regularization)是一种专用于共线性数据分析的有偏估计回归方法,实质上是一种改良的最小二乘估计法,通过放弃最小二乘法的无偏性,以损失部分信息、降低精度为代价获得回归系数更为符合实际、更可靠的回归方法,对病态数据的拟合要强于最小二乘法。
1.3 Lasso回归
Lasso回归是一种压缩估计。它通过构造一个惩罚函数得到一个较为精炼的模型,使得它压缩一些系数,同时设定一些系数为零。因此保留了子集收缩的优点,是一种处理具有复共线性数据的有偏估计。
适用场景:样本量比较小,但是指标非常多。适用于高维统计,传统的方法无法应对这样的数据。并且Lasso可以进行特征选择。
基本定理。Lasso参数估计被定义如下

1.3.1 回归案例:某市财政收入预测
在已有研究的基础上运用Lasso特征选择的方法研究影响地方财政收入的因素,在Lasso特征选择的基础上,使用支持向量回归SVR模型,对选择的特征进行回归分析,得到财政收入的预测模型。案例代码是基于python+pandas+numpy+scikit-learn实现的。
财政收入数据的基础情况。各项特征名称:社会从业人数x1、在岗职工工资总额x2、社会消费品零售总额x3、城镇居民人均可支配收入x4、城镇居民人均消费性支出x5、年末总人口x6、全社会固定资产投资额x7、地区生产总值x8、第一产业产值x9、税收x10、居民消费价格指数x11、第三产业与第二产业产值比x12、居民消费水平x13。





















边栏推荐
- 微信小程序搜索关键字高亮和ctrl+f搜索定位实现
- pytorch总结—自动求梯度
- 微信小程序最新canvas2d手写签名
- Training view (issue temporary storage)
- Recursive RBAC menu level display infinite classification
- What exactly does Devops mean?
- (转)MySQL: ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- Write down some written test questions
- NPM common commands
- jar包和war包
猜你喜欢

UE4 编译单个文件(VS与编辑器分别启动)

Wechat applet user refuses to authorize geographic location information and calls up the authorization window again

Universal target detection based on region attention

Record the field name dynamically modified by SetData of wechat applet

Wechat applet wx Navigateback returns the parameters carried on the previous page

MT yolov6 training and testing

笔试题“将版本号从大到小排列”

js轮播图观后重做(较长的完整版,可运行)

Keras to tf Vgg19 input in keras_ shape
![[target detection] | indicator a probabilistic challenge for object detection](/img/82/7b830d44bed7b1509cb0cdfed88e3e.png)
[target detection] | indicator a probabilistic challenge for object detection
随机推荐
Professional structure record
Hb5470 combustion test of non-metallic materials in civil aircraft cabin
Wechat applet project: wechat applet page layout
Augfpn: improved multiscale feature learning for target detection
Redo after JS rotation view (longer full version, can be run)
Wechat applet sharing page, sharing to the circle of friends
微信小程序搜索关键字高亮和ctrl+f搜索定位实现
Open3d farthest point sampling (FPS)
Laravel 8 enables the order table to be divided by month level
Research progress of target detection in the era of deep convolutional neural network
Augfpn: amélioration de l'apprentissage des caractéristiques à plusieurs échelles pour la détection des cibles
调试H5页面-vConsole
jar包和war包
Pytorch learning summary - memory cost of operation
Verilog splicing operation symbol
PAT (Basic Level) Practice (中文)1003 我要通过! (20分) C语言实现
Pytorch summary learning series - operation
pytorch总结—自动求梯度
Wechat applet sub components transfer values to the page (communication between parent and child components) with source code
CMD enter virtual machine