林軒田_機器學習入門必學 Machine Learning Foundations
機器學習旨在讓電腦能由資料中累積的經驗來自我進步。課程將介紹各領域中的機器學習使用者都應該知道的基礎演算法、理論及實務工具。
內容簡介
作者介紹
適合人群
你將會學到什麼
購買須知
-
第一課:The Learning Problem
what machine learning is and its connection to applications and other fields
-
Course Introduction
什麼是「學習」?學習就是人類通過觀察、積累經驗,掌握某項技能或能力。就好像人類從小學習識別字母、認識漢字,就是學習的過程。而機器學習(Machine Learning),顧名思義,就是讓機器(計算機)也能向人類一樣,通過觀察大量的數據和訓練,發現事物規律,獲得某種分析問題、解決問題的能力。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/01_handout.pdf
-
What Is Machine Learning
什麼情況下會使用機器學習來解決問題呢?其實,目前機器學習的應用非常廣泛,基本上任何場合都能夠看到它的身影。 其應用場合大致可歸納為三個條件: 1.事物本身存在某種潛在規律 2.某些問題難以使用普通編程解決 3.有大量的數據樣本可供使用 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/01_handout.pdf
-
Applications of Machine Learning
機器學習在衣、食、住、行、教育、娛樂等各個方面都有著廣泛的應用,生活處處都離不開機器學習。比如,用戶打開購物網站,網站就會自動推薦用戶可能會喜歡的商品;電影頻道會根據用戶的瀏覽記錄和觀影記錄,向不同用戶推薦他們可能喜歡的電影等等,到處都有機器學習的影子。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/01_handout.pdf
-
Components of Machine Learning
本系列的課程對機器學習問題有一些基本的術語需要注意一下: 1.輸入 x 2.輸出 y 3.目標函數 f,即最接近實際樣本分佈的規律 4.訓練樣本 data 5.假設 hypothesis,一個機器學習模型對應了很多不同的 hypothesis,通過演算法 A,選擇一個最佳的 hypothesis 對應的函數稱為矩 g,g 能最好地表示事物的內在規律,也是最終想要得到的模型表達式。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/01_handout.pdf
-
Machine Learning and Other Fields
本節課主要介紹了什麼是機器學習,什麼樣的場合下可以使用機器學習解決問題,然後用流程圖的形式展示了機器學習的整個過程,最後把機器學習和數據挖掘、人工智能、統計這三個領域做個比較。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/01_handout.pdf
-
-
第二課Learning to Answer Yes/No
your first learning algorithm (and the world's first!) that "draws the line" between yes and no by adaptively searching for a good line based on data
-
Perceptron Hypothesis Set
在機器學習的整個流程中,有一個部分非常重要:就是模型選擇,即 Hypothesis Set。選擇什麼樣的模型,很大程度上會影響機器學習的效果和表現。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/02_handout.pdf
-
Perceptron Learning Algorithm(PLA)
根據上一部分的介紹,已經知道了 hypothesis set 由許多條直線構成。接下來,的目的就是如何設計一個演算法 A,來選擇一個最好的直線,能將平面上所有的正類和負類完全分開,也就是找到最好的 g,使 g≈ f。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/02_handout.pdf
-
Guarantee of PLA
PLA 什麼時候會停下來呢?根據 PLA 的定義,當找到一條直線,能將所有平面上的點都分類正確,那麼 PLA 就停止了。要達到這個終止條件,就必須保證 D是線性可分(linear separable)。如果是非線性可分的,那麼,PLA 就不會停止。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/02_handout.pdf
-
Non-Separable Data
本節課主要介紹了線性感知機模型,以及解決這類感知機分類問題的簡單算法:PLA。詳細證明了對於線性可分問題,PLA 可以停下來並實現完全正確分類。對於不是線性可分的問題,可以使用 PLA 的修正算法 Pocket Algorithm 來解決。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/02_handout.pdf
-
-
第三課:Types of Learning
earning comes with many possibilities in different applications, with our focus being binary classification or regression from a batch of supervised data with concrete features
-
Learning with Different Output Space
二元分類的問題很常見,包括信用卡發放、垃圾郵件判別、患者疾病診斷、答案正確性估計等等。二元分類是機器學習領域非常核心和基本的問題。二元分類有線性模型也有非線性模型,根據實際問題情況,選擇不同的模型。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/03_handout.pdf
-
Learning with Different Data Label
如果拿到的訓練樣本 D 既有輸入特徵 x,也有輸出 yn,那麼把這種類型的學習稱為監督式學習(Supervised Learning)。監督式學習可以是二元分類、多元分類或者是回歸,最重要的是知道輸出標籤 yn。與監督式學習相對立的另一種類型是非監督式學習(Unsupervised learning)。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/03_handout.pdf
-
Learning with Different Protocol
按照不同的條件,機器學習可以分為batch, online, active。這三種學習類型分別可以類比為:填鴨式,老師教學以及主動問問題。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/03_handout.pdf
-
Learning with Different Input Space
本節課主要介紹了機器學習的類型,包括 Out Space、Data Label、Protocol、Input Space 四種類型。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/03_handout.pdf
-
-
第四課:Feasibility of Learning
learning can be "probably approximately correct" when given enough statistical data and finite number of hypotheses
-
Learning is Impossible?
首先,考慮這樣一個例子,有 3 個 label 為 -1 的九宮格和3個 label 為 +1 的九宮格。根據這 6 個樣本,提取相應 label 下的特徵,預測右邊九宮格是屬於 -1還是 +1?結果是,如果依據對稱性,會把它歸為 +1;如果依據九宮格左上角是否是黑色,會把它歸為 -1。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/04_handout.pdf
-
Probability to the Rescue
從上一節得出的結論是:在訓練集 D 以外的樣本上,機器學習的模型是很難,似乎做不到正確預測或分類的。那是否有一些工具或者方法能夠對未知的目標函數 f 做一些推論,讓機器學習模型能夠變得有用呢? 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/04_handout.pdf
-
Connection to Learning
下面,將罐子的內容對應到機器學習的概念上來。機器學習中 hypothesis 與目標函數相等的可能性,類比於罐子中橙色球的概率問題;罐子裡的一顆顆彈珠類比於機器學習樣本空間的 x;橙色的彈珠類比於 h(x) 與 f 不相等;綠色的彈珠類比於 h(x) 與 f 相等;從罐子中抽取的 N 個球類比於機器學習的訓練樣本D,且這兩種抽樣的樣本與總體樣本之間都是獨立同分佈的。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/04_handout.pdf
-
Connection to Real Learning
本節課主要介紹了機器學習的可行性。首先引入 NFL 定理,說明機器學習無法找到一個矩 g 能夠完全和目標函數 f 一樣。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/04_handout.pdf
-
-
第五課:Training versus Testing
what we pay in choosing hypotheses during training: the growth function for representing effective number of choices
-
Recap and Preview
本節課將討論機器學習的核心問題,嚴格證明為什麼機器可以學習。從上節課最後的問題出發,即當 hypothesis 的個數是無限多的時候,機器學習的可行性是否仍然成立? 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/05_handout.pdf
-
Effective Number of Lines
union bound 被估計過高了(over-estimating)。所以,目的是找出不同 BAD events 之間的重疊部分,也就是將無數個 hypothesis 分成有限個類別。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/05_handout.pdf
-
Effective Number of Hypotheses
接下來先介紹一個新名詞:二分類(dichotomy)。 dichotomy 就是將空間中的點(例如二維平面)用一條直線分成正類(藍色o)和負類(紅色x)。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/05_handout.pdf
-
Break Point
本節課,更深入地探討了機器學習的可行性。把機器學習拆分為兩個核心問題:Ein(g)≈Eout(g)和Ein(g)≈0。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/05_handout.pdf
-
-
第六課:Theory of Generalization
test error can approximate training error if there is enough data and growth function does not grow too fast
-
Restriction of Break Point
通過引入了成長函數 mH(N) 和 dichotomy 以及 break point 的概念,提出 2D perceptrons 的成長函數 mH(N) 是多項式級別的猜想。這就是本節課將要深入探討和證明的內容。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/06_handout.pdf
-
Bounding Function : Basic Cases
求解 B(N,k) 的過程十分巧妙: 當 k=1 時,B(N,1) 恆為 1。 當 N < k 時,根據 break point 的定義,很容易得到 B(N,k)=2^N。 當 N = k 時,此時 N 是第一次出現不能被 shatter 的值,所以最多只能有 2^N-1 個 dichotomies,則 B(N,k)=2^N-1。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/06_handout.pdf
-
Bounding Function : Inductive Cases
如果能找到一個模型的 break point,且是有限大的,那麼就能推斷出其成長函數 mH(N) 有界。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/06_handout.pdf
-
A Pictorial Proof
本節課主要介紹了只要存在 break point,那麼其成長函數 mH(N) 就滿足 poly(N)。推導過程是先引入 mH(N) 的上界 B(N,k),B(N,k) 的上界是 N 的 k-1階多項式,從而得到 mH(N) 的上界就是 N 的 k-1 階多項式。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/06_handout.pdf
-
-
第七課:The VC Dimension
learning happens if there is finite model complexity (called VC dimension), enough data, and low training error
-
Definition of VC Dimension
首先,如果一個假設空間 H 有 break point k,那麼它的成長函數是有界的,它的上界稱為 Bound function。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/07_handout.pdf
-
VC Dimension of Perceptrons
回顧一下之前介紹的 2D 下的 PLA 算法,已知 Perceptrons 的 k=4,即 dvc=3。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/07_handout.pdf
-
Physical Intuition of VC Dimension
VC Dimension 代表了假設空間的分類能力,即反映了 H 的自由度,產生 dichotomy 的數量,也就等於 features 的個數,但也不是絕對的。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/07_handout.pdf
-
Interpreting VC Dimension
本節課主要介紹了 VC Dimension 的概念就是最大的 non-break point。然後,得到了 Perceptrons 在 d 維度下的 VC Dimension是 d+1。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/07_handout.pdf
-
-
第八課:Noise and Error
learning can still happen within a noisy environment and different error measures
-
Noise and Probabilistic Target
上節課推導 VC Dimension 的數據集是在沒有 Noise 的情況下,本節課討論如果數據集本身存在 Noise,那 VC Dimension 的推導是否還成立呢? 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/08_handout.pdf
-
Error Measure
機器學習需要考慮的問題是找出的矩 g 與目標函數f有多相近,使用 Eout 進行誤差的估計,那一般的錯誤測量有哪些形式呢? 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/08_handout.pdf
-
Algorithmic Error Measure
Error 有兩種:false accept 和 false reject。 false accept 意思是誤把負類當成正類,false reject 是誤把正類當成負類。根據不同的機器學習問題,false accept 和 false reject 應該有不同的權重,這根實際情況是符合的,比如是超市優惠,那麼 false reject 應該設的大一些;如果是安保系統,那麼 false accept 應該設的大一些。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/08_handout.pdf
-
Weighted Classification
本節課主要講了在有 Noise 的情況下,即數據集按照 P(y|x) 概率分佈,那麼 VC Dimension 仍然成立,機器學習算法推導仍然有效。機器學習 cost function 常用的 Error 有 0/1 error 和 squared error 兩類。實際問題中,對 false accept 和 false reject 應該選擇不同的權重。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/08_handout.pdf
-
-
第九課:Linear Regression
weight vector for linear hypotheses and squared error instantly calculated by analytic solution
-
Linear Regression Problem
在之前的 Linear Classification 課程中,講了信用卡發放的例子,利用機器學習來決定是否給用戶發放信用卡。本節課仍然引入信用卡的例子,來解決給用戶發放信用卡額度的問題,這就是一個線性回歸(Linear Regression)問題。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/09_handout.pdf
-
Linear Regression Algorithm
樣本數據誤差 Ein 是權重 w 的函數,因為 X 和 y 都是已知的。目標就是找出合適的 w,使 Ein 能夠最小。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/09_handout.pdf
-
Generalization Issue
現在,可能有這樣一個疑問,就是這種求解權重向量的方法是機器學習嗎?或者說這種方法滿足之前推導 VC Bound,即是否泛化能力強 Ein≈Eout? 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/09_handout.pdf
-
Linear Regression for Binary Classification
本節課,主要介紹了 Linear Regression。證明 linear regressin 這種方法可以用在 binary classification 上,雖然上界變寬鬆了,但是仍然能得到不錯的學習方法。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/09_handout.pdf
-
-
第十課:Logistic Regression
gradient descent on cross-entropy error to get good logistic hypothesis
-
Logistic Regression Problem
對於軟性二分類問題,理想的數據是分佈在 [0,1] 之間的具體值,但是實際中的數據只可能是 0 或者 1,可以把實際中的數據看成是理想數據加上了噪聲的影響。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/10_handout.pdf
-
Logistic Regression Error
現在將 Logistic Regression 與之前講的 Linear Classification、Linear Regression 做個比較: 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/10_handout.pdf
-
Gradient of Logistic Regression Error
已經推導了 Ein 的表達式,那接下來的問題就是如何找到合適的向量 w,讓 Ein 最小。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/10_handout.pdf
-
Gradient Descent
本節課介紹了 Logistic Regression 問題,建立 cross-entropy error,並提出使用梯度下降算法 gradient descnt 來獲得最好的 logistic hypothesis。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/10_handout.pdf
-
-
第十一課:Linear Models for Classification
binary classification via (logistic) regression; multiclass classification via OVA/OVO decomposition
-
Linear Models for Binary Classification
分析 PLA、linear regression、logistic regression 模型用來解 linear classification 問題的優點和缺點。通常,使用 linear regression 來獲得初始化的 w0 ,再用 logistic regression 模型進行最優化解。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/11_handout.pdf
-
Stochastic Grad. Descent
之前介紹的 PLA 算法和 logistic regression 算法,都是用到了疊代操作。PLA 每次迭代只會更新一個點,它每次迭代的時間複雜度是 O(1);而 logistic regression 每次迭代要對所有 N 個點都進行計算,它的每時間複雜度是 O(N)。為了提高 logistic regression 中 gradient descent 算法的速度,可以使用另一種算法:隨機梯度下降算法(Stochastic Gradient Descent)。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/11_handout.pdf
-
Multiclass via Logistic
本節主要介紹多分類問題,通過 linear classification 來解決。假設平面上有四個類,分別是正方形、菱形、三角形和星形,如何進行分類模型的訓練呢? 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/11_handout.pdf
-
Multiclass via Binary
本節課主要介紹了分類問題的三種線性模型:linear classification、linear regression 和 logistic regression。首先介紹了這三種 linear models 都可以來做binary classification。然後介紹了比梯度下降算法更加高效的 SGD 算法來進行 logistic regression 分析。最後講解了兩種多分類方法,一種是 OVA,另一種是 OVO。這兩種方法各有優缺點,當類別數量 k 不多的時候,建議選擇 OVA,以減少分類次數。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/11_handout.pdf
-
-
第十二課:Nonlinear Transformation
nonlinear model via nonlinear feature transform+linear model with price of model complexity
-
Quadratic Hypotheses
之前介紹的線性模型,在 2D 平面上是一條直線,在 3D 空間中是一個平面。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/12_handout.pdf
-
Nonlinear Transform
上一部分課程定義了什麼了二次 hypothesis,那麼這部分將介紹如何設計一個好的二次 hypothesis 來達到良好的分類效果。那麼目標就是在 z 域中設計一個最佳的分類線。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/12_handout.pdf
-
Price of Nonlinear Transform
那麼如何選擇合適的 Q,來保證不會出現過擬合問題,使模型的泛化能力強呢?一般情況下,為了盡量減少特徵自由度,會根據訓練樣本的分佈情況,人為地減少、省略一些項。但是,這種人為地刪減特徵會帶來一些「自我分析」代價,雖然對訓練樣本分類效果好,但是對訓練樣本外的樣本,不一定效果好。所以,一般情況下,還是要保存所有的多項式特徵,避免對訓練樣本的人為選擇。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/12_handout.pdf
-
Structured Hypothesis Sets
上節課主要介紹了非線性分類模型,通過非線性變換,將非線性模型映射到另一個空間,轉換為線性模型,再來進行線性分類。本節課完整介紹了非線性變換的整體流程,以及非線性變換可能會帶來的一些問題:時間複雜度和空間複雜度的增加。最後介紹了在要付出代價的情況下,使用非線性變換的最安全的做法,盡可能使用簡單的模型,而不是模型越複雜越好。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/12_handout.pdf
-
-
第十三課:Hazard of Overfitting
overfitting happens with excessive power, stochastic/deterministic noise and limited data
-
What is Overfitting?
舉個開車的例子,把發生車禍比作成 overfitting,那麼造成車禍的原因包括: 車速太快(VC Dimension太大) 道路崎嶇(noise) 對路況的了解程度(訓練樣本數量N不夠) 也就是說,VC Dimension、noise、N 這三個因素是影響過擬合現象的關鍵。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/13_handout.pdf
-
The Role of Noise and Data Size
為了盡可能詳細地解釋 overfitting,進行一個實驗,試驗中的數據集不是很大。首先,在二維平面上,一個模型的分佈由目標函數 f(x)(x的10階多項式)加上一些 noise 構成,離散的圓圈是數據集,目標函數是藍色的曲線。數據沒有完全落在曲線上,是因為加入了 noise。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/13_handout.pdf
-
Deterministic Noise
下面介紹一個更細節的實驗來說明 什麼時候小心 overfit 會發生。假設產生的數據分佈由兩部分組成:第一部分是目標函數 f(x),Qf 階多項式;第二部分是噪聲 ϵ,服從 Gaussian 分佈。接下來分析的是 noise 強度不同對 overfitting 有什麼樣的影響。總共的數據量是 N。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/13_handout.pdf
-
Dealing with Overfitting
本節課主要介紹了過擬合的概念,即當 Ein 很小,Eout 很大的時候,會出現 overfitting。詳細介紹了 overfitting 發生的四個常見原因 data size N、stochastic noise、deterministic noise 和 excessive power。解決 overfitting 的方法有很多,本節課主要介紹了 data cleaning/pruning 和 data hinting 兩種簡單的方法,之後的課程將會詳細介紹 regularization 和 validataion 兩種更重要的方法。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/13_handout.pdf
-
-
第十四課:Regularization
minimize augmented error, where the added regularizer effectively limits model complexity
-
Regularized Hypothesis Set
將介紹解決 overfitting 的另一種非常重要的方法:Regularization 規則化。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/14_handout.pdf
-
Weight Decay Regularization
現在,針對 H(c),即加上限定條件,問題變成:目的是計算 Ein(w) 的最小值,限定條件是 ∣∣w^2∣∣≤C 。這個限定條件從幾何角度上的意思是,權重 w 被限定在半徑為sqrt C的圓內,而球外的 w 都不符合要求,即便它是靠近 Ein(w) 梯度為零的 w。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/14_handout.pdf
-
Regularization and VC Theory
研究一下 Regularization 與 VC 理論之間的關係。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/14_handout.pdf
-
General Regularizers
本節課主要介紹了 Regularization。首先,原來的 hypothesis set 加上一些限制條件,就成了 Regularized Hypothesis Set。加上限制條件之後,就可以把問題轉化為 Eaug 最小化問題,即把 w 的平方加進去。這種過程,實際上回降低 VC Dimension。最後,介紹 regularization 是通用的機器學習工具,設計方法通常包括 target-dependent,plausible,friendly 等等。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/14_handout.pdf
-
-
第十五課:Validation
(crossly) reserve validation data to simulate testing procedure for model selection
-
Model Selection Problem
目標就是找到最合適的選擇搭配,得到一個好的矩 g,構建最佳的機器學習模型。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/15_handout.pdf
-
Validation
從訓練集 D 中抽出一部分 K 個數據作為驗證集 Dval,Dval 對應的 error 記為 Eval 。這樣做的一個前提是保證 Dval 獨立同分佈(iid)於 P(x,y),也就是說Dval 的選擇是從 D 中平均隨機抽樣得到的,這樣能夠把 Eval 與 Eout 聯繫起來。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/15_handout.pdf
-
Leave-One-Out Cross Validation
假如考慮一個極端的例子,k=1,也就是說驗證集大小為 1,即每次只用一組數據對 gm 進行驗證。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/15_handout.pdf
-
V-Fold Cross Validation
本節課主要介紹了 Validation 驗證。先從如何選擇一個好的模型開始切入,例如使用 Ein 、Etest 都是不太好的,最終使用 Eval 來進行模型選擇。然後詳細介紹了 Validation 的過程。最後,介紹了 Leave-One-Out 和 V-Fold Cross 兩種驗證方法,比較它們各自的優點和缺點,實際情況下,V-Fold Cross 更加常用。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/15_handout.pdf
-
-
第十六課:Three Learning Principles
be aware of model complexity, data goodness and your professionalism
-
Occam's Razor
Occam’s Razor 反映到機器學習領域中,指的是在所有可能選擇的模型中,應該選擇能夠很好地解釋已知數據並且十分簡單的模型。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/16_handout.pdf
-
Sampling Bias
首先引入一個有趣的例子:1948 年美國總統大選的兩位熱門候選人是 Truman 和 Dewey 。一家報紙通過電話採訪,統計人們把選票投給了 Truman 還是Dewey。經過大量的電話統計顯示,投給 Dewey 的票數要比投個 Truman 的票數多,所以這家報紙就在選舉結果還沒公佈之前,信心滿滿地發表 Dewey Defeats Truman 的報紙頭版,認為 Dewey 肯定贏了。但是大選結果公佈後,讓這家報紙大跌眼鏡,最終 Truman 贏的了大選的勝利。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/16_handout.pdf
-
Data Snooping
之前的課程,介紹過在模型選擇時應該盡量避免偷窺數據,因為這樣會使人為地傾向於某種模型,而不是根據數據進行隨機選擇。所以,Φ 應該自由選取,最好不要偷窺到原始數據,這會影響判斷。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/16_handout.pdf
-
Power of Three
本節課主要介紹了機器學習三個重要的錦囊妙計:Occam’s Razor, Sampling Bias, Data Snooping。並對《機器學習基石》課程中介紹的所有知識和方法進行「三的威力」這種形式的概括與總結,「三的威力」也就構成了堅固的機器學習基石。 影片內容 pdf:https://www.csie.ntu.edu.tw/~htlin/course/mlfound18fall/doc/16_handout.pdf
-