邏輯回歸,loss 函式定義為所有概率的積取負號取對數,但為什麼不直接定義為1 概率的積?

時間 2021-06-02 04:42:07

1樓:Frank Tian

你的問題是為什麼用log likelihood function而不是直接用likelihood function,因為log likelihood function的數學性質更好。

In practice, it is more convenient to maximize the log of the likelihood function. Because the logarithm is a monotonically increasing function of its argument, maximization of the log of a function is equivalent to maximization of the function itself. Taking the log not only simplifies the subsequent mathematical analysis, but it also helps numerically because the product of a large number of small probabilities can easily underflow the numerical precision of the computer, and this is resolved by computing instead the sum of the log probabilities.

來自PRML

定義域為空集的空函式該怎麼理解?

祥子 認為函式是滿足一定條件的集間關係是 的函式 這樣,當定義域 時,的唯一子集為空集,故若 為 的函式則 只可能為空集。假設 不是函式,則由 的逆否命題知存在 沒有或有不止乙個 使得 與不存在 矛盾。所以 為 上的唯一函式。來自J.J.Rotman,抽象代數基礎教程 LLjpcz 這個問題你看一下...

C語言中被調函式被定義為void以後還有沒有返回值返回給主調函式?

重樓 常規情況下,如果只讀取返回值的話沒有 但是可以用形參來傳遞返回值,或者全域性變數 非正規的方法就是用內聯彙編直接把指寫入eax在呼叫處讀取。 avoidant 很多初學者都以為return是動賓短語裡的那個動詞 返回值是賓語 但其實return是乙個主謂短語裡的謂語。主語是誰呢?是contro...

為什麼邏輯回歸對樣本分佈不均衡比較敏感,為什麼樹模型沒有線性模型那麼敏感?

張良懷 任何通過計算樣本的Loss然後反向傳播更新權值的演算法,都會對正負樣本的數量是否平衡很敏感。哪一類樣本多,權重調整時就更傾向於調整到使該類樣本錯分率更低。不管是邏輯回歸,還是深度學習。樹模型不屬於上一類,它是通過計算資訊熵來選擇特徵劃分樣本的,劃分後熵增最大。這個計算過程對於樣本的數量的多少...