逻辑回归 解释_逻辑回归明确解释

逻辑回归 解释

Logistic Regression is the most widely used classification algorithm in machine learning. It is used in many real-world scenarios like spam detected, cancer detection, IRIS dataset, etc. Mostly it is used in binary classification problems. But it can also be used in multiclass classification.

Logistic回归是机器学习中使用最广泛的分类算法。 它用于许多现实情况中,例如检测到垃圾邮件,检测癌症,IRIS数据集等。通常用于二进制分类问题。 但是它也可以用于多类分类。

Logistic Regression predicts the probability that the given data point belongs to a certain class or not. In this article, I will be using the famous heart disease dataset from Kaggle.

Logistic回归预测给定数据点是否属于某个类别的概率。 在本文中,我将使用Kaggle著名的心脏病数据集。

Link for the dataset: https://www.kaggle.com/ronitf/heart-disease-uci

数据集链接: https : //www.kaggle.com/ronitf/heart-disease-uci

In this dataset, the main goal is to predict whether the given person has heart disease or not. In this case, logistic regression will predict the probability of whether the given person has heart disease or not.

在此数据集中,主要目标是预测给定的人是否患有心脏病。 在这种情况下,逻辑回归将预测给定人员是否患有心脏病的可能性。

For understanding logistic regression, first, you need to understand linear regression, as it forms the base for logistic regression.

为了理解逻辑回归,首先,您需要了解线性回归,因为它构成了逻辑回归的基础。

线性回归-简单概述 (Linear Regression — Simple Overview)

As you probably know earlier, linear Regression is a linear model that assumes that a relationship exists between the given input variables(independent variables) and the output variable(dependent variable).

您可能早先已经知道,线性回归是一个线性模型,它假定给定的输入变量(独立变量)和输出变量(独立变量)之间存在关系。

It suggests that the output value can be predicted as a linear combination of input variables. It basically tries to fit a straight line to the data.

这表明可以将输出值预测为输入变量的线性组合。 它基本上试图使数据拟合一条直线。

Linear Regression model
Linear Regression model
线性回归模型

If the variables are x1, x2, x3, and x4.

如果变量是x1,x2,x3和x4。

Then linear regression suggests that y value can be predicted as :

然后线性回归表明y值可以预测为:

y = w0 + w1*x1 + w2*x2 + w3*x3 + w4*x4

y = w0 + w1*x1 + w2*x2 + w3*x3 + w4*x4

The main goal of the linear regression model is to predict the optimal values of w0, w1, w2, w3 and w4 such that the cost function value is as low as possible.

线性回归模型的主要目标是预测w0, w1, w2, w3 and w4的最优值,以使成本函数值尽可能低。

What is the cost function? Cost Function quantifies the error between predicted values and expected values. For linear regression, the cost function used is the mean squared error.

成本函数是多少? 成本函数量化了预测值和期望值之间的误差。 对于线性回归,使用的成本函数是均方误差。

The formula for mean squared error is given by:

均方误差的公式为:

cost function of linear regression — mean squared error

m stands for the number of test samples.

m代表测试样品的数量。

h0(x) represents the predicted value.

h0(x)表示预测值。

y represents the actual value.

y代表实际值。

Now let’s move onto logistic regression.

现在让我们进入逻辑回归。

逻辑回归 (Logistic Regression)

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值