降維:特徵擷取

用 Python 練習機器學習面試題

Lisa Stuart

Data Scientist

非監督式學習方法

  • 主成分分析(PCA) --> 課程 3.1
  • 奇異值分解(SVD) --> 課程 3.1
  • 分群/群組 --> 課程 3.3
  • 探勘式資料分析
用 Python 練習機器學習面試題

降維 ≠ 特徵選取

PCA 圖

特徵選取

1 https://slideplayer.com/slide/9699240/ 2 https://www.analyticsvidhya.com/blog/2016/03/practical-guide-principal-component-analysis-python/
用 Python 練習機器學習面試題

維度詛咒

維度對效能關係圖

1 https://www.visiondummy.com/2014/04/curse-dimensionality-affect-classification/
用 Python 練習機器學習面試題

1 維搜尋

1 維搜尋空間

用 Python 練習機器學習面試題

2 維搜尋

2 維搜尋空間

用 Python 練習機器學習面試題

3 維搜尋

3 維搜尋空間

用 Python 練習機器學習面試題

降維方法

  • PCA
  • SVD
用 Python 練習機器學習面試題

PCA

Iris PCA 圖

  • PCA
    • X 與 y 的關係
    • 透過尋找主軸計算
    • 平移、旋轉與縮放
    • 將資料投影到較低維度
1 https://scikit-learn.org/stable/modules/decomposition.html
用 Python 練習機器學習面試題

SVD

Iris SVD 圖

  • SVD
    • 線性代數與向量微積分
    • 將資料矩陣分解為三個矩陣
    • 產生「奇異值」
    • 資料變異約等於奇異值的平方和(SS)
1 https://galaxydatatech.com/2018/07/15/singular-value-decomposition/
用 Python 練習機器學習面試題

降維函式

Function/method returns
sklearn.decomposition.PCA principal component analysis
sklearn.decomposition.TruncatedSVD singular value decomposition
PCA/SVD.fit_transform(X) fits and transforms data
PCA/SVD.explained_variance_ratio_ variance explained by PCs
用 Python 練習機器學習面試題

一起來練習吧!

用 Python 練習機器學習面試題

Preparing Video For Download...