Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Amazon Machine Learning を使ってみた
Search
Kenta Murata
April 21, 2015
Technology
17
4.9k
Amazon Machine Learning を使ってみた
画面を指さしながら説明するために作った背景画像の上に、簡単な説明テキストを追加したやつです。
Kenta Murata
April 21, 2015
Tweet
Share
More Decks by Kenta Murata
See All by Kenta Murata
waitany と waitall を作った話
mrkn
0
120
HolidayJp.jl を作りました
mrkn
0
120
Calling Julia functions from Streamlit applications
mrkn
1
330
Red Data Tools で切り開く Ruby の未来
mrkn
3
1k
Method-based JIT compilation by transpiling to Julia
mrkn
0
6.5k
Apache Arrow C++ Datasets
mrkn
4
1.5k
Reducing ActiveRecord memory consumption using Apache Arrow
mrkn
0
1.6k
RubyData and Rails
mrkn
0
3k
Tensor and Arrow
mrkn
0
870
Other Decks in Technology
See All in Technology
やってやろうじゃないかメカアジャイル! / Let's do it, mechanical agile!
psj59129
1
600
より快適なエラーログ監視を目指して
leveragestech
4
1.4k
App Router を実プロダクトで採用して見えてきた勘所をちょっとだけ紹介
marokanatani
1
920
Oracle Autonomous Database:サービス概要のご紹介
oracle4engineer
PRO
1
7k
Javaにおける関数型プログラミンへの取り組み
skrb
7
320
フルカイテン株式会社 採用資料
fullkaiten
0
32k
サーバレスでモバイルアプリ開発! NTTコム「ビジネスdアプリ」のアーキテクチャ / The architecture of business d app
nttcom
12
240
AIで変わるテスト自動化:最新ツールの多様なアプローチ/ 20240910 Takahiro Kaneyama
shift_evolve
0
210
スタッフエンジニアの道: The Staff Engineer’s Path
snoozer05
PRO
44
14k
自作Cコンパイラ 8時間の奮闘
soukouki
0
830
ロリポップ! for Gamersを支えるインフラ/lolipop for gamers infrastructure
takumakume
0
130
20240911_New_Relicダッシュボード活用例
speakerdeckfk
0
100
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
230
130k
In The Pink: A Labor of Love
frogandcode
139
22k
Embracing the Ebb and Flow
colly
83
4.4k
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
Principles of Awesome APIs and How to Build Them.
keavy
125
16k
Learning to Love Humans: Emotional Interface Design
aarron
270
40k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
190
16k
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
What the flash - Photography Introduction
edds
67
11k
Faster Mobile Websites
deanohume
304
30k
Six Lessons from altMBA
skipperchong
26
3.3k
A Modern Web Designer's Workflow
chriscoyier
691
190k
Transcript
Amazon ML Λ ͬͯΈͨ Kenta Murata 2015.04.21
ػցֶश
ػցֶशͰͰ͖Δ͜ͱ 1. ճؼ 2. ྨ 3. ΫϥελϦϯά
ػցֶशͰͰ͖Δ͜ͱ 1. ճؼ 2. ྨ 3. ΫϥελϦϯά → ࣮ͷ༧ଌ http://commons.wikimedia.org/wiki/File:Linear_regression.svg
http://commons.wikimedia.org/wiki/File:Polyreg_scheffe.svg
ػցֶशͰͰ͖Δ͜ͱ 1. ճؼ 2. ྨ 3. ΫϥελϦϯά → ࣮ͷ༧ଌ →
͔̋×͔Λ༧ଌ http://en.wikipedia.org/wiki/File:SVM_with_soft_margin.pdf
ػցֶशͰͰ͖Δ͜ͱ 1. ճؼ 2. ྨ 3. ΫϥελϦϯά → ࣮ͷ༧ଌ →
͔̋×͔Λ༧ଌ → ࣗಈάϧʔϓ͚ http://commons.wikimedia.org/wiki/File:KMeans-density-data.svg
Amazon Machine Learning
Amazon Machine Learning ͰͰ͖Δ͜ͱ 1. ճؼ 2. ೋྨ 3. ଟྨ
Amazon Machine Learning ͰͰ͖Δ͜ͱ 1. ճؼ 2. ೋྨ 3. ଟྨ
ͬͯΈͨ
Amazon Machine Learning Ͱ ଟྨثΛ࡞Δ
σʔλͷ४උ ↓ σʔλιʔε࡞ ↓ Ϟσϧ࡞ ↓ (σʔλιʔεͷࣗಈׂ) ↓ Ϟσϧͷֶश ↓
ϞσϧͷධՁ ଟྨثͷ࡞खॱ
σʔλͷ४උ
None
70,000ݸͷखॻ͖ࣈ http://myselph.de/neuralNet.html 28px 28px
60,000ݸ → ֶश༻ 10,000ݸ → ධՁ༻ ֶश༻ͱධՁ༻ʹ༧Ί͚ͯ͞Ε͍ͯΔ
όΠφϦσʔλͳͷͰ CSV ม͢Δ
28px 28px y, x1, x2,ɾɾɾ, x_k,ɾɾɾ, x784 8, 0, 0,ɾɾɾ,
221,ɾɾɾ, 0 256֊ௐάϨΠεέʔϧ ਖ਼ղϥϕϧ ϐΫηϧ
μϯϩʔυ͢Δ
https://rubygems.org/gems/mnist
$ gem install mnist $ mnist2csv train-images-idx3-ubyte.gz train-labels-idx1-ubyte.gz > mnist_train.csv
$ mnist2csv t10k-images-idx3-ubyte.gz t10k-labels-idx1-ubyte.gz > mnist_test.csv
CSV ϑΝΠϧΛ S3 ʹΞοϓϩʔυ͢Δ
σʔλιʔεΛ࡞Δ
None
Ξοϓϩʔυͨ͠ CSV ϑΝΠϧ
None
None
None
None
ྨରͷΧϥϜΛબͯ͠Ͷὑ
σʔλΛݟͯࣗಈఆ
༧ଌ݁Ռ͕σʔλιʔεͷͲͷߦʹରԠ͢Δ͔Λ ࣝผ͢ΔͨΊͷ ID ͕͋Εࢦఆ͢Δ ࠓճແ͍ͷͰࢦఆ͠ͳ͍
None
None
None
None
ϞσϧΛ࡞Δ
None
ೖྗσʔλΛબ
બͿ
None
None
σʔλΛ 7:3 ʹׂͯ͠ 7 ͷํΛ܇࿅ʹɺ3 ͷํ ΛϞσϧͷධՁʹ͏
͍Ζ͍ΖࣗͰࢦఆ͢Δ ࠓճͬͪ͜
None
σʔλͷલॲཧํ๏ͳͲ Λ JSON Ͱࢦఆ͢Δ ϑΟʔϧυɻ ࠓճ CSV ʹมͨ͠ ͚ͩͰલॲཧ͕ྃͯ͠ ΔͷͰσϑΥϧτͷ··
Ͱ͓̺
None
Regularization (ਖ਼ଇԽ) ɺϞσϧͷաֶश (܇࿅σʔ λʹద߹͗ͯ͢͠͠·͏ࣄ) Λ͙ͨΊʹߦ͏ɻ L1 (Lasso ճؼ) ɺෆཁͳύϥϝʔλΛͬͯϞσϧΛ
γϯϓϧʹ͍ͨ͠ͱ͖ʹ͏ɻ L2 (Ridge ճؼ) Β͔ͳϞσϧ͕ཉ͍͠ͱ͖ʹ͏ɻ (ײ: L1 ͱ L2 ΛࠞͥΒΕΕͬͱྑ͍ͷʹ)
None
Ϟσϧͷ࡞ޙʹࣗಈతʹධՁ࣮ࢪ͢Δ͔Ͳ͏͔ɻ ࠓճผʹධՁΛΔͷͰ No ΛબͿɻ
None
None
ϞσϧΛ࡞Δ
ֶशδϣϒࣗಈతʹ։࢝͢Δ
None
60,000 ڭࢣσʔλ → 20
ϞσϧΛධՁ͢Δ
None
None
None
None
None
None
None
10,000 ςετσʔλ → 1ʙ2
None
ҎԼͷࣜͰܭࢉ͞ΕΔϞσϧͷ༏ल͞ΛଌΔྔ 2 × ద߹ × ࠶ݱ ద߹ + ࠶ݱ
ਅͷྨ 1 ͦͷଞ ༧ ଌ ݁ Ռ 1 True Positive
False Positive ͦ ͷ ଞ False Negative True Negative ద߹ ʹ ࠶ݱ ʹ True Positive True Positive + False Positive True Positive True Positive + False Negative TP FP FN TN TP FP FN TN
None
1,000 ڭࢣσʔλͰ࡞ͬͨϞσϧͷ߹
None
ڭࢣσʔλ͕ଟ͍΄ͲϞσϧͷੑೳ͕ྑ͘ͳΔ
ϞσϧΛ͏
Ϟσϧͷ͍ํ 1. όον༧ଌ 2. ϦΞϧλΠϜ༧ଌ
Ϟσϧͷ͍ํ 1. όον༧ଌ 2. ϦΞϧλΠϜ༧ଌ → ·ͱ·ͬͨσʔλΛ·ͱΊͯ༧ଌ
Ϟσϧͷ͍ํ 1. όον༧ଌ 2. ϦΞϧλΠϜ༧ଌ → ·ͱ·ͬͨσʔλΛ·ͱΊͯ༧ଌ → API Λͬͯ1ͭͣͭ༧ଌ
Amazon Machine Learning ͷྉۚମܥ
Amazon Machine Learning ͷྉۚମܥ
1,000 σʔλͰϞσϧΛ࡞ͬͨͱ͖
70,000 σʔλͰϞσϧΛ࡞ͬͨͱ͖
S3 price
Amazon Machine Learning ΛͬͯΈͨײ 1. Α͘Ͱ͖ͯΔ 2. ͬ͘͞ͱϓϩτλΠϓ͍ͨ࣌͠ʹศརͦ͏ 3. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍
Amazon Machine Learning ΛͬͯΈͨײ 1. Α͘Ͱ͖ͯΔ 2. ͬ͘͞ͱϓϩτλΠϓ͍ͨ࣌͠ʹศརͦ͏ → ΞϧΰϦζϜΛදʹग़ͣ͞ʹ্ख͘؆ུԽͯ͠Δ
3. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍
Amazon Machine Learning ΛͬͯΈͨײ 1. Α͘Ͱ͖ͯΔ 2. ͬ͘͞ͱϓϩτλΠϓ͍ͨ࣌͠ʹศརͦ͏ → ΞϧΰϦζϜΛදʹग़ͣ͞ʹ্ख͘؆ུԽͯ͠Δ
→ ࣮ӡ༻લʹ༷ʑͳಛϕΫτϧΛ؆୯ʹࢼͤΔ 3. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍
Amazon Machine Learning ΛͬͯΈͨײ 1. Α͘Ͱ͖ͯΔ 2. ͬ͘͞ͱϓϩτλΠϓ͍ͨ࣌͠ʹศརͦ͏ → ΞϧΰϦζϜΛදʹग़ͣ͞ʹ্ख͘؆ུԽͯ͠Δ
→ ࣮ӡ༻લʹ༷ʑͳಛϕΫτϧΛ؆୯ʹࢼͤΔ 3. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍ → ࣮ӡ༻࣌ࣗͰ࣮ͨ͠ϞσϧΛ͏ ɹ ϓϩτλΠϓͰ্ख͘ߦ͖ͦ͏ͳ͜ͱ͕ ɹ ͔ͬͯΔͷͰ࣮ίετؾʹͳΒͳ͍!?