SlideShare a Scribd company logo
データサイエンス勉強会
~機械学習/強化学習による最適戦略の学習~
アジェンダ
• 第Ⅰ部 機械学習とは?
• 第Ⅱ部 強化学習で最適戦略の学習
第Ⅰ部
• 機械学習とは?
• 3つのアプローチ
• 学習方法
• 未学習と過学習
第Ⅰ部
• 機械学習とは?
• 3つのアプローチ
• 学習方法
• 未学習と過学習
第Ⅰ部
機械学習とは?
データ 学習 モデル作成
機械学習とは?
データ 学習 モデル作成
作成したモデルで回帰/分類問題を解く
• 機械学習とは?
• 3つのアプローチ
• 学習方法
• 未学習と過学習
第Ⅰ部
3つのアプローチ
教師あり学習 教師なし学習
強化学習
3つのアプローチ
教師あり学習 教師なし学習
強化学習
教師あり学習
事前に与えられたデータを例題として、学習を行う
回帰/分類問題を解くことができる
教師あり学習
事前に与えられたデータを例題として、学習を行う
回帰/分類問題を解くことができる
・決定木
代表的なアプローチ
・線形回帰
・ロジスティクス回帰
・サポートベクターマシーン
3つのアプローチ
教師あり学習 教師なし学習
強化学習
教師なし学習
答えのないデータが与えられ、
それらのデータから本質的な構造を抽出する
教師なし学習
答えのないデータが与えられ、
それらのデータから本質的な構造を抽出する
・クラスタリング
代表的なアプローチ
・協調フィルタリング
3つのアプローチ
教師あり学習 教師なし学習
強化学習
強化学習
観測可能な状態において選択可能な行動の内、
報酬が最大の行動を学習する
強化学習
観測可能な状態において選択可能な行動の内、
報酬が最大の行動を学習する
詳細は第Ⅱ部で
• 機械学習とは?
• 3つのアプローチ
• 学習方法
• 未学習と過学習
第Ⅰ部
学習方法
バッチ処理 ミニバッチ処理
オンライン学習
バッチ処理
バッチ処理
全データを使って学習し、モデルを作る
多くのアルゴリズムで採用されている
ミニバッチ処理
全データを分割して学習し、モデルを作る
ミニバッチ処理
データ量が多い場合、
バッチ処理よりも高速になる
オンライン学習
新しいデータと既存モデルを使って学習し、
モデルを作る
オンライン学習
新しいデータでモデルを更新
常に精度の高い学習が可能
• 機械学習とは?
• 3つのアプローチ
• 学習方法
• 未学習と過学習
第Ⅰ部
未学習と過学習とは?
未学習 過学習
イメージ
未学習と過学習とは?
未学習 過学習
イメージ
モデルが学習データにも
フィットしない
モデルが学習データにしか
フィットしない
どういう状況の時に
未学習、過学習になるか?
未学習の場合
未学習:Underfitting
モデルが学習したデータにもフィットしていない
作成したモデルの仮説に誤り
対処方法:学習に使う情報を再検討する
過学習の場合
過学習:Overfitting
モデルが学習したデータにしかフィットしていない
モデルが学習データに強く依存している
対処方法:テストデータを活用し、
新しいデータにもフィットするモデルを作る
• 機械学習とはデータを学習して、モデルを作り回帰/分
類問題を解く技術
• 機械学習には「教師あり学習」、「教師なし学習」、
「強化学習」の3つのアプローチがある
• 学習方法は「バッチ処理」、「ミニバッチ処理」、「オ
ンライン学習」の3つがある
• 作成したモデルが「未学習」や「過学習」にならないよ
うに注意する
第Ⅰ部まとめ
つづく
つづき
第Ⅱ部
• 強化学習とは?
• アルゴリズム
• マルコフ決定過程
• 強化学習で最適な戦略を学習しよう!
第Ⅱ部
• 強化学習とは?
• アルゴリズム
• マルコフ決定過程
• 強化学習で最適な戦略を学習しよう!
第Ⅱ部
強化学習とは?
ある状態において選択可能な行動の中から
最も報酬が得られる行動を学習する手法
強化学習とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
強化学習とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
「持っていく」
を選択
強化学習とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
「持っていく」
を選択
状態
雨
強化学習とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
状態
雨
傘で雨を凌いだ
プラスの報酬GET「持っていく」
を選択
傘を持っていかなかったら
強化学習とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
状態
雨
傘で雨を凌いだ
プラスの報酬GET「持っていかない」
を選択
雨でびしょ濡れ
マイナスの報酬GET
強化学習とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
状態
雨
傘で雨を凌いだ
プラスの報酬GET「持っていかない」
を選択
雨でびしょ濡れ
マイナスの報酬GET
ある状態で選択した行動結果を評価する
これを繰り返し行い、最適な行動を学習する
• 強化学習とは?
• アルゴリズム
• マルコフ決定過程
• 強化学習で最適な戦略を学習しよう!
第Ⅱ部
アルゴリズム
強化学習といえばQ学習
Q学習(Q-learning)とは?
Q学習はある状態で選択可能な行動に対して、Q値を与え、
Q値を比較して行動を選択する
𝑄 𝑠𝑡, 𝑎 𝑡 ← 𝑄 𝑠𝑡, 𝑎 𝑡 + 𝛼 [𝑟𝑡+1 + 𝛾𝑚𝑎𝑥𝑄 𝑠𝑡+1, 𝑎 − 𝑄(𝑠𝑡, 𝑎 𝑡)]
𝑄 𝑠𝑡, 𝑎 𝑡 :時刻tにおける状態Sで選択可能な行動aに対するQ値
α:学習率
𝑟𝑡+1:時刻tで行動した結果得られる利得
γ:割引率(0 < γ < 1)
Q学習(Q-learning)とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
𝑄 曇, 傘を持っていく
𝑄(曇,
Q学習(Q-learning)とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
𝑄 曇, 傘を持っていく
𝑄(曇,
Q値を元に
行動選択
Q学習(Q-learning)とは?
Q学習の行動選択
行動選択は確率的に決定
Q学習(Q-learning)とは?
Q学習の行動選択
行動選択は確率的に決定
Explore(探索)とExploit(搾取)を行い、最適解を学習する
Q学習(Q-learning)とは?
Q学習の行動選択
行動選択は確率的に決定
Explore(探索)とExploit(搾取)を行い、最適解を学習する
確率的に行動を決定するため、局所最適解を回避できる
Q学習(Q-learning)とは?
(例)「傘を持っていくべきか?」
状態
曇
持っていく
持っていかない
𝑄 曇, 傘を持っていく =3
𝑄 曇, 傘を持っていかない =1
Q値を元に
行動選択
Exploit Q値が最大の行動 傘を持っていく
Explore 確率的に行動選択
持っていく or
持っていかない
Q学習(Q-learning)とは?
Q学習の行動選択方法
・ε-グリーディ法:微小な確率εでランダムに、それ以外で
Q値が最大の行動を選択する方法
・acor-critic法:確率分布に従い行動を選択する方法
・ソフトマックス法:ボルツマン分布を利用した選択方
法
等
• 強化学習とは?
• アルゴリズム
• マルコフ決定過程
• 強化学習で最適な戦略を学習しよう!
第Ⅱ部
• 状態遷移が生じる動的システムの確率モデル
– 強化学習のモデル:行動を確率的に決定し、状態遷移
• 状態と選択可能な行動が予め全てわかっている
– (例)状態:晴、曇、雨
行動:傘を持っていく、傘を持っていかない
• 行動して得られる利得と利得を得られる確率は予
めわからない
– 強化学習が求める答え
マルコフ決定過程とは?
• 強化学習とは?
• アルゴリズム
• マルコフ決定過程
• 強化学習で最適な戦略を学習しよう!
第Ⅱ部
強化学習で最適な戦略を学習しよう!
じゃんけんの最適な戦略を
Q学習で学習してみた
強化学習で最適な戦略を学習しよう!
じゃんけんの最適な戦略を
Q学習で学習してみた
デモ
• Q値の更新は正常にできていた
• 学習した結果が最適な戦略とは言い切れなかった
• 全ての状態、行動を学習するには非常に時間がか
かる
• 混合戦略(戦略決定に相手の戦略にも影響を受け
る)への適応が課題
Q学習してみた結果
おわり

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

データサイエンス勉強会~機械学習_強化学習による最適戦略の学習