Regression — as fancy as it sounds can be thought of as a “relationship” between any two things. For example, imagine you are on the ground and the temperature is 30 ℃. You start climbing a hill and as you climb, you realize that you are feeling colder and the temperature is dropping. As you reach the hilltop you see that temperature has decreased to 20 ℃ and its much colder now. Using this data, we can conclude that there is a relationship between height and temperature. This is termed as “regression” in statistics.

回归-听起来很花哨,可以看作是任何两件事之间的“关系”。 例如,假设您在地面上且温度为30℃。 您开始爬山时,随着爬山,您会发现自己感觉越来越冷,温度正在下降。 当您到达山顶时,您会发现温度已降至20℃,并且现在温度更低。 使用此数据,我们可以得出结论,高度和温度之间存在关系。 这在统计中称为“ 回归 ”。

Regression analysis is a form of predictive modeling technique that investigates the relationship between a dependent (target) and independent variable (s) (predictor). In a regression problem, we try to map input variables to a continuous function.

回归分析是一种预测建模技术,用于研究 变量(目标)与自变量 (预测变量)之间的关系 。 在回归问题中,我们尝试将输入变量映射到连续函数。

In the previously explained example, the temperature depends on height and hence is the “dependent” variable, whereas height is the “independent” variable. There may be various factors influencing the temperature such as humidity, pressure, even air pollution levels, etc. All such factors have a relationship with the temperature which can be written as a mathematical equation. We use this mathematical equation (cost function) to train the machine learning model on a given dataset so that our model can later predict the temperature at certain given conditions.

在前面所解释的例子中,温度取决于高度,并因此是“ 从属 ”变量,而高度是“ 独立 ”变量。 可能有多种影响温度的因素,例如湿度,压力,甚至空气污染水平等。所有这些因素都与温度有关系,可以用数学公式表示。 我们使用这个数学方程式( 成本函数 )在给定的数据集上训练机器学习模型,以便我们的模型以后可以预测在给定条件下的温度。

回归如何运作? (How does Regression work?)

Regression is a form of Supervised Machine Learning. We initially split the dataset into Training and Test set. Regression consists of a mathematical equation known as Cost Function. The cost function shows the relationship between independent and dependent variables. The objective of regression is to minimize this cost function which is achieved using optimization algorithms like Gradient Descent. The regression model is then trained on a training set to achieve ‘Line of Best Fit’. The below-given illustration shows how the line of best fit is found in linear regression.

回归是监督机器学习的一种形式。 我们最初将数据集分为训练和测试集。 回归包括一个称为成本函数的数学方程。 成本函数显示自变量和因变量之间的关系。 回归的目标是最小化使用优化算法(例如Gradient Descent )实现的成本函数。 然后在训练集上训练回归模型,以实现“ 最佳拟合线 ”。 下图显示了如何在线性回归中找到最佳拟合线。

Notice the minimization of the cost function in the illustration.
注意插图中成本函数的最小化。

Once trained and optimized, this model predicts outputs on a test set which is compared with observed output for accuracy.

经过训练和优化后,该模型将预测测试集上的输出,并与观察到的输出进行比较以确保准确性。

回归类型 (Types of regression)

线性回归 (Linear Regression)

This is the most fundamental regression model which needs to be understood to know the basics of regression analysis. When we have one predictor variable ‘x’ for one dependent or response variable ‘y’ that are linearly related to each other, the model is called Simple Linear Regression model. In the case of more than one predictor present (multiple input variables), the model is called Multiple Linear Regression model. The relation is defined using the equation:-

这是最基本的回归模型,需要了解回归分析的基础知识。 当我们有一个线性相关的因变量或响应变量“ y”的预测变量“ x”时 ,该模型称为简单线性回归模型 。 在存在多个预测变量(多个输入变量)的情况下,该模型称为多元线性回归模型 。 该关系使用以下公式定义:

The line that best fits the model is determined by the values of parameters b0 and b1. The difference between the observed outcome Y and the predicted outcome y is known as a prediction error. Hence, the values of b0 and b1 should be such that they minimize the sum of the squares of the prediction error.

最适合模型的线由参数b0和b1的值确定。 观察到的结果Y与预测结果y之差称为预测误差 。 因此,b0和b1的值应使它们最小化预测误差的平方和。

Error term e is the prediction error
误差项e是预测误差
Sum of squares of prediction error Q should be minimum
预测误差Q的平方和应最小

Linear Regression does not perform well on large datasets as it assumes a linear relationship between dependent and independent variables. That means it assumes that there is a straight-line relationship between them. It assumes independence between attributes.

线性回归在大型数据集上表现不佳,因为它假设因变量和自变量之间存在线性关系。 这意味着它假定它们之间存在直线关系。 它假定属性之间的独立性。

多项式回归 (Polynomial Regression)

Polynomial regression is similar to Multiple Linear Regression. However, in this type of regression, the relationship between X and Y variables is defined by taking the nth degree polynomial in X. Polynomial regression fits a non-linear model to the data but as an estimator, it is a linear model.

多项式回归类似于多元线性回归。 但是,在这种类型的回归中,X和Y变量之间的关系通过采用X中的n次多项式来定义。多项式回归将非线性模型拟合到数据中,但作为估计量,它是线性模型。

Polynomial regression models are analyzed for accuracy similar to Linear regression models but are slightly difficult to interpret as the input variables are highly correlated. The estimated value of the dependent variable Y is modeled with the equation (for the nth-order polynomial):

与线性回归模型相似,对多项式回归模型进行准确性分析,但由于输入变量高度相关,因此难以解释。 因变量Y的估计值用以下公式建模(对于n阶多项式):

The line that passes through the points will not be a straight line but a curved one depending on the power of X. High-degree polynomials are observed to induce more oscillations in the observed curve and have poor interpolator properties. See the illustration below to understand how polynomial regression works.

穿过点的线将不是直线,而是取决于X的幂的弯曲曲线。观察到高阶多项式会在观察到的曲线中引起更多的振荡,并且插值器的性能也很差。 请参阅下图以了解多项式回归的工作原理。

岭回归 (Ridge Regression)

A standard linear or polynomial regression will fail in the case where there is high collinearity among the feature variables. Collinearity is the existence of near-linear relationships among the independent variables.

在特征变量之间存在高共线性的情况下,标准线性或多项式回归将失败。 线性是自变量之间存在近线性关系。

We can first look at the optimization function of a standard linear regression to gain some insight as to how ridge regression can help:

我们首先可以查看标准线性回归的优化功能,以了解岭回归如何提供帮助:

Where X represents the feature/input variables, w represents the weights, and y represents the observed output.

其中X代表特征/输入变量, w代表权重, y代表观察到的输出。

Ridge Regression is a measure taken to reduce collinearity amongst regression predictor variables in a model. If the feature variables are correlated, the final regression model will be restricted and rigid in its approximation i.e it has high variance and will result in overfitting.

岭回归是一种用于减少模型中回归预测变量之间的共线性的措施。 如果特征变量相关,则最终回归模型将受到限制且近似逼近,即具有高方差并会导致过度拟合

The image shows underfitting, robust fit, and overfitting
该图显示了拟合不足,稳固拟合和过度拟合

Overfitting refers to a model that models the training data too well. Overfitting happens when a model learns the detail and noise in the training data to the extent that it negatively impacts the performance of the model on new data.

过度拟合是指对训练数据建模得太好的模型。 当模型学习训练数据中的细节和噪声时,就会过度拟合,从而对模型在新数据上的性能产生负面影响。

To solve this issue, Ridge Regression adds a small squared bias value to the variables:

为了解决这个问题,Ridge Regression向变量添加了一个小的平方偏差值:

The highlighted part is squared bias
突出显示的部分是偏差的平方

Such a squared bias factor pulls the feature variable coefficients away from this rigidness, introducing a small amount of bias into the model but greatly reducing the variance.

这样的平方偏差因子使特征变量系数远离此刚度,在模型中引入了少量偏差,但大大减小了方差。

套索回归 (Lasso Regression)

Lasso Regression is quite similar to Ridge Regression but the only difference is that it penalizes the absolute size of the regression coefficients instead of squared bias.

Lasso回归与Ridge回归非常相似,但唯一的区别是,它惩罚了回归系数的绝对大小而不是平方偏差。

The highlighted part is absolute bias
突出显示的部分是绝对偏差

By penalizing the absolute values, the estimated coefficients shrink more towards zero which could not be possible using ridge regression. This method makes it useful for feature selection where a set of variables and parameters are picked for model construction. LASSO takes the relevant features and zeroes the irrelevant values such that overfitting is avoided and also makes the learning faster.

通过对绝对值进行惩罚,估计的系数将更趋近于零,这是使用岭回归无法实现的。 这种方法对于特征选择很有用,在特征选择中选择一组变量和参数以进行模型构建。 LASSO具有相关特征并将不相关的值归零,从而避免了过拟合,并且使学习速度更快。

结论 (Conclusion)

Regression Analysis is a very interesting machine learning technique that can be applied in different areas to predict numerical values such as predicting the price of a product/house, predicting the number of goals soccer players score in a season, and predicting the BMI of people. I have covered four basic regression models in this blog. The rest require intensive knowledge of mathematics to understand. Hope you like this blog and find it informative!

回归分析是一种非常有趣的机器学习技术,可以应用于不同领域来预测数值,例如预测产品/房屋的价格,预测足球运动员在一个赛季中进球的数量以及预测人的BMI。 我在此博客中介绍了四个基本的回归模型。 其余的需要深入的数学知识才能理解。 希望您喜欢这个博客,并从中获得启发!

翻译自: https://medium.com/analytics-vidhya/understanding-regression-first-step-towards-machine-learning-9b5728ac65d3


http://www.taodudu.cc/news/show-863575.html

相关文章:

  • yolo yolov2_PP-YOLO超越YOLOv4 —对象检测的进步
  • 机器学习初学者_绝对初学者的机器学习
  • monk js_对象检测-使用Monk AI进行文档布局分析
  • 线性回归 c语言实现_C ++中的线性回归实现
  • 忍者必须死3 玩什么忍者_降维:忍者新手
  • 交叉验证和超参数调整:如何优化您的机器学习模型
  • 安装好机器学习环境的虚拟机_虚拟环境之外的数据科学是弄乱机器的好方法
  • 遭遇棘手 交接_Librosa的城市声音分类-棘手的交叉验证
  • 模型越复杂越容易惰性_ML模型的惰性预测
  • vgg 名人人脸图像库_您看起来像哪个名人? 图像相似度搜索模型
  • 机器学习:贝叶斯和优化方法_Facebook使用贝叶斯优化在机器学习模型中进行更好的实验
  • power-bi_在Power BI中的VertiPaq内-压缩成功!
  • 模型 标签数据 神经网络_大型神经网络和小数据的模型选择
  • 学习excel数据分析_为什么Excel是学习数据分析的最佳方法
  • 护理方面关于人工智能的构想_如何提出惊人的AI,ML或数据科学项目构想。
  • api数据库管理_API管理平台如何增强您的数据科学项目
  • batch lr替代关系_建立关系的替代方法
  • ai/ml_您本周应阅读的有趣的AI / ML文章(8月9日)
  • snowflake 使用_如何使用机器学习模型直接从Snowflake进行预测
  • 统计 python_Python统计简介
  • ios 图像翻转_在iOS 14中使用计算机视觉的图像差异
  • 熔池 沉积_用于3D打印的AI(第3部分):异常熔池分类的纠缠变分自动编码器
  • 机器学习中激活函数和模型_探索机器学习中的激活和丢失功能
  • macos上的硬盘检测工具_如何在MacOS上使用双镜头面部检测器(DSFD)实现90%以上的精度
  • 词嵌入应用_神经词嵌入的法律应用
  • 谷歌 colab_使用Google Colab在Python中将图像和遮罩拆分为多个部分
  • 美国人口普查年收入比赛_训练网络对收入进行分类:成人普查收入数据集
  • NLP分类
  • 解构里面再次解构_解构后的咖啡:焙炒,研磨和分层,以获得更浓的意式浓缩咖啡
  • 随机森林算法的随机性_理解随机森林算法的图形指南

了解回归:迈向机器学习的第一步相关推荐

  1. 机器学习实战第一步:特征选择与特征工程「附代码」

    https://www.toutiao.com/a6641904652575048206/ 2019-01-02 22:41:05 特征工程是机器学习的第一步,涉及清理现有数据集.提高信噪比和降低维数 ...

  2. SenseCore商汤AI大装置:人工智能迈向通用的第一步?

    随着时代洪流奔涌向前的你,准备好了吗? 全文5340字,阅读约需11分钟 来源 | 亿欧网 文|黄兆琦 马诗晴 编辑|常亮 "未来已经到来,只是分布不均." 后疫情时代,人们熟悉的 ...

  3. CSDN,毕业生有话说!在如此疯狂的年代如何寻找自己的方向?迈向社会的第一步

    活动地址:毕业季·进击的技术er 文章目录 CSDN邀请分享函 一.毕业后的去向:继续读研还是直接就业? 二.大学4年,令你印象深刻的bug追查记 三.大学期间技术学习方面最有成就感的事? 四.大学最 ...

  4. 虚拟化是云计算的第一步

    Gartner在一份关于云计算的研究报告中指出,云计算为虚拟化服务的发展创造了机会.有些用户可能还没有搞清云计算到底是什么东西,就已经开始筹划构建云基础设施了.VMware大中华区总裁宋家瑜表示:&q ...

  5. 大脑比机器智能_机器大脑的第一步

    大脑比机器智能 The race to Artificial Intelligence is a grueling, sweaty marathon that human beings have be ...

  6. Lesson 11.1-11.5 梯度下降的两个关键问题反向传播的原理走出第一步:动量法开始迭代:batch和epochs在Fashion—MNIST数据集熵实现完整的神经网络

    在之前的课程中,我们已经完成了从0建立深层神经网络,并介绍了各类神经网络所使用的损失函数.本节课开始,我们将以分类深层神经网络为例,为大家展示神经网络的学习和训练过程.在介绍PyTorch的基本工具A ...

  7. 机器学习学习吴恩达逻辑回归_机器学习基础:逻辑回归

    机器学习学习吴恩达逻辑回归 In the previous stories, I had given an explanation of the program for implementation ...

  8. 如何准备机器学习数据集_机器学习演练第一部分:准备数据

    如何准备机器学习数据集 Cleaning and preparing data is a critical first step in any machine learning project. In ...

  9. 吴恩达机器学习笔记第一周

    第一周 吴恩达机器学习笔记第一周 一. 引言(Introduction) 1.1 欢迎 1.2 机器学习是什么? 1.3 监督学习 1.4 无监督学习 二.单变量线性回归(Linear Regress ...

最新文章

  1. cosbench 安装
  2. 自动化监控--zabbix中的用户和用户组详解
  3. C语言 输入一个字符串,统计字符个数,并按照倒序输出该字符串。
  4. VC6获取硬盘序列号、型号、修订版本号
  5. Linux vim编写编译运行一个.c文件(centeos 8 HelloWorld.c)
  6. 商城是用jsp还是php,建设网上购物网站使用JSP系统还是ASP系统
  7. BZOJ 1083: [SCOI2005]繁忙的都市【Kruscal最小生成树裸题】
  8. GridView中合并单元格
  9. 荣耀:目前还在观望鸿蒙,未来的对手是苹果
  10. php 什么cms能让会员自已建个独立站并绑上二级域名?,CMS_帝国CMS使用二级域名并解决顶一下的方法,1、将2级域名解析指向到所在 - phpStudy...
  11. Linux 命令(15)—— umask 命令(builtin)
  12. C++虚调用及其调用的具体形式
  13. 3台机器配置hadoop集群_复制Hadoop集群之后无法访问端口50070的问题
  14. SVPWM分析、各个扇区详细计算以及Matlab仿真
  15. ERP系统-应收应付子系统-付款单
  16. 身体神经系统分布图高清,身体神经系统分布图片
  17. 测试团队的建设和管理
  18. Django restframework 认证
  19. websocket服务端和html客户端进行二进制数据交互
  20. 更换头像功能(前端)

热门文章

  1. 如何在centos安装python3.4
  2. 传统排插即将淘汰,品胜智能排插率先符合新国标
  3. work hard, think harder
  4. wp7后台文件传输之-----BackgroundTransferService(二)
  5. flink读mysql速度怎么样_[DB] Flink 读 MySQL
  6. 支付宝异步回调返回success_深入解决异步编程Promise对象的学习
  7. python异常值检测_python – 使用RPCA的异常值
  8. html给span标签设置index,html – 绝对定位嵌套元素的z-index
  9. CCF之地铁修建(100分)
  10. python基础教程--代码集合(上)