逻辑回归模型_逻辑回归

逻辑回归模型

By Neeta Ganamukhi

Neeta Ganamukhi着

Department of Business and Economics

商业与经济系

Abstract: The main aim of this term paper is to describe the Logistic Regression Algorithm, a supervised model used for classification. The paper describes Logistic Regression for Machine Learning, types of Logistic Regression and hypothesis, multinomial and ordinal are not covered in this paper. The paper also covers Sigmoid function, Decision Boundary Data Preparation, Cost function, Gradient descent, Difference between linear and logistic regression, and Pros and cons of Logistic Regression.

摘要:本学期论文的主要目的是描述Logistic回归算法,这是一种用于分类的监督模型。 本文描述了机器学习的Logistic回归,本文不涉及Logistic回归和假设的类型,多项式和序数。 本文还介绍了Sigmoid函数,决策边界数据准备,成本函数,梯度下降,线性和逻辑回归之间的差异以及Logistic回归的优缺点。

Keywords — Logistic Regression, Sigmoid function,Cost function, Gradient descent etc.,

关键字— Logistic回归,Sigmoid函数,Cost函数,梯度下降等,

Introduction

介绍

Every machine learning algorithm performs best under a given set of conditions. To ensure good performance, we must know which algorithm to use depending on the problem at hand. We cannot just use one algorithm for all problems. For example: Linear regression algorithm cannot be applied on a categorical dependent variable. This is where Logistic Regression comes in. Logistic regression is a supervised learning classification algorithm used to predict the probability of a target variable. It extends the idea of linear regression to situation where outcome variable is categorical. In simple words, the dependent variable is binary in nature having data coded as either 1 (stands for success/yes) or 0 (stands for failure/no).

在给定的条件下,每种机器学习算法都表现最佳。 为了确保良好的性能,我们必须根据手头的问题知道使用哪种算法。 我们不能仅对所有问题使用一种算法。 例如:线性回归算法不能应用于分类因变量。 这就是Logistic回归的用处。Logistic回归是一种监督学习分类算法,用于预测目标变量的概率。 它将线性回归的概念扩展到结果变量是分类的情况。 简而言之,因变量本质上是二进制的,其数据编码为1(代表成功/是)或0(代表失败/否)。

I. WHAT IS LOGISTIC REGRESSION IN MACHINE LEARNING?

I.机器学习中的逻辑回归是什么?

Logistic Regression is the alternative to regression analysis to conduct when the dependent variable has a binary solution. Mathematically, a logistic regression model predicts P(Y=1) as a function of X. Instead of Y as outcome variable (like in regression), we use function of Y called the Logit a.k.a. log odds = log (P(positive)/P(negative)). Logit can be modeled as a linear function of the predictors. It can also be mapped back to a probability, which, in turn, can be mapped to a class. Logit is one of the simplest Machine Learning function that can be used for various classification problems such as spam detection, Diabetes prediction, cancer detection, Online transactions Fraud or not Fraud, Tumor Malignant or Benign etc.

当因变量具有二进制解时,逻辑回归是进行回归分析的替代方法。 数学上,逻辑回归模型将P(Y = 1)预测为X的函数。我们使用Y的函数(称为Logit aka log赔率= log(P(正)/ P(负))。 Logit可以建模为预测变量的线性函数。 也可以将其映射回概率,然后将其映射到一个类别。 Logit是最简单的机器学习功能之一,可用于各种分类问题,例如垃圾邮件检测,糖尿病预测,癌症检测,在线交易欺诈或不欺诈,肿瘤恶性或良性等。

II. TYPES OF LOGISTIC REGRESSION

二。 逻辑回归的类型

Generally, logistic regression means binary logistic regression having binary target variables, but there can be two more categories of target variables that can be predicted by it. Based on those number of categories, Logistic regression can be divided into following types:

通常,逻辑回归是指具有二进制目标变量的二进制逻辑回归,但是可以通过它预测两类以上的目标变量。 根据这些类别的数量,逻辑回归可以分为以下几种类型:

A. Binary or Binomial

A.二元或二项式

B. Multinomial

B.多项式

C. Ordinal

C.序数

A. Binary or Binomial Regression : In such a kind of classification, a dependent variable will have only two possible outcomes either 1 and 0. For example, these variables may represent success or failure, yes or no, win or loss etc. For detailed information, see reference[1]

A. 二元或二项回归:在这种分类中,因变量将只有两个可能的结果1和0。例如,这些变量可能表示成功或失败,是或否,赢或输等。有关详细信息信息,请参阅参考文献[1]

B. Multinomial Regression : In such a kind of classification, dependent variable can have 3 or more possible unordered outcomes or the outcome having no quantitative significance. For example, these variables may represent “Type A” or “Type B” or “Type C”. For detailed information, see reference[2]

B. 多项式回归:在这种分类中,因变量可以具有3个或更多可能的无序结果,或者结果没有定量意义。 例如,这些变量可以表示“类型A”或“类型B”或“类型C”。 有关详细信息,请参见参考文献[2]。

C. Ordinal Regression : In such a kind of classification, dependent variable can have 3 or more possible ordered outcomes or the outcomes having a quantitative significance. For example, these variables may represent “poor” or “good”, “very good”, “Excellent” and each category can have the scores like 0,1,2,3.For detailed information, see reference[3]

C. 有序回归:在这种分类中,因变量可以具有3个或更多可能的有序结果或具有定量意义的结果。 例如,这些变量可以表示“差”或“好”,“非常好”,“优秀”,并且每个类别的得分都可以为0、1、2、3。有关详细信息,请参见参考文献[3]。

III. LOGISTIC FUNCTION

三, 物流功能

Logistic regression is named for the function used at the core of the method, the logistic function. The logistic function, also called the sigmoid function was developed by statisticians to describe properties of population growth in ecology, rising quickly and maxing out at the carrying capacity of the environment. It’s an S-shaped curve that can take any real-valued number and map it into a value between 0 and 1, but never exactly at those limits.

Logistic回归是为方法核心使用的函数Logistic函数而命名的。 统计学家开发了逻辑函数 ,也称为乙状结肠函数,以描述生态中人口增长的特性,该特性Swift上升并在环境的承载能力最大化。 这是一条S形曲线,可以采用任何实数值并将其映射为0到1之间的一个值,但永远不能精确地位于这些极限处。

IV. WHAT IS SIGMOID FUNCTION?

IV。 什么是SIGMOID功能?

In order to map predicted values to probabilities, we use the Sigmoid function. The function maps any real value into another value between 0 and 1. In machine learning, we use sigmoid to map predictions to probabilities. The sigmoid curve can be represented with the help of following graph. We can see the values of y-axis lie between 0 and 1 and crosses the axis at 0.5.

为了将预测值映射到概率,我们使用Sigmoid函数。 该函数将任何实际值映射到0到1之间的另一个值。在机器学习中,我们使用Sigmoid将预测映射到概率。 可以通过下图来表示S型曲线。 我们可以看到y轴的值介于0和1之间,并且与该轴的交点为0.5。

The following equation is used to presents Sigmoid function: 1/1+e^-z .The classes can be divided into positive or negative. The output is the probability of positive class if it lies between 0 and 1. For detailed information, see reference[4] Now, let us understand the application of sigmoid function in non-linear classification.

以下方程式用于表示Sigmoid函数: 1/1 + e ^ -z 。可以将这些类分为正数或负数。 如果输出在0到1之间,则为正分类的概率。有关详细信息,请参见参考资料[4]。现在,让我们了解S型函数在非线性分类中的应用。

V. LOGISTIC REGRESSION HYPOTHESES

V.逻辑回归假设

When using Linear regression, we use a formula of the hypothesis i.e.

使用线性回归时,我们使用假设的公式,即

Image for post

For Logistic Regression, there is a little modification in the equation i.e.

对于Logistic回归,方程中有一些修改,即

Image for post

We have expected that hypothesis will give values between 0 and 1.

我们已经预期该假设将给出0到1之间的值。

Image for post

Thus, hypothesis for Logistic Regression can be represented as,

因此,逻辑回归假设可以表示为:

Image for post

We know that, the simplest form of logistic regression is binary or binomial logistic regression in which the target or dependent variable can have only 2 possible outcomes either 1 or 0. It allows us to model a relationship between multiple predictor variables and a binary/binomial target variable. Hence, the above equation can be represented as,

我们知道,逻辑回归的最简单形式是二进制或二项式逻辑回归,其中目标变量或因变量只能具有2个可能的结果,即1或0。这使我们可以对多个预测变量与二进制/二项式之间的关系进行建模。目标变量。 因此,以上等式可以表示为:

Image for post

Here,g is the logistic or sigmoid function which can be given as follows:

在这里,g是逻辑或S型函数,可以给出如下:

Image for post

We can call a Logistic Regression a Linear Regression model, but the Logistic Regression uses a complex cost function called Sigmoid function instead of a linear function. The hypothesis of logistic regression limits this sigmoid function between 0 and 1. Therefore linear functions fail to represent it as it can have a value greater than 1 or less than 0 which is not possible as per the hypothesis of logistic regression. In case of logistic regression, the linear function is basically used as an input to another function such as 𝑔 in the above equation. For more detailed information, see reference[5]

我们可以将Logistic回归称为线性回归模型,但是Logistic回归使用称为Sigmoid函数而不是线性函数的复杂成本函数。 Logistic回归的假设将这种S形函数限制在0到1之间。因此,线性函数无法表示它,因为它的值可以大于1或小于0,这在Logistic回归的假设中是不可能的。 在逻辑回归的情况下,线性函数基本上用作其他函数的输入,例如上式中的。 有关更多详细信息,请参见参考文献[5]。

VI. LOGISTIC REGRESSION PREDICTS PROBABILITIES

VI。 逻辑回归预测概率

The idea behind logistic regression is straightforward: Instead of using Y directly as the outcome variable, we use a function of it, which is called the logit. The logit, it turns out, can be modeled as a linear function of the predictors. Once

Logistic回归背后的想法很简单:我们不使用Y作为结果变量,而是使用它的函数,称为logit。 结果证明,对数可以建模为预测变量的线性函数。 一旦

the logit has been predicted; it can be mapped back to a probability.

Logit已被预测; 可以将其映射回概率。

To understand the logit, First, we look at p = P(Y = 1), the probability of belonging to class 1 (as opposed to class 0). In contrast to the binary variable Y, which only takes the values 0 and 1, p can take any value in the interval [0; 1]. However, if we express p as a linear function of the q predictors in the form

为了理解对数,首先,我们看一下p = P(Y = 1),即属于1类(而不是0类)的概率。 与仅取值0和1的二进制变量Y相比,p可以取区间[0; 0]中的任何值。 1]。 但是,如果我们将p表示为q个预测变量的线性函数,则形式为

p =β0 +β1x1 +β2x2+ _ _ _ +βqxq;

p =β0+β1x1+β2x2+ _ _ _ +βqxq;

it is not guaranteed that the right-hand side will lead to values within the interval [0; 1]. The solution is to use a nonlinear function of the predictors in the form

不能保证右侧会导致间隔[0; 1]。 解决方案是使用以下形式的预测变量的非线性函数:

Image for post

This is called the logistic response function. For any values x1; : : : ; xq, the righthand side will always lead to values in the interval [0; 1]. Next, we look at a different measure of belonging to a certain class, known as odds. The odds of Y belonging to class 1 are defined as the ratio of the probability of belonging to class 1to the probability of belonging to class 0:

这称为逻辑响应函数。 对于任何值x1; :::; xq,右侧总是会导致间隔[0; 1]。 接下来,我们看一看属于某个类别的另一种衡量标准,称为赔率。 属于类别1的Y的几率定义为属于类别1的概率与属于类别0的概率之比:

Image for post

This metric is very popular in horse races, sports, gambling, epidemiology, and other areas. Instead of talking about the probability of winning or contacting a disease, people talk about the odds of winning or contacting a disease. If, for example, the probability of winning is 0.5, the odds of winning are 0.5/0.5 = 1. We can also perform the reverse calculation: Given the odds of an event, we can compute its probability by manipulating equation

此指标在赛马,体育,赌博,流行病学和其他领域中非常受欢迎。 人们谈论的不是赢得或接触疾病的可能性,而是谈论赢得或接触疾病的可能性。 例如,如果获胜的概率为0.5,则获胜的概率为0.5 / 0.5 =1。我们还可以执行逆向计算:给定事件的赔率,我们可以通过操纵方程式来计算其概率

Image for post

From the above equations, we can write the relationship between the odds and the predictors as:

从以上等式,我们可以将几率与预测变量之间的关系写为:

Image for post

The equation above describes a multiplicative (proportional) relationship between the predictors and the odds. Such a relationship is interpretable in terms of percentages, for example, a unit increase in predictor Xj is associated with an average increase of βj*100% in the odds (holding all other predictors constant).

上面的等式描述了预测变量和几率之间的乘法(比例)关系。 这种关系可以用百分比来解释,例如,预测变量Xj的单位增加与赔率中βj* 100%的平均增加相关联(保持所有其他预测变量不变)。

Now, if we take a natural logarithm2 on both sides, we get the standard formulation of a logistic model:

现在,如果我们两边都采用自然对数2,我们将得到逻辑模型的标准公式:

Image for post

The log(odds), called the logit, takes values from -∞ (very low odds) to ∞ (very high odds). A logit of 0 corresponds to even odds of 1 (probability =0.5). Thus, the final formulation of the relation between the outcome and the predictors uses the logit as the outcome variable and models it as a linear function of the q predictors. For more detailed information, see reference[6]

log(odds)称为logit,取值范围为-∞(极低几率)到∞(极高几率)。 对数为0时,偶数赔率为1(概率= 0.5)。 因此,结果和预测变量之间关系的最终表述使用logit作为结果变量,并将其建模为q预测变量的线性函数。 有关更多详细信息,请参见参考文献[6]。

VII. DECISION BOUNDARY

七。 决策边界

We expect our predictors to give us a set of outputs or classes based on probability when we pass the inputs through a prediction function and returns a probability score between 0 and 1.For Example, consider we have 2 classes, male and female (1 — male, 0 — female). We basically decide with a threshold value above which we classify values into Class 1 and of the value goes below the threshold then we classify it in Class 2.

当我们通过预测函数传递输入并返回介于0到1之间的概率得分时,我们期望我们的预测变量根据概率为我们提供一组输出或类别。例如,假设我们有2个类别,男性和女性(1 –男,0-女)。 我们基本上用一个阈值来决定,在该阈值之上,我们将值分类为1类,并且该值低于阈值,然后将其分类为2类。

Image for post
Fig3. Decision Boundary 图3 。 决策边界

As shown in the above graph we can choose the threshold as 0.5, if the prediction function returned a value of 0.7 then we would classify this observation as Class 1(male). If our prediction returned a value of 0.2 then we would classify the observation as Class 2(female). For more detailed information, see reference[7]

如上图所示,我们可以将阈值选择为0.5,如果预测函数返回的值为0.7,则可以将该观察结果分类为1类(男性)。 如果我们的预测返回值0.2,则将观测值分类为2类(女性)。 有关更多详细信息,请参见参考文献[7]。

Now that we know how to make predictions using logistic regression, let’s look at how we can prepare our data to get the most from the technique.

现在我们知道了如何使用逻辑回归进行预测,下面让我们看一下如何准备数据以充分利用该技术。

VIII. ASSUMPTIONS FOR LOGISTIC REGRESSION

八。 逻辑回归的假设

1) The logistic regression assumes that there is minimal or no multicollinearity among the independent variables.

1)Logistic回归假设自变量之间没有多重共线性。

2) The logistic regression assumes that the independent variables are linearly related to the log of odds.

2)逻辑回归假设自变量与几率对数线性相关。

3) The logistic regression usually requires a large sample size to predict properly.

3)Logistic回归通常需要大量样本才能正确预测。

4) The Logistic regression which has two classes assumes that the dependent variable is binary and ordered logistic regression requires the dependent variable to be ordered.

4)具有两类的Logistic回归假定因变量是二进制,而有序Logistic回归则要求因变量是有序的。

5) The Logistic regression assumes the observations to be independent of each other.

5)Logistic回归假设观测值彼此独立。

IX. COST FUNCTION

九。 成本函数

Once the model is developed, the question arises how good our model is? In Machine Learning, cost functions are used to estimate the model performance. In other words, a cost function is a measure of how good/bad the model is in terms of its ability to estimate the relationship between X and Y. This is typically expressed as a difference or distance between the predicted value and the actual value.

一旦建立模型,就会出现一个问题,我们的模型有多好? 在机器学习中,成本函数用于估计模型性能。 换句话说,成本函数是根据模型估计X和Y之间关系的能力来衡量模型的好坏的度量。这通常表示为预测值和实际值之间的差异或距离。

We learnt about the cost function J(θ) in the Linear regression, the same cost function will not work for logistic regression. If we try to use the cost function of the linear regression in ‘Logistic Regression’ then it would be of no use as it would end up being a non-convex function with many local minimums, in which it would be very difficult to minimize the cost value and find the global minimum. This strange outcome is because in logistic regression we have the sigmoid function around, which is non-linear (i.e. not a line).

我们了解了线性回归中的成本函数J(θ),相同的成本函数不适用于逻辑回归。 如果我们尝试在'Logistic回归'中使用线性回归的成本函数,那么它将毫无用处,因为它将最终成为具有许多局部最小值的非凸函数,其中很难最小化成本值并找到全局最小值。 这个奇怪的结果是因为在逻辑回归中,我们具有S形函数,它是非线性的(即不是直线)。

Image for post
Fig 4 Non-convex Function 图4非凸函数

With the J(θ) depicted in the figure above. the gradient descent algorithm might get stuck in a local minimum point. That’s why we still need a neat convex function just like in linear regression, a bowl-shaped function that eases the gradient descent function’s work to converge to the optimal minimum point. For more detailed information, see reference[8].

上图中描绘了J(θ)。 梯度下降算法可能会卡在局部最小点中。 这就是为什么我们仍然需要一个整齐的凸函数,就像线性回归一样,它是一个碗形函数,可以简化梯度下降函数的工作以收敛到最佳最小值。 有关更多详细信息,请参见参考文献[8]

The cost function used in Linear regression is given by,

线性回归中使用的成本函数由下式给出:

Image for post

Which can be written in a slightly different way as,

可以这样写:

Image for post

Now let’s make it more general by defining a new function:

现在,让我们通过定义一个新函数使其更加通用:

Image for post

We can rewrite the cost function for the linear regression as follows:

我们可以如下重写线性回归的成本函数:

Image for post

For logistic regression, the Cost function is defined as:

对于逻辑回归,成本函数定义为:

Image for post
Image for post
Fig 5 Cost Function 图5成本函数

We can make it more compact into a one-line expression: this will help avoiding if/else statements when converting the formula into an algorithm.

我们可以使其更紧凑以成为单行表达式:这将有助于避免在将公式转换为算法时使用if / else语句。

Image for post

Replace y with 0 and 1 and you will end up with the two parts of the original function. With the optimization in place, the logistic regression cost function can be rewritten as:

将y替换为0和1,您将得到原始函数的两个部分。 进行优化后,逻辑回归成本函数可以重写为:

Image for post

The above equation can be compressed into one cost function given by,

可以将以上方程压缩为下式给出的一个成本函数:

Image for post

For more detailed information, see reference[8]

有关更多详细信息,请参见参考文献[8]。

X. GRADIENT DESCENT

X. 梯度下降

After finding the cost function for Logistic Regression, our job should be to minimize it i.e. min J(θ). Gradient Descent is an optimization algorithm that helps machine learning models to find out paths to a minimum value using repeated steps. Gradient descent is used to minimize a function so that it gives the lowest output of that function. This function is called the Loss Function. The loss function shows us how much error is produced by the machine learning model compared to actual results. Our aim should be to lower the cost function as much as possible. One way of achieving a low cost function is by the process of gradient descent. Complexity of some equations makes it difficult to use, partial derivative of the cost function with respect to the considered parameter can provide optimal value. The general form of gradient descent:

找到Logistic回归的成本函数后,我们的工作应该是将其最小化,即最小J(θ)。 梯度下降是一种优化算法,可帮助机器学习模型使用重复步骤找出最小值的路径。 梯度下降用于最小化一个函数,以便它给出该函数的最低输出。 此功能称为损失功能。 损失函数向我们展示了与实际结果相比,机器学习模型产生了多少错误。 我们的目标应该是尽可能降低成本函数。 实现低成本功能的一种方法是通过梯度下降过程。 一些方程的复杂性使其难以使用,成本函数相对于所考虑参数的偏导数可以提供最佳值。 梯度下降的一般形式:

Image for post

For min J(θ), repeat the above equation until convergence, simultaneously update all θj.For more detailed information, see reference[9].

对于最小J(θ),重复上述公式直到收敛,同时更新所有θj。有关更多详细信息,请参见参考文献[ 9]

In simple words, Gradient Descent has an analogy in which we must imagine ourselves at the top of a mountain valley and left stranded and blindfolded, our objective is to reach the bottom of the hill. Feeling the slope of the terrain around you is what everyone would do. Well, this action is analogous to calculating the gradient descent, and taking a step is analogous to one iteration of the update to the parameters.

简而言之,梯度下降有一个比喻,我们必须想象自己在山谷的顶部,被困和蒙住双眼,我们的目标是到达山脚。 每个人都会做的就是感觉周围地形的坡度。 好吧,此操作类似于计算梯度下降,并且采取的步骤类似于对参数更新的一次迭代。

Image for post
Fig 6 Gradient descent 图6梯度下降

XI. LOGISTIC vs LINEAR REGRESSION

十一。 逻辑与线性回归

1) In logistic regression, the outcome (dependent variable) has only a limited number of possible values whereas linear regression, the outcome is continuous.

1)在逻辑回归中,结果(因变量)只有有限数量的可能值,而线性回归中,结果是连续的。

2) Logistic regression is used when the response variable is categorical in nature whereas Linear regression is used when response variable is continuous.

2)当响应变量本质上是分类的时,使用逻辑回归;而当响应变量是连续的时,则使用线性回归。

3) Logistic regression gives an equation which is of the form Y=1/1+e^-z, Linear regression gives an equation which is of the form Y =mx+C

3)逻辑回归给出的方程式形式为Y = 1/1 + e ^ -z,线性回归给出的方程式形式为Y = mx + C

4) Logistic regression uses maximum likelihood method[20] to arrive at the solution and cost function which causes large errors to be penalized to an asymptotic constant whereas Linear regression uses ordinary least squares method to minimize the errors and arrive at a best possible fit. For more information, see reference[10]

4)Logistic回归使用最大似然法[20]得出解和成本函数,这导致大误差被罚为渐近常数,而线性回归使用普通最小二乘法来使误差最小化并获得最佳拟合。 有关更多信息,请参见参考文献[10]。

5) Graphical representation of Logistic vs Linear Regression:

5)Logistic回归与线性回归的图形表示:

Image for post
Fig 7 Logistic Vs Linear Regression 图7 Logistic VS线性回归

XII. ROC Curve

十二。 ROC曲线

The Receiver Operating Characteristics or the ROC curve, is a graphical plot that illustrates the performance of a binary classifier system as its discrimination threshold is varied. The curve is created by plotting the true positive rate (TPR) against the false positive rate (FPR) at various threshold settings. The true-positive rate is also known as sensitivity or the sensitivity index d’, known as “d-prime” in signal detection and biomedical informatics, or recall in machine learning. The false-positive rate is also known as the fall-out and can be calculated as (1 — specificity). The ROC curve is thus the sensitivity as a function of fall-out. For more detailed information, see reference[11]

接收器工作特性或ROC曲线是一个图形图,它说明了二进制分类器系统的判别阈值变化时的性能。 通过绘制各种阈值设置下的真实阳性率(TPR)与阳性阳性率(FPR)来绘制曲线。 真实阳性率也称为灵敏度或灵敏度指标d',在信号检测和生物医学信息学中或在机器学习中称为“ d-素数”。 假阳性率也称为落差,可以计算为(1-特异性)。 因此,ROC曲线是灵敏度作为衰减的函数。 有关更多详细信息,请参见参考文献[11]。

Image for post
Fig 8 ROC curve 图8 ROC曲线

XIII. APPLICATIONS

十三。 应用领域

Regressions can be used in real world applications such as:

回归可用于现实应用中,例如:

1) Marketing: Logistic Regression can be used to predict if the subsidiary of the company will make profit, loss or just break even depending on the characteristic of the subsidiary operations.

1) 营销 :Logistic回归可用于根据子公司运营的特征来预测公司的子公司是盈利,亏损还是收支平衡。

2) Human Resources: The HR manager of a company can predict the absenteeism pattern of his employees based on their individual characteristic using Logistic Regression.

2) 人力资源 :公司的人力资源经理可以使用Logistic回归基于员工的个人特征来预测其员工的缺勤模式。

3) Finance: Bank uses Logistic Regression to predict if it’s customers would default based on the previous transactions and history.

3) 财务 :银行使用Logistic回归来基于先前的交易和历史来预测其客户是否会违约。

For more information, see reference[14]

有关更多信息,请参见参考文献[14]。

4) Science: Logistic Regression algorithm can be used to predict earthquakes. For more information, see reference[13]

4) 科学 :Logistic回归算法可用于预测地震。 有关更多信息,请参见参考文献[13]。

XIV. ADVANTAGES

十四。 优点

1) The logistic regression model not only acts as a classification model, but also gives you probabilities. This is a big advantage over other models where they can only provide the final classification. Knowing that an instance has a 99% probability for a class compared to 51% makes a big difference.

1)Logistic回归模型不仅充当分类模型,而且还提供概率。 与其他只能提供最终分类的模型相比,这是一个很大的优势。 知道一个实例有99%的可能性成为一个类,而不是51%的可能性就很大了。

2) Logistic Regression not only gives a measure of how relevant a predictor (coefficient size) is, but also its direction of association (positive or negative). We see that Logistic regression is easier to implement, interpret and very efficient to train.

2)Logistic回归不仅可以衡量预测变量(系数大小)的相关性,还可以衡量其关联方向(正向或负向)。 我们看到Logistic回归更容易实现,解释和培训非常有效。

3) Logistic Regression proves to be very efficient when the dataset has features that are linearly separable.

3)当数据集具有线性可分离的特征时,逻辑回归被证明是非常有效的。

4) In a low dimensional dataset having a enough training examples, logistic regression is less prone to over-fitting.

4)在具有足够训练示例的低维数据集中,逻辑回归不太容易过拟合。

For more detailed information, see reference[12]

有关更多详细信息,请参见参考文献[12]。

XV. DISADVANTAGES

XV。 缺点

1) Logistic regression can suffer from complete separation. If there is a feature that would perfectly separate the two classes, the logistic regression model can no longer be trained. This is because the weight for that feature would not converge. This is really a bit unfortunate, because such a feature is really very useful.

1)Logistic回归可能会完全分离。 如果有一个功能可以完美地将这两个类别分开,则将不再可以训练逻辑回归模型。 这是因为该功能的权重不会收敛。 这确实有点不幸,因为这样的功能确实非常有用。

2) Logistic regression is less prone to overfitting but it can overfit in high dimensional datasets.

2)Logistic回归不太容易过拟合,但在高维数据集中可能拟合。

3) It is difficult to capture complex relationships using logistic regression. More powerful and complex algorithms such as Neural Networks can easily outperform this algorithm.

3)它是很难捕捉到复杂的关系s,使用逻辑回归。 更强大,更复杂的算法(例如神经网络)可以轻松胜过该算法。

For more detailed information, see reference[12]

有关更多详细信息,请参见参考文献[12]。

XVI. CONCLUSION

十六。 结论

Logistic regression is a widely used supervised machine learning technique. It is one of the best tools used by statisticians, researchers and data scientists in predictive analytics. The assumptions for logistic regression are mostly similar to that of multiple regression except that the dependent variable should be discrete or non-linear .The Logistic regression provides a useful means for modelling the dependence of a binary response variable on one or more explanatory variables, where the latter can be either categorical or continuous. The fit of the resulting model can be assessed using several methods.

Logistic回归是一种广泛使用的监督机器学习技术。 它是统计学家,研究人员和数据科学家在预测分析中使用的最佳工具之一。 Logistic回归的假设除因变量应为离散或非线性外,其余大部分与多元回归的假设相似.Logistic回归提供了一种有用的方法,可用于对二进制响应变量对一个或多个解释变量的依赖性进行建模。后者可以是分类的,也可以是连续的。 可以使用几种方法来评估所得模型的拟合度。

REFERENCES

参考资料

[1]. S. Date, “The Binomial Regression Model: Everything You Need toKnow,” Medium, 10-Mar-2020. [Online]. Available: https://towardsdatascience.com/the-binomial-regression-model-everything-you-need-to-know-5216f1a483d3Full Article

[1]。 S. Date,“二项式回归模型:您需要知道的一切”,中,2020年3月10日。 [线上]。 可用:https://towardsdatascience.com/the-binomial-regression-model-everything-you-need-to-know-5216f1a483d3 完整文章

[2]. “Multinomial Logistic Regression: Definition and Examples-Statistics…”. [Online]. Available: https://www.statisticshowto.com/multinomial-logistic-regression/Full Article

[2]。 “多项式Lo​​gistic回归:定义和示例-统计...”。 [线上]。 可用:https://www.statisticshowto.com/multinomial-logistic-regression/ 全文

[3].“Ordinal Logistic Regression and its Assumptions — Full Analysis …”. [Online]. Available: https://medium.com/evangelinelee/ordinal-logistic-regression-on-world-happiness-report-221372709095.Full Article

[3]。“序数逻辑回归及其假设-全面分析……”。 [线上]。 可用:https://medium.com/evangelinelee/ordinal-logistic-regression-on-world-happiness-report-221372709095。 全文

[4] “Sigmoid Function — an overview | ScienceDirect Topics”. [Online]. Available: https://www.sciencedirect.com/topics/computer-science/sigmoid-function.Full Article

[4]“ Sigmoid函数-概述| ScienceDirect主题”。 [线上]。 可用:https://www.sciencedirect.com/topics/computer-science/sigmoid-function。 全文

[5] “Understanding Logistic Regression — GeeksforGeeks”. [Online].Available: https://www.geeksforgeeks.org/understanding-logistic-regression/ Full Article

[5]“了解逻辑回归-GeeksforGeeks”。 [在线]。可用: https ://www.geeksforgeeks.org/understanding-logistic-regression/ 全文

[6] “Logistic Regression for Machine Learning”. [Online]. Available: https://machinelearningmastery.com/logistic-

[6]“机器学习的逻辑回归”。 [线上]。 可用: https//machinelearningmastery.com/logistic-

regression-for-machine-learning/ Full Article

机器学习回归/ 全文

[7] “Logistic Regression and Decision Boundary — Towards Data Science”. [Online]. Available: https://towardsdatascience.com/logistic-regression-and-decision-boundary-eab6e00c1e8].Full Article

[7]“逻辑回归和决策边界-走向数据科学”。 [线上]。 可用:https://towardsdatascience.com/logistic-regression-and-decision-boundary-eab6e00c1e8]。 全文

[8] “The cost function in logistic regression — Internal Pointers”. [Online]. Available: https://www.internalpointers.com/post/cost-function-logistic-regression.Full Article

[8]“逻辑回归中的成本函数-内部指针”。 [线上]。 可用:https://www.internalpointers.com/post/cost-function-logistic-regression。 全文

[9] “Gradient Descent Training With Logistic Regression -Best Machine …”. [Online]. Available: https://bestofml.com/gradient-descent-training-with-logistic-regression/.Full Article

[9]“使用Logistic回归进行梯度下降训练-最佳机器……”。 [线上]。 可用:https://bestofml.com/gradient-descent-training-with-logistic-regression/。 全文

[10] “Difference between Linear Regression and Logistic Regression | Pico”. [Online]. Available: https://www.pico.net/kb/difference-between-linear-regression-and-logistic-regression..Full Article

[10]“线性回归和逻辑回归之间的差异| 微微”。 [线上]。 可用:https://www.pico.net/kb/difference-between-linear-regression-and-logistic-regression。 全文

[11] “How to Use ROC Curves and Precision-Recall Curves for …”. [Online]. Available: https://machinelearningmastery.com/roc-curves-and-precision-recall-curves-for-classification-in-python/.

[11]“如何将ROC曲线和精确召回曲线用于…”。 [线上]。 可用: https//machinelearningmastery.com/roc-curves-and-precision-recall-curves-for-classification-in-python/。

Full Article

全文

[12] “Advantages and Disadvantages of Logistic Regression”. [Online]. Available: https://iq.opengenus.org/advantages-and-disadvantages-of-logistic-regression/. Full Article

[12]“逻辑回归的优点和缺点”。 [线上]。 可用: https//iq.opengenus.org/advantages-and-disadvantages-of-logistic-regression/。 全文

[13] Abrahamson, N. A. & R. R. Youngs (1992). A stable algorithm for regression analysis using the random effects model. Bulletin of the Seismological Society of America 82(1), 505–510. Full Article

[13] Abrahamson,NA&RR Youngs(1992)。 使用随机效应模型进行回归分析的稳定算法。 美国地震学会简报82(1),505-510。 全文

[14]“Introduction to Logistic Regression | Analytics Insight”. [Online]. Available: https://www.analyticsinsight.net/introduction-to-logistic-regression/. Full Article

[14]“逻辑回归简介| Analytics Insight”。 [线上]。 可用: https//www.analyticsinsight.net/introduction-to-logistic-regression/。 全文

[15] Murphy, K. Machine Learning — A Probabilistic Perspective. The MIT Press, 2012.

[15] Murphy,K.机器学习-概率观点。 麻省理工学院出版社,2012年。

[16] ISLR: James, G., Witten, D., Hastie, T., and Tibshirani, R. An Introduction to Statistical Learning — with Applications in R, 7th edition. Springer, 2013.

[16] ISLR:James,G.,Witten,D.,Hastie,T.和Tibshirani,R。《统计学习概论》及其在R中的应用,第7版。 施普林格,2013年。

[17] DL-Book: Goodfellow, I., Bengio, Y., and Courville, A. Deep Learning. The MIT Press, 2016.

[17] DL书:Goodfellow,I.,Bengio,Y。和Courville,A。深度学习。 麻省理工学院出版社,2016年。

[18] ISBN: Max, K., Johnson, K. Applied Predictive Modeling. 2nd edition. 2018

[18] ISBN:Max,K.,Johnson,K.应用预测建模。 第二版。 2018年

[19] ISBN: Sebastian, R., Vahid M. Python Machine Learning — Second Edition: Machine Learning and Deep Learning with Python, scikit-learn, and TensorFlow. 2nd edition. September 20, 2017

[19] ISBN:Sebastian,R.,Vahid M. Python机器学习-第二版:使用Python,scikit-learn和TensorFlow进行机器学习和深度学习。 第二版。 2017年9月20日

[20] “A Gentle Introduction to Logistic Regression With Maximum …”. [Online]. Available: https://analyticsweek.com/content/a-gentle-introduction-to-logistic-regression-with-maximum-likelihood-estimation/.

[20]“对Logistic回归的最大介绍……”。 [线上]。 可用: https//analyticsweek.com/content/a-gentle-introduction-to-logistic-regression-with-maximum-likelihood-estimation/。

翻译自: https://medium.com/swlh/logistic-regression-7791655bc480

逻辑回归模型

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值