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
5k
Amazon Machine Learning を使ってみた
画面を指さしながら説明するために作った背景画像の上に、簡単な説明テキストを追加したやつです。
Kenta Murata
April 21, 2015
Tweet
Share
More Decks by Kenta Murata
See All by Kenta Murata
waitany と waitall を作った話
mrkn
0
140
HolidayJp.jl を作りました
mrkn
0
150
Calling Julia functions from Streamlit applications
mrkn
1
370
Red Data Tools で切り開く Ruby の未来
mrkn
3
1.1k
Method-based JIT compilation by transpiling to Julia
mrkn
0
6.8k
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
900
Other Decks in Technology
See All in Technology
Chasing the White Whale of Open Source - ROI
mrbobbytables
0
100
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
29
13k
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
330
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
1
120
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.6k
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
400
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
240
SRE×AIOpsを始めよう!GuardDutyによるお手軽脅威検出
amixedcolor
0
200
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
200
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Visualization
eitanlees
145
15k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
380
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Unsuck your backbone
ammeep
668
57k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
A better future with KSS
kneath
238
17k
Designing for humans not robots
tammielis
250
25k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
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. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍ → ࣮ӡ༻࣌ࣗͰ࣮ͨ͠ϞσϧΛ͏ ɹ ϓϩτλΠϓͰ্ख͘ߦ͖ͦ͏ͳ͜ͱ͕ ɹ ͔ͬͯΔͷͰ࣮ίετؾʹͳΒͳ͍!?