次元削減:特徴抽出

Pythonで学ぶMachine Learning面接対策

Lisa Stuart

Data Scientist

教師なし学習の手法

  • 主成分分析 (PCA) --> レッスン 3.1
  • 特異値分解 (SVD) --> レッスン 3.1
  • クラスタリング/グルーピング --> レッスン 3.3
  • 探索的データマイニング
Pythonで学ぶMachine Learning面接対策

次元削減 ≠ 特徴選択

PCA プロット

特徴選択

1 https://slideplayer.com/slide/9699240/ 2 https://www.analyticsvidhya.com/blog/2016/03/practical-guide-principal-component-analysis-python/
Pythonで学ぶMachine Learning面接対策

次元の呪い

次元数と性能の関係プロット

1 https://www.visiondummy.com/2014/04/curse-dimensionality-affect-classification/
Pythonで学ぶMachine Learning面接対策

1 次元探索

1 次元の探索空間

Pythonで学ぶMachine Learning面接対策

2 次元探索

2 次元の探索空間

Pythonで学ぶMachine Learning面接対策

3 次元探索

3 次元の探索空間

Pythonで学ぶMachine Learning面接対策

次元削減の手法

  • PCA
  • SVD
Pythonで学ぶMachine Learning面接対策

PCA

Iris の PCA プロット

  • PCA
    • X と y の関係
    • 主軸を求めて計算
    • 平行移動・回転・スケーリングを行う
    • データの低次元射影
1 https://scikit-learn.org/stable/modules/decomposition.html
Pythonで学ぶMachine Learning面接対策

SVD

Iris の SVD プロット

  • SVD
    • 線形代数とベクトル解析
    • データ行列を 3 行列に分解
    • 「特異値」を得る
    • データ分散 ≒ 特異値の二乗和
1 https://galaxydatatech.com/2018/07/15/singular-value-decomposition/
Pythonで学ぶMachine Learning面接対策

次元削減の関数

関数/メソッド 戻り値
sklearn.decomposition.PCA 主成分分析
sklearn.decomposition.TruncatedSVD 特異値分解
PCA/SVD.fit_transform(X) 学習して変換
PCA/SVD.explained_variance_ratio_ 各主成分の寄与率
Pythonで学ぶMachine Learning面接対策

Let's practice!

Pythonで学ぶMachine Learning面接対策

Preparing Video For Download...