第一章.Classification -- 04.Logistic Regression翻譯

I want to talk about a very basic method, in particular, it’s a very old algorithm.

It dates back at least 50 years, but it really works.

You won’t be disappointed in this algorithm. It’s simple,

it’s fast and it often competes with the best machine learning methods,

and it’s called logistic regression.

Now, logistic regression uses this loss function over here that we talked about.

You saw this before. It’s the dark blue curve over here.

Now I want you to remember this function as best you can for a little while and so I’m going to put it in the corner over there.

So logistic regression minimizes this; and there’s no regularization for vanilla logistic regression.

It just minimizes this function, which is just the average loss on the training points.

Now, we have to choose what kind of model f is going to be, and we’ll choose a linear model.

So it’s a weighted sum of the features.

For instance, if we’re trying to predict income,

our model might look like three times the hours a person works,

plus four times the years of experience and so on.

So here,

the first feature x1 is hours and beta one is 3 and so on. I can write it here in summation notation.

So f is the sum of the weighted features,

where the weights are called beta. And I also call the beta “coefficients”.

So here, all I did was plug this form of f into that minimization problem for logistic regression.

So now, it’s going to try to find the weights that minimize the sum of the training losses.

And this is what logistic regression does; no more, no less.

It just chooses the coefficients (those betas) to minimize this thing.

我想講一個非常基本的方法,特別是,它是一個非常古老的算法。

它可以追溯到至少50年前,但它確實有效。

你不會對這個算法感到失望。這很簡單,

它是快速的,它經常與最好的機器學習方法競爭,

這叫做邏輯迴歸。

現在,邏輯迴歸使用這個損失函數我們討論過。

你之前看到這個。這是深藍色的曲線。

現在我想讓你們記住這個函數你們可以用一會,我把它放在那邊的角落裏。

所以logistic迴歸最小化了這個;而且沒有常規的邏輯迴歸。

它將這個函數最小化,這只是訓練點的平均損失。

現在,我們要選擇f是什麼樣的模型,我們會選擇一個線性模型。

所以它是特徵的加權和。

例如,如果我們試圖預測收入,

我們的模型可能是一個人工作時間的三倍,

加上四年的經驗等等。

這裏,

x1的第一個特徵是小時,而第一個是3,以此類推。我可以把它寫成求和符號。

所以f是加權特徵的和,

權重被稱爲。我也叫它係數。

在這裏,我所做的就是將f的形式代入到logistic迴歸的最小化問題中。

所以現在,它會試圖找到最小化訓練損失總和的權重。

這就是邏輯迴歸的作用;不能多也不能少。

它只會選擇係數(那些betas)來最小化這個東西。

發佈了30 篇原創文章 · 獲贊 50 · 訪問量 13萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章