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
160
HolidayJp.jl を作りました
mrkn
0
170
Calling Julia functions from Streamlit applications
mrkn
1
390
Red Data Tools で切り開く Ruby の未来
mrkn
3
1.1k
Method-based JIT compilation by transpiling to Julia
mrkn
0
6.9k
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
910
Other Decks in Technology
See All in Technology
生成AIをより賢く エンジニアのための RAG入門 - Oracle AI Jam Session #20
kutsushitaneko
4
320
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
170
Working as a Server-side Engineer at LY Corporation
lycorp_recruit_jp
0
450
[Oracle TechNight#85] Oracle Autonomous Databaseを使ったAI活用入門
oracle4engineer
PRO
1
160
C++26 エラー性動作
faithandbrave
2
840
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
150
いまからでも遅くないコンテナ座学
nomu
0
160
AI×医用画像の現状と可能性_2024年版/AI×medical_imaging_in_japan_2024
tdys13
0
430
Wantedly での Datadog 活用事例
bgpat
2
860
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
3
610
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
140
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
190
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Code Reviewing Like a Champion
maltzj
521
39k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
920
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
820
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Mobile First: as difficult as doing things right
swwweet
222
9k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
180
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
KATA
mclloyd
29
14k
Adopting Sorbet at Scale
ufuk
74
9.1k
Become a Pro
speakerdeck
PRO
26
5.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.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. ֶशࡁΈͷϞσϧΛΤΫεϙʔτͰ͖ͳ͍ → ࣮ӡ༻࣌ࣗͰ࣮ͨ͠ϞσϧΛ͏ ɹ ϓϩτλΠϓͰ্ख͘ߦ͖ͦ͏ͳ͜ͱ͕ ɹ ͔ͬͯΔͷͰ࣮ίετؾʹͳΒͳ͍!?