逻辑回归是分类还是回归_分类和回归:它们是否相同?
邏輯回歸是分類還是回歸
You might have come across the terms Regression and Classification, and might as well think they mean one and the same thing. But this is not true.
您可能遇到過(guò)回歸和分類這兩個(gè)術(shù)語(yǔ),并且可能還以為它們含義相同。 但是這是錯(cuò)誤的。
Machine Learning is subdivided largely into supervised and unsupervised. Supervised Learning is further divided into Regression and Classification. Regression deals with predicting the value of a test case given,after learning from the training set taken, whose value is continuous and Classification means categorizing data into a binary test case, say Y/N case or True/False case, learning from the training set. Thus, in classification we play with probabilities and thus predict the outcome.
機(jī)器學(xué)習(xí)主要分為有監(jiān)督的和無(wú)監(jiān)督的。 監(jiān)督學(xué)習(xí)又分為回歸和分類。 回歸處理是在從所接受的訓(xùn)練集學(xué)習(xí)后預(yù)測(cè)給出的測(cè)試用例的價(jià)值 ,該訓(xùn)練用例的值是連續(xù)的;分類是將數(shù)據(jù)分類為二進(jìn)制測(cè)試用例(例如,Y / N用例或True / False用例),從訓(xùn)練中學(xué)習(xí)組。 因此,在分類中我們玩概率,從而預(yù)測(cè)結(jié)果。
For example predicting the height, weight or salary of people fall in the category of Regression. Many regression models can be used to predict these attributes. Classification on the other hand is all about whether or not an action will be performed. For example, Will the people buy a particular car or house given their salary and age, tossing of a fair coin given number of trials, will the investors invest in a specific share given their past interests; all can be classified as Yes or No problems and are examples of classification problems
例如,預(yù)測(cè)人的身高,體重或薪水屬于回歸。 許多回歸模型可用于預(yù)測(cè)這些屬性。 另一方面,分類是關(guān)于是否執(zhí)行動(dòng)作的全部。 例如,人們將根據(jù)他們的薪水和年齡來(lái)購(gòu)買(mǎi)特定的汽車或房屋,是否會(huì)因經(jīng)過(guò)多次試驗(yàn)而拋棄公平的硬幣,而投資者會(huì)根據(jù)他們過(guò)去的利益來(lái)投資特定的份額; 全部可以歸類為是或否問(wèn)題,并且是分類問(wèn)題的示例
In this article I will be touching upon Logistic Regression and how it is used to classify in a problem
在本文中,我將探討邏輯回歸及其如何用于對(duì)問(wèn)題進(jìn)行分類
邏輯回歸 (Logistic Regression)
You must be familiar with Linear Regression given by the following formula
您必須熟悉以下公式給出的線性回歸
y = b0 + b1*x
y = b0 + b1 * x
Let us consider that y- axis is given by whether a person buys a car or not and x-axis is his age. You will observe that if a person is below a threshold age, he/she never buys the car. Similarly if he is above a certain age he/she always buys the car. Hence, there is a need to remove the lines intersecting the x axis and y=1 line, making it horizontal in these regions. This is where Logistic regression steps in.
讓我們考慮y軸由一個(gè)人是否購(gòu)買(mǎi)汽車給出,x軸是他的年齡。 您將觀察到,如果一個(gè)人未滿閾值年齡,則他/她從不購(gòu)買(mǎi)汽車。 同樣,如果他超過(guò)一定年齡,他/她總是買(mǎi)車。 因此,需要去除與x軸和y = 1線相交的線,使其在這些區(qū)域中水平。 這就是Logistic回歸介入的地方。
Logistic Regression for a linear model is given by the formula:
線性模型的邏輯回歸由以下公式給出:
ln(P/1-P) = b0 + b1* x
ln(P / 1-P)= b0 + b1 * x
where P is the probability of the case considered.
其中P是考慮情況的概率。
Hence the curve now considers a probability of 1 above a point and probability of 0 below the threshold value. This leaves us with the mid-region denoted by a confusion matrix.
因此,曲線現(xiàn)在考慮在一個(gè)點(diǎn)之上的概率為1,在該閾值之下的概率為0。 這給我們留下了由混淆矩陣表示的中間區(qū)域。
You might have come across targeted advertising on social media which often leaves you wondering if social media has been stalking you everywhere or not! This targeted advertising is also done through various Machine Learning algorithms.
您可能在社交媒體上遇到了針對(duì)性的廣告,這常常使您想知道社交媒體是否一直在纏擾您! 這種針對(duì)性的廣告還可以通過(guò)各種機(jī)器學(xué)習(xí)算法來(lái)完成。
For example, a car company needs to find out whether or not the population will buy an expensive luxury car, given the population age and estimated salary. Let us take the case of linear logistic regression. This can be done by dividing the data collected into training and test set as follows:
例如,一家汽車公司需要根據(jù)人口年齡和估算工資,找出人們是否會(huì)購(gòu)買(mǎi)昂貴的豪華車。 讓我們以線性邏輯回歸為例。 可以通過(guò)如下方式將收集的數(shù)據(jù)分為訓(xùn)練集和測(cè)試集來(lái)完成:
In the training set the red dots represent that the population will not buy the car and green dots represent that the population will. The logistic regression algorithm will learn from the data and linearly divide the data into two categories, here they are red (will not buy) and green (will buy). Thus the algorithm decides the best fit and applies it to the test set.
在訓(xùn)練集中,紅點(diǎn)表示該人群不會(huì)購(gòu)買(mǎi)汽車,綠點(diǎn)表示該人群愿意購(gòu)買(mǎi)汽車。 邏輯回歸算法將從數(shù)據(jù)中學(xué)習(xí)并將數(shù)據(jù)線性分為兩類,這里它們是紅色(不會(huì)購(gòu)買(mǎi))和綠色(會(huì)購(gòu)買(mǎi))。 因此,該算法確定最佳擬合并將其應(yīng)用于測(cè)試集。
We can observe that the logistic regression classification model almost successfully predicts whether the population will buy the luxury car or not, given their age and estimated salary.
我們可以觀察到,根據(jù)年齡和估算工資,邏輯回歸分類模型幾乎可以成功預(yù)測(cè)人口是否會(huì)購(gòu)買(mǎi)豪華車。
The outcomes and shortcomings of this model can be addressed in other regression models. This is the basic intuition about Regression and Classification.
該模型的結(jié)果和缺點(diǎn)可以在其他回歸模型中解決。 這是關(guān)于回歸和分類的基本直覺(jué)。
Written By:
撰寫(xiě)人:
Jayesh Kumar
杰伊什·庫(kù)瑪(Jayesh Kumar)
3rd Year, ECE
歐洲經(jīng)委會(huì)三年級(jí)
MIT Manipal, India
印度麻省理工學(xué)院馬尼帕爾
Originally published at https://www.linkedin.com on February 27, 2019
最初于 2019年2月27日 發(fā)布在 https://www.linkedin.com
翻譯自: https://medium.com/swlh/classification-and-regression-are-they-the-same-3fd86714daa3
邏輯回歸是分類還是回歸
總結(jié)
以上是生活随笔為你收集整理的逻辑回归是分类还是回归_分类和回归:它们是否相同?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: ml回归_ML中的分类和回归是什么?
- 下一篇: mongdb 群集_通过对比群集分配进行