■ はじめに
https://dk521123.hatenablog.com/entry/2020/03/18/223033
https://dk521123.hatenablog.com/entry/2020/03/19/231652
の続き。 今回は、Amazon SageMaker の 組み込みアルゴリズム (ビルトインアルゴリズム)について学ぶ。 (機械学習についても勉強できるし)
組み込みアルゴリズム一覧
以下の公式サイトに記載されているので、そっちを参照。
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/algos.html
【1】 教師あり学習アルゴリズム
1-1)XGBoost (extreme gradient boosting)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/xgboost.html
* 勾配ブースティング決定木 (Gradient Boosting Decision Tree) を 実装したオープンソースライブラリ
用途
* 分類問題、回帰分析、ランク付け
データ読込形式
* CSV または LibSVM 形式をサポート
!!重要!! 使用上の注意
1)最初の列に予測変数を設定する 2)ヘッダー行は使わない
参考文献
https://kefism.hatenablog.com/entry/2017/06/11/182959
https://blog.amedama.jp/entry/2019/01/29/235642
1-2)K 最近傍 (ケイさいきんぼう、k-NN; K-Nearest Neighbors)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/k-nearest-neighbors.html
用途
* 分類問題、回帰分析
1-3)DeepAR 予測
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/deepar.html
再帰型ニューラルネットワーク (RNN; Recurrent Neural Networks) を使った時系列予測
用途
時系列データに対する予測
参考文献
https://blog.brains-tech.co.jp/entry/2018/01/15/015833
https://dev.classmethod.jp/articles/getting-started-amazon-sagemaker-built-in-algorithms-deepar/
https://aws.amazon.com/jp/blogs/news/now-available-in-amazon-sagemaker-deepar-algorithm-for-more-accurate-time-series-forecasting/
1-4)因数分解機 (FM; Factorization Machines)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/fact-machines.html
用途
レコメンド
参考文献
https://aws.amazon.com/jp/blogs/news/build-a-movie-recommender-with-factorization-machines-on-amazon-sagemaker/
https://www.youtube.com/watch?v=MGu6YxnH6ps
k 近傍法 (k-NN) との合わせ技
FM自体の解説
https://qiita.com/s_katagiri/items/d630685dd2fe2627ecd3
1-5)線形学習
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/linear-learner.html
用途
* 分類問題 * 回帰分析
チュートリアル
https://github.com/awslabs/amazon-sagemaker-examples/blob/master/introduction_to_amazon_algorithms/linear_learner_mnist/linear_learner_mnist.ipynb
1-6)Sequence to Sequence(Seq2Seq)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/seq-2-seq.html
用途
* 機械翻訳 * テキスト要約 * 音声認識
チュートリアル
https://dev.classmethod.jp/articles/getting-started-amazon-sagemaker-built-in-algorithms-seq2seq/
1-7)オブジェクト検出
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/object-detection.html
用途
* 物体検出
1-8)セマンティックセグメンテーション (Semantic Segmentation)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/semantic-segmentation.html
1-9)Object2Vec
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/object2vec.html
1-10)BlazingText
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/blazingtext.html
以下のアルゴリズムを提供 a) Word2vec b) テキスト分類
用途
a) Word2vec * 感情分析、名前付きエンティティ認識、機械翻訳 b) テキスト分類 * ウェブ検索、情報検索、ランク付け、ドキュメント分類
【2】教師なし学習アルゴリズム
教師なし学習 => 正解を与えずにコンピュータに目的を見出す
2-1)K-Means (K-平均法)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/k-means.html
* MacQueen, Anderberg, Forgyらにより提案された 非階層型クラスタリング手法(※) => クラスタの平均(means)を用い、 あらかじめ決められたクラスタ数「k」個に分類する
※補足: 非階層クラスタ分析
* 異なる性質のものが混ざり合った集団から、 互いに似た性質を持つものをグループ分け(クラスタ) を作る方法 => あらかじめいくつのクラスターに分けるかを決め、 決めた数の塊にサンプルを分割する方法
用途
* クラスタリング (Clustering) ... 大量データから類似のものを集めて分類する
処理概要
1)k個のデータをランダムに振る 2)以下の操作を繰り返す i)全てのサンプルに対して、k個のデータとの距離を測る ii)各データポイントを最も近い重心に対応するクラスタに振る => 割り当てられるクラスタが変化しなくなるまで行う
参考文献
https://www.albert2005.co.jp/knowledge/data_mining/cluster/non-hierarchical_clustering
https://qiita.com/g-k/items/0d5d22a12a4507ecbf11
https://note.com/utaka233/n/nacb7d6eb2cef
動画
https://www.youtube.com/watch?v=8yptHd0JDlw
2-2)IP Insights
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/ip-insights.html
用途
* IPアドレス不正検知
2-3)潜在的ディリクレ配分 (LDA; Latent Dirichlet Allocation)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/lda.html
2-4)ニューラルトピックモデル (NTM)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/ntm.html
2-5)主成分分析法 (PCA; Principal Component Analysis)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/pca.html
シナリオに応じて次の 2 つのモードで動作 a) regular ... 疎データと標準的な数の観測および特徴を備えたデータセットの場合 b) randomized ... 多数の観測および特徴の両方を備えたデータセットの場合
用途
データセット内の次元 (特徴の数) の削減
参考文献
https://dev.classmethod.jp/articles/getting-started-amazon-sagemaker-built-in-algorithms-pca/
2-6)ランダムカットフォレスト (RCF; Random Cut Forest)
https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/randomcutforest.html
用途
* 異常値検知
参考文献
https://dev.classmethod.jp/machine-learning/getting-started-amazon-sagemaker-built-in-algorithms-guidance/
https://recipe.kc-cloud.jp/archives/12149
関連記事
Amazon SageMaker ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2020/03/18/223033
Amazon SageMaker ~ 基本編 ~
https://dk521123.hatenablog.com/entry/2020/03/19/231652
IT技術の学習サイト
https://dk521123.hatenablog.com/entry/2020/02/29/003619