天天看點

Stanford機器學習---第一周.監督學習與梯度下降

   假期繼續撿起Coursera上Andrew Ng的《Machine Learning》課程,去年同一時間學過一點點,這假期争取結課。

   視訊講的内容還是蠻多的,寫在講義上的知識點太零散,每周的課程做一個梳理和總結,感興趣的可以參考下滴~

第一周

第一講 引言(Introduction) 

1.機器學習是目前資訊技術中最激動人心的方向之一;

   機器學習是人工智能AI(Artificial Intelligence)的核心;

   應用舉例:資料挖掘Database Mining、手寫識别handwriting recognition、計算機視覺Computer Vision等。

2.定義:Field of study that gives computers the ability to learn without being explicitly programmed.

i.e.A computer program is said to learn from experience E with respect to some task T and some performance measure P,if its performance on T ,as measured by P,improves with experience E.

舉個例子了解下TPE:

①跳棋人機對弈:Task-------跳棋任務.

Performance measure------和新對手玩跳棋時赢得機率.

Experience-------你和計算機玩10次-1000次的跳棋遊戲.

②郵件垃圾分類:Task-------Classifying emails as spam or not spam.

Perform measure--------The number of emails correctly classified as spam/not spam.(成功的頻數or機率)

Experience-------Watching you label emails as spam or not spam.

★★★3.機器學習算法可以分為監督學習和非監督學習兩大類。

監督學習Supervised learning:給定算法一個資料集,并且給定正确的答案;

非監督學習Unsupervised learning:隻給定資料集,沒有給定正确答案;

監督學習有2大類:回歸問題和分類問題。

①回歸問題Regression:預測一個連續值的屬性(拟合)

②分類問題Classification:預測一個離散的輸出值(0-1)

非監督學習:聚類分析clustering

第二講 一進制線性回歸問題(Linear regression with one variable)

1.代價函數(平方誤差函數)J

Stanford機器學習---第一周.監督學習與梯度下降
Stanford機器學習---第一周.監督學習與梯度下降

例如:一進制線性拟合(回歸)

假設/拟合函數Hypothesis:

Stanford機器學習---第一周.監督學習與梯度下降
Stanford機器學習---第一周.監督學習與梯度下降

參數Parameter:

Stanford機器學習---第一周.監督學習與梯度下降
Stanford機器學習---第一周.監督學習與梯度下降

代價函數Cost Function:

Stanford機器學習---第一周.監督學習與梯度下降
Stanford機器學習---第一周.監督學習與梯度下降

目标Goal:

Stanford機器學習---第一周.監督學習與梯度下降

★★★2.梯度下降算法Gradient descent algorithm

原理:初始化一個值,沿偏導數方向下降直至代價函數收斂(或找到局部最優解)

算法:

       repeat until convergence{

Stanford機器學習---第一周.監督學習與梯度下降
Stanford機器學習---第一周.監督學習與梯度下降

      }

      其中,J為代價函數,以一進制線性代價函數為例;

      α為學習速率learning rate,可以了解為下降的步伐大小;

盜圖兩張,友善了解:

Stanford機器學習---第一周.監督學習與梯度下降
Stanford機器學習---第一周.監督學習與梯度下降
Stanford機器學習---第一周.監督學習與梯度下降
Stanford機器學習---第一周.監督學習與梯度下降

3.正交方程

   如果資料集較小,也可以采用這種方法,後面再介紹~

第三講 線性代數回顧Linear algebra review

較基礎,大一的課程,跳過~

第一周的課程就到這裡了╰( ̄▽ ̄)╮筆者繼續學習第二周的課程了,有興趣的一起來呗~

繼續閱讀