Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Extra Dojo #6 Auto AI を使ったらくらく機械学習 / IBM Dojo AutoAI ML 20200706

Extra Dojo #6 Auto AI を使ったらくらく機械学習 / IBM Dojo AutoAI ML 20200706

2020年7月6日開催の初夏のIBM Dojo #6 Auto AI を使ったらくらく機械学習の資料です。

Kyoko Nishito

July 06, 2020
Tweet

More Decks by Kyoko Nishito

Other Decks in Technology

Transcript

  1. 新しい取り組み“バッジ取得プログラム”のご案内 7 IBM Cloud & AI develop Basic Online Developer

    Dojo ” IBM Cloud & AI develop Basic Online Developer badge“について - 2020年6⽉1⽇より開始のIBM Developer Dojo 12回シリーズと同様の内容のIBM Developer Dojoのクラスが対象 https://www.ibm.com/jp-ja/partnerworld/events/developer-dojo - スキルアップのため全クラスの受講をお奨めします。 - 12回のクラスのうちPAYGアカウントまたはサブスクリプションが必要としない8つのクラスの課題を実施 - 8クラスのうち5クラスの課題について指定された結果を⾃分のアカウントが⾒えるようにスクリーンショットを撮影 - 5クラス分の課題のスクリーンショットをPDFにして以下の宛先に送付 - 提出した課題が承認されるとAcclaimからバッジが発⾏されます。 ※バッジ発⾏のためにこれ以外の処理が発⽣する場合、別途ご連絡させていただきます 2020年6⽉1⽇ お問い合わせは、Online Developer Dojo バッジ事務局 (ビジネス・パートナープログラム ヘルプデスク [email protected]
  2. ⽬次 1. 機械学習 2. Watson Studio概要 3. Watson Studio 注⽬機能

    4. Auto AI 5. Auto AI 課題DEMO 6. まとめ 7. 課題
  3. 機械学習 Machine Learning 14 14 課題: ⼼不全がおこるかどうかを判断する *BMI: 体重kg÷(⾝⻑m*⾝⻑m) 実⾏:

    モデルは⼼不全の有無 を予測 学習: 学習し結果予測モデル作成のために データセットを利⽤ ⼼拍数 BMI 年齢 性別 結果 93 25 49 F False 108 24 32 M False 80 31 60 M True 93 27 58 F True ⼊⼒: ⼼拍数, BMI*, 年齢, 性別
  4. 今までのやり⽅ -- Traditional 15 データ ルール if BPM-BMI > 60:

    result = True else: result = False 結果 アルゴリズム
  5. 機械学習 Machine Learning 17 データ ルール アルゴリズム(モデル) 結果 (学習済モデル) 学習

    (パラメータ内部調整) ルール (学習済モデル) 予測したい データ 予測結果
  6. 教師あり学習 機械学習 教師なし学習 強化学習 回帰 Regression 分類 Classification 連続した数値を推定 Watson

    Studioの AutoAI機能で プログラミングなしで モデル作成が可能! 分類クラスを推定 • Decision Tree Regression • Extra Trees Regression • Gradient Boosting Regression • LGBM Regression • Linear Regression • Random Forest Regression • Ridge • XGBoost Regression • Decision Tree Classifier • Extra Trees Classifier • Gradient Boosted Tree Classifier • LGBM Classifier • Logistic Regression • Random Forest Classifier • XGBoost Classifier
  7. (参考) AutoAIでサポートしているモデル(回帰) 回帰型モデルでは、次の8種類のモデルをサポートしています。 Algorithm Description Decision Tree Regression Maps observations

    about an item (represented in the branches) to conclusions about the item’s target value (represented in the leaves). It supports both continuous and categorical features. Extra Trees Regression An averaging algorithm based on randomized decision trees. Gradient Boosting Regression Produces a regression prediction model in the form of an ensemble of decision trees. It supports both continuous and categorical features. LGBM Regression Gradient boosting framework that uses tree-based learning algorithms. Linear Regression Models the linear relationship between a scalar-dependent variable y and one or more explanatory variables (or independent variables) x. Random Forest Regression Constructs multiple decision trees to produce the mean prediction of each decision tree. It supports both continuous and categorical features. Ridge Ridge regression is similar to Ordinary Least Squares but imposes a penalty on the size of coefficients. XGBoost Regression GBRT is an accurate and effective off-the-shelf procedure that can be used for regression problems. Gradient Tree Boosting models are used in a variety of areas including Web search ranking and ecology.
  8. (参考) AutoAIでサポートしているモデル(分類) 分類型モデルでは、次の7種類のモデルをサポートしています。 Algorithm Description Decision Tree Classifier Maps observations

    about an item (represented in branches) to conclusions about the item’s target value (represented in leaves). Supports both binary and multiclass labels, as well as both continuous and categorical features. Extra Trees Classifier An averaging algorithm based on randomized decision trees. Gradient Boosted Tree Classifier Produces a classification prediction model in the form of an ensemble of decision trees. It only supports binary labels, as well as both continuous and categorical features. LGBM Classifier Gradient boosting framework that uses leaf-wise (horizontal) tree-based learning algorithm. Logistic Regression Analyzes a data set in which there are one or more independent variables that determine one of two outcomes. Only binary logistic regression is supported Random Forest Classifier Constructs multiple decision trees to produce the label that is a mode of each decision tree. It supports both binary and multiclass labels, as well as both continuous and categorical features. XGBoost Classifier Accurate sure procedure that can be used for classification problems. XGBoost models are used in a variety of areas including Web search ranking and ecology.
  9. Watson Studio 概念図 エンタープライズ・カタログ (メタデータや分析資産を共有し、だれもが使える状態に) データソース 構造化 パブリック オンプレミス プライベート

    データ加⼯/品質確認 (プレパレーション) AI/マシン ラーニング データ可視化 ダッシュボード データへのアクセス データ蓄積 整える 分析活⽤する つなぐ データ サインティスト ビジネスプロセス スコアリング 結果 提供者の視点 利⽤者の視点 Watson Studio チームで協働する データ分析
  10. Watson Studioの特徴 –分析の全プロセスで⼀貫して使えるツール - データソース カタログ 抽出 加⼯・結合 テーブル作成 (BIモデル

    作成) データ 可視化 機械学習 モデル作成 特徴点 抽出 Tool A Tool B Tool C Watson Studio ガバナンス 再利⽤ 基盤担当 データ エンジニア データサイエンティスト アプリ開発者 データ ガバナンス担当 つなぐ 整える 分析活⽤する チームで協働する
  11. 整える︓データ準備 (探索・確認・加⼯) の効率化 データの品質や分布を可視化 ⽋損値や外れ値を把握・修正 ユーザー⾃⾝が、様々な データをGUIで簡単に加⼯ • 検索機能をつかって探し出す •

    他のユーザが作成した加⼯デー タ等を共有・再利⽤が出来る ⽬的に合う正しいデータを 探し取り出す データの特徴・分布状況を 簡単に確認 データ加⼯や結合を容易に ① データカタログ ② データプロファイル ③ セルフETL
  12. Watson Studio 機能 • カタログ機能: Connection登録 • カタログ機能: テーブル登録 •

    カタログ機能: ⽂書 • Refinery: データ分析 • Refinery: データ整形 • Cognos Service: BI Tool • 機械学習⽤GUIツール (AutoAI) • SPSS modeler機能 • R Studio機能 • Jupyter Notebook機能 • 深層学習⽤GUIツール (Neural Network Designer) • 深層学習⽤GUIツール (Experiment Builder) • 深層学習⽤の実験環境(HPO)の提供 • Decision Optimizer • Machine Learning: モデル管理機能 • Machine Learning: Webサービス化 • Machine Learning: モデルの再評価、再学 習、再配置 • Visual Recognition Model作成ツール • Natural Language Classifier model作成 ツール • NeuNetS(学習データ(イメージ)に応じて最 適な深層学習モデルを⽣成)
  13. Watson Studio 機能 • カタログ機能: Connection登録 • カタログ機能: テーブル登録 •

    カタログ機能: ⽂書 • Refinery: データ分析 • Refinery: データ整形 • Cognos Service: BI Tool • 機械学習⽤GUIツール (AutoAI) • SPSS modeler機能 • R Studio機能 • Jupyter Notebook機能 • 深層学習⽤GUIツール (Neural Network Designer) • 深層学習⽤GUIツール (Experiment Builder) • 深層学習⽤の実験環境(HPO)の提供 • Decision Optimizer • Machine Learning: モデル管理機能 • Machine Learning: Webサービス化 • Machine Learning: モデルの再評価、再学 習、再配置 • Visual Recognition Model作成ツール • Natural Language Classifier model作成 ツール • NeuNetS(学習データ(イメージ)に応じて最 適な深層学習モデルを⽣成) 今回は上記⿊字機能を ご紹介します
  14. Refinery (データ精製=データ整形) Refineryはデータ整形機能を持っています。下記のような処理をプログラミングなしに実現可能です。 また⼀度実⾏した⼿順を覚えて、同じ処理を⾃動で再実⾏することもできます(スケジュール機能)。 Knowledge Catalog 四則計算 属性変換 フィル ター

    関数計算 除去 リネーム ソート(昇 順) ソート(降 順) 表示マス キング テキスト 処理 欠損値へ変 換 重複行除去 空白行除去 欠損値の置 換 部分文字列 置換 日時データ 抽出 集約 条件置換 ジョイン サンプル抽 出 列分割 連結 ストップ ワード除去 形態素解析
  15. AutoAIの⾃動学習 データ前処理 効率のいいモデル作成に必須の処理である、⽋損値の補間、データのエンコードなどを、最適 な形で⾃動的に⾏います。 モデル選定 モデル選定に関しては、少ないデータで簡易的なモデルを作成し、有⼒な候補のモデルを絞り 込む⽅式を採⽤しています。この⽅法により、少ない処理時間で効率よく精度の⾼いモデルを 選定することが可能です。候補となるモデル数は 分類型: 7種類

    回帰型: 8種類です。 特徴量最適化 AutoAIでは、強化学習の仕組みを利⽤して、しらみつぶしではない効率のいい⽅法により、 精度の最適化をするための特徴量チューニングを⾏います。 ハイパーパラメータ最適化 モデルの精度に影響のある、ハイパーパラメータの最適化についても、計算資源をあまり使わ ない効率のいい⽅法で⾏います。 参照: https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/autoai-overview.html?audience=wdp
  16. (参考) AutoAIでサポートしているモデル(回帰) 回帰型モデルでは、次の8種類のモデルをサポートしています。 Algorithm Description Decision Tree Regression Maps observations

    about an item (represented in the branches) to conclusions about the item’s target value (represented in the leaves). It supports both continuous and categorical features. Extra Trees Regression An averaging algorithm based on randomized decision trees. Gradient Boosting Regression Produces a regression prediction model in the form of an ensemble of decision trees. It supports both continuous and categorical features. LGBM Regression Gradient boosting framework that uses tree-based learning algorithms. Linear Regression Models the linear relationship between a scalar-dependent variable y and one or more explanatory variables (or independent variables) x. Random Forest Regression Constructs multiple decision trees to produce the mean prediction of each decision tree. It supports both continuous and categorical features. Ridge Ridge regression is similar to Ordinary Least Squares but imposes a penalty on the size of coefficients. XGBoost Regression GBRT is an accurate and effective off-the-shelf procedure that can be used for regression problems. Gradient Tree Boosting models are used in a variety of areas including Web search ranking and ecology.
  17. (参考) AutoAIでサポートしているモデル(分類) 分類型モデルでは、次の7種類のモデルをサポートしています。 Algorithm Description Decision Tree Classifier Maps observations

    about an item (represented in branches) to conclusions about the item’s target value (represented in leaves). Supports both binary and multiclass labels, as well as both continuous and categorical features. Extra Trees Classifier An averaging algorithm based on randomized decision trees. Gradient Boosted Tree Classifier Produces a classification prediction model in the form of an ensemble of decision trees. It only supports binary labels, as well as both continuous and categorical features. LGBM Classifier Gradient boosting framework that uses leaf-wise (horizontal) tree-based learning algorithm. Logistic Regression Analyzes a data set in which there are one or more independent variables that determine one of two outcomes. Only binary logistic regression is supported Random Forest Classifier Constructs multiple decision trees to produce the label that is a mode of each decision tree. It supports both binary and multiclass labels, as well as both continuous and categorical features. XGBoost Classifier Accurate sure procedure that can be used for classification problems. XGBoost models are used in a variety of areas including Web search ranking and ecology.
  18. 4. Auto AI 課題DEMO 1. データ準備 2. Watson Studio のセットアップ

    3. Watson Studio の起動 4. Watson Studio Projectの作成 5. Machine Learningサービスの作成と追加 6. Auto AI モデル作成 7. Auto AI Deploy & テスト
  19. 4. Auto AI 課題Demo 1. データ準備 2. Watson Studio のセットアップ

    3. Watson Studio の起動 4. Watson Studio Projectの作成 5. Machine Learningサービスの作成と追加 6. Auto AI モデル作成 7. Auto AI Deploy & テスト
  20. 4. Auto AI 課題Demo 1. データ準備 2. Watson Studio のセットアップ

    3. Watson Studio の起動 4. Watson Studio Projectの作成 5. サービスの作成と追加 6. Auto AI モデル作成 7. Auto AI Deploy & テスト
  21. 54 2. Watson Studioのセットアップ • IBM Cloud ログイン アカウントをすでにお持ちの⽅は、 IBMidを⼊⼒してこちらからログインしてください

    https://cloud.ibm.com/loginにアクセスしてログインします。 • IBM Cloud ライトアカウント作成 アカウントをお持ちでない⽅は、 ご登録をお願いします
  22. 4. Auto AI 課題Demo 1. Watson Studio のセットアップ 2. Watson

    Studio の起動 3. Watson Studio Projectの作成 4. サービスの作成と追加 5. Auto AI モデル作成 6. Auto AI Deploy & テスト
  23. 60 1. ダッシュボードを表⽰ (左上のIBM Cloudロゴをクリック) 2. リソースの要約「Services」 →「Services」からWatson Studioのサー ビスを選択

    3. Watson Studioの起動 もし右側にこ のような画⾯ がでてきたら、 「全詳細の表 ⽰」をクリッ クする
  24. 4. Auto AI 課題Demo 1. データ準備 2. Watson Studio のセットアップ

    3. Watson Studio の起動 4. Watson Studio Projectの作成 5. サービスの作成と追加 6. Auto AI モデル作成 7. Auto AI Deploy & テスト
  25. 4. Auto AI 課題Demo 1. データ準備 2. Watson Studio のセットアップ

    3. Watson Studio の起動 4. Watson Studio Projectの作成 5. サービスの作成と追加 6. Auto AI モデル作成 7. Auto AI Deploy & テスト
  26. 3. Machine Learningの[Add]をクリック 4A: [New]のタブが選択された画⾯が表⽰された場合 1. スクロールしてPLANでLiteが選択されていることを確認して⼀番下 の[Create]をクリック 。 2.

    Confirmの画⾯でRegionがDallasになっていることを確認して [Confirm]をクリック 5. サービスの作成と追加 72 スクロール スクロール
  27. 5. サービスの作成と追加 73 4B[Existing]のタブが選択された画⾯が表⽰された場合 Existing Service Instance のドロップダウンから、使⽤するMachine Learningのサービスを選択して[Select]をクリック 。

    [Existing]のタブが選択された画⾯が表⽰されたにもかかわらず、「Existing Service Instance」の下に「 No existing service instances found 」が表⽰された 場合は、「CLOUD FOUNDRY ORG」のドロップダウンを開き、値を選択してみて ください。。
  28. 4. Auto AI 課題Demo 1. データ準備 2. Watson Studio のセットアップ

    3. Watson Studio の起動 4. Watson Studio Projectの作成 5. サービスの作成と追加 6. Auto AI モデル作成 7. Auto AI Deploy & テスト
  29. 6. Auto AI モデル作成 77 3. 名前 : Churn Analysisを⼊⼒し、

    ⾃分のWatson Machine Learning サービスインスタンスがセットされてい るのを確認して、[作成]をクリック
  30. 4. Auto AI 課題Demo 1. データ準備 2. Watson Studio のセットアップ

    3. Watson Studio の起動 4. Watson Studio Projectの作成 5. サービスの作成と追加 6. Auto AI モデル作成 7. Auto AI Deploy & テスト
  31. 7. Auto AI Deploy & テスト 3. 名前に「 Churn model

    deployment」と⼊⼒後、「保存」ボタンをク リックします。 90
  32. 7. Auto AI Deploy & テスト 4. 「デプロイメント」タブに⾃動で戻ります。状況が、初期化中から準備 完了に変わったら「Churn model

    deployment 」をクリックします。 1分待っても変わらない場合はリロードしてみてください。 91
  33. 7. Auto AI Deploy & テスト 6. [テスト]タブをクリックします。そのままフォームでデータを⼊れても できますが、今回はJSON inputアイコンをクリックして、JSONで⼊⼒し

    ます。以下の右のJSONデータを⼊⼒エリアにコピぺしします。 93 {"input_data": [{ "fields": [ "ID", "Gender", "Status", "Children", "Est Income", "Car Owner", "Age", "LongDistance", "International", "Local", "Dropped", "Paymethod", "LocalBilltype", "LongDistanceBilltype", "Usage", "RatePlan" ], "values": [[ 6, "M", "M", 2, 29616, "N", 49.42, 29.78, 0, 45.5, 0, "CH", "FreeLocal", "Standard", 75.29, 2 ]] }] } コピー& ペースト する
  34. 課題2(オプション) チュートリアル: IBM Watson Studio AutoAI: Modeling for the rest

    of us https://www.ibm.com/cloud/garage/dte/tutorial/ibm-watson-studio- autoai-modeling-rest-us のCreate an AutoAI model for regression 部分 (それより前のセクションは当講義の内容です) ⽇本語解説へのLink: http://ibm.biz/WatsonStudioTutrialJP 尚、⽇本語解説の画⾯イメージは英語版になります。
  35. 課題3(オプション) チュートリアル: IBM Watson Studio AutoAI: Modeling for the rest

    of us https://www.ibm.com/cloud/garage/dte/tutorial/ibm-watson-studio- autoai-modeling-rest-us のAccessing a model through a notebook 部分 ⽇本語解説へのLink: http://ibm.biz/WatsonStudioTutrialJP
  36. 2020 Call for Code グローバル・チャレンジ 今回のテーマは「気候変動」と「COVID-19」 • IBM Cloudを活⽤したアプリ開発コンテスト •

    「⼀般向け*」と「IBMer向け」に開催 4/27 (⽉) ⼀般 COVID19 早期締切 3/22 (⽇) 応募受付 開始 審査期間 8〜9⽉ 10⽉ 最優秀賞 チーム発表 6/30 (⽕) IBM社員 応募受付 最終締切 7/31 (⾦) ⼀般 応募受付 最終締切 * IBM Corporationとその法⼈、それらが所有する⼦会社の51%以上および、 Red Hat Inc.とそのすべての⼦会社は「⼀般向け」Call for Code 2020には 参加できませんのでご注意ください。IBM社員は詳しくは社内w3サイトで。 #CallforCode
  37. 免責事項 109 IBM Developer Dojoは開発者の⽅を対象に、IBM Cloudを主とした技術情報をお伝えする⽬的で開催しています。 講師や運営スタッフにより、開催毎に最適と判断した内容でお届けしています。 現在、ハンズオンを伴う講義はお客様の費⽤負担がない環境と⼿順でご案内しています。講義終了後、不要に なりました制作物はお客様ご⾃⾝で削除をお願いいたします。クレジットカードの登録が伴わない場合、費⽤は ⼀切発⽣致しませんが、ご登録いただいたお客様はご注意ください。

    講師陣はみなさまの利⽤状況を個別に確認することはできません。 ご理解とご協⼒をお願いいたします。 利⽤したサービスの削除⽅法については講義の中でご案内します。 ご不明な点がございましたら、当⽇確認をお願いいたします。 講義終了後、 IBM Developer Dojoに関するお問い合わせは「Slack」にお願いします。それ以外のIBM Cloudの お問い合わせにつきましては、弊社サポートセンターまで、次のいづれかの⽅法でお問い合わせください。 IBM Cloudダッシュボードの「サポート」メニューから「Case」を作成し、英語でご記⼊ください IBM Cloudサポートセンター「相談する」ボタンからチャットまたは電話でご連絡ください https://www.ibm.com/jp-ja/cloud/support ご参加ありがとうございました。