天天看點

TensorFlow訓練Logistic回歸

在用線性模型進行回歸訓練時,有時需要根據這個線性模型進行分類,則要找到一個單調可微的用于分類的函數将線性回歸模型的預測值關聯起來。這時就要用到邏輯回歸,之前看吳軍博士的《數學之美》中說騰訊和谷歌廣告都有使用logistics回歸算法。

如下圖,可以清晰看到線性回歸和邏輯回歸的關系,一個線性方程被邏輯方程歸一化後就成了邏輯回歸。

TensorFlow訓練Logistic回歸
TensorFlow訓練Logistic回歸

如圖,

TensorFlow訓練Logistic回歸

但階躍函數不連續,于是用sigmoid函數替代之,為 

TensorFlow訓練Logistic回歸
TensorFlow訓練Logistic回歸
TensorFlow訓練Logistic回歸
TensorFlow訓練Logistic回歸

========廣告時間========

<a href="http://blog.csdn.net/wangyangzhizhou/article/details/74080321">為什麼寫《Tomcat核心設計剖析》</a>

=========================

歡迎關注:

TensorFlow訓練Logistic回歸

繼續閱讀