Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
分位点回帰 / quantile regression
Search
jeey
May 29, 2020
Science
930
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
分位点回帰 / quantile regression
jeey
May 29, 2020
More Decks by jeey
See All by jeey
uplift modeling
jeyjeyjeey
0
3.1k
対数変換ってしてもいいの? / Is it really okey to do Log Transformation
jeyjeyjeey
0
97
目的関数と評価指標 / Objective Function and Evaluation Metrics
jeyjeyjeey
0
240
ビッグデータの哲学 / Philosophy of Big Data
jeyjeyjeey
0
79
Webマーケティング業務のデータサイエンス ざっくり編 / data science in web marketing business (Big Picture)
jeyjeyjeey
0
130
Other Decks in Science
See All in Science
O(log n)-Approximation Algorithms for Bipartiteness Ratio
tasusu
0
290
AI Agents for Earth Observation
sabman
0
120
JPA2026_NetworkSymposium_Overview
junkashihara
0
110
機械学習 - ニューラルネットワーク入門
trycycle
PRO
0
1.4k
Leitner Inauguration Lecture Chalmers University of Technology
xleitix
0
400
Toward Causal Scientific Discovery with AI
sshimizu2006
0
240
Conwayの法則を"ちゃんと"使うために — 原典でConwayは何を言っていたのか
bonotake
10
7.7k
[第67回 CV勉強会@関東] CV × Scientific Figures / kantoCV 67th CVPR 2026
lychee1223
0
260
Visual Linear Algebra - Lecture at Shosen Grande
hiranabe
0
680
科学で迫る勝敗の法則-スポーツデータ分析の最前線 (刈谷市連携講座.2026年7月) / The principle of victory discovered by science. at Kariya City, 2027.07
konakalab
0
210
AlgorithAlgorihms for Decision Making
mickey_kubo
0
180
(CVPR2026) Back to Basics: Let Denoising Generative Models Denoise
shumpei777
0
440
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
340
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Paper Plane
katiecoart
PRO
5
54k
Evolving SEO for Evolving Search Engines
ryanjones
0
340
A Modern Web Designer's Workflow
chriscoyier
699
190k
New Earth Scene 8
popppiees
4
2.7k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
590
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Transcript
Q u a n t i l e R e
g r e s s i o n Q u a n t i l e R e g r e s s i o n Q u a n t i l e R e g r e s s i o n Q u a n t i l e R e g r e s s i o n Q u a n t i l e R e g r e s s i o n Q u a n t i l e R e g r e s s i o n Q u a n t i l e R e g r e s s i o n Ґ ճؼ
1. ༧ଌͷ৴པੑͱ 2. ༧ଌͷ৴པੑͷϞσϦϯά 3. ϐϯϘʔϧଛࣦؔ 4. ଛࣦؔʹΑΔҐͷਪఆ 5. ར༻ՄೳͳϥΠϒϥϦ
1. ༧ଌͷ৴པੑͱ
Ͳͬͪͷ༧ଌಉ͘͡Β͍৴པͰ͖Δ͔ͳʁ
ੳ՝ʹ͓͍ͯɺ͋Δ༧ଌͷ֬ΛҙࢥܾఆͷҰॿͱ͍ͨ͠ ߹͕͋Δ ·ͨɺ࣮ଌΑΓ্ৼΕɾԼৼΕͨ͠Λࢀߟʹҙࢥܾఆͨ͠ ΄͏͕ɺ҆શଆͷஅͱͳΔ߹͕͋Δ ༧ଌͷ৴པੑ
༧ଌͷ෯͕ ͱͳΔ߹ ྫʣࢿஅ ࠷େརӹͱͳΔ༧ଌ͕ਪఆ͞Εͨͱͯ͠ɺͦ Ε͕ಉ࣌ʹ࠷རӹͱͳΔՄೳੑ͋Δ͘Β͍ෆ ֬ఆͳ༧ଌͰ͋Δ߹ɺͦΕΑΓརӹ ͍͕ݻ͍༧ଌͰࢿஅΛߦ͍͍ͨɺͱ͍͏ Α͏ͳϦεΫධՁಉ࣌ʹߦ͍͍ͨ߹͕͋Δ ʢϘϥςΟϦςΟͷ༧ଌʣ ͜ΜͳઢΛҾ͍ͯɺϦεΫͱϦλʔϯͷόϥϯε
Λͱͬͯҙࢥܾఆ͍ͨ͠
༧ଌͷ্ৼΕ͕ ͱͳΔ߹ ྫʣ৯খചۀऀ Ұൠʹ95%Ҏ্ͷඇৗʹߴ͍αʔϏεϨϕϧΛ ٻ͢Δʢͭ·ΓɺࡏݿΕඇৗʹكʣ ͜ͷ߹ɺଈ࣌ൢചͷࡏݿ͕ͳ͍ΑΓɺ༨ࡏݿ Λ๊͑Δ΄͏͕ྑ͍ͱஅ͞ΕΔ ্ৼΕͷઢΛҾ͍ͯɺ͜ͷ༧ଌͰҙࢥܾఆΛ͍ͨ͠
༧ଌͷԼৼΕ͕ ͱͳΔ߹ ྫʣࣗಈंϝʔΧʔ ৗʹੜ࢈ίετΛݮ͢ΔΑ͏ࢦ͓ͯ͠Γɺࡏ ݿθϩઓུΛબ͢ΔϝʔΧʔ͋Δʢं͕ߪೖ ͞Ε͔ͯΒɺͦͷޙੜ࢈͢Δʣ ͜ͷ߹ɺ༨ࡏݿΛ๊͑ΔΑΓɺଈ࣌ൢചͷࡏ ݿ͕ͳ͍΄͏͕ྑ͍ͱஅ͞ΕΔ ԼৼΕͷઢΛҾ͍ͯɺ͜ͷ༧ଌͰҙࢥܾఆΛ͍ͨ͠
Ҏ্ͷΑ͏ͳ߹ɺ͜ͷ༧ଌ۠ؒʢ্ৼΕɾԼৼΕʣ͕Θ͔ΔΑ͏ʹ ϞσϧΛ࡞ͨ͠΄͏͕ɺϏδωε՝ʹد༩Ͱ͖Δ߹͕͋Δ ༧ଌ۠ؒ
2. ༧ଌͷ৴པੑͷϞσϦϯά
ਪఆͰͳ͘ɺ্ৼΕɾԼৼΕΛਪఆ ͢ΔͨΊʹɺ༧ଌ۠ؒͷਪఆΛߦ ͍͍ͨ ࠓճɺҐͷਪఆΛߦ͏ࣄʹΑΓɺ ༧ଌ۠ؒͷਪఆΛߦ͏ख๏Λհ͢Δ ༧ଌ͕۠ؒΘ͔Δ΄͔ʹɺͦͷҐʹ ͓͚ΔภճؼͷมಈΘ͔Δ ࣌ܥྻϞσϧʹԠ༻Ͱ͖Δ ҐճؼʢΫΦϯλΠϧճؼʣ
3. ϐϯϘʔϧଛࣦؔ
ྫ͑ઢܗճؼͰతؔʹೋޡࠩؔΛ༻͍Δ ͕ɺҐճؼͰΘΓʹϐϯϘʔϧଛࣦؔʢඇ ରশઈରޡࠩؔʣΛ༻͍Δ ԼهͷΑ͏ʹॏΈ͚Λߦ͏ ࣮ଌͱ༧ଌͱͷࠩʢeʣ͕ਖ਼ͷͱ͖Н ࣮ଌͱ༧ଌͱͷࠩʢeʣ͕ෛͷͱ͖Н−̍ ϐϯϘʔϧଛࣦؔ ඍՄೳͳͷͰɺతؔͱͯ͠ධՁࢦඪͱͯ͠ ༻͍Δ͜ͱ͕Ͱ͖Δ τΛ0.5ͱ͢ΔͱதԝͱͳΔ
ϐϯϘʔϧଛࣦؔ ϐϯϘʔϧͷϘʔϧͷيಓʹɹ ࣅ͍ͯΔ͔ΒΒ͍͠ ࣮ͷϐϯϘʔϧ τΛΫΦϯλΠϧͱͯ͠ఆٛʢ95%ͳΒ0.95ʣ͠ɺ Нͷൣғଛࣦ͕ޡ͕ࠩ͘ධՁ͞Εɺൣғ֎Ͱ ޡ͕ࠩେ͖͘ධՁ͞ΕΔΠϝʔδ
4.ଛࣦؔʹΑΔ Ґͷਪఆ
͜ͷଛࣦؔͷ࠷খԽΛߦ͏͜ͱͱɺҐͷਪఆΛߦ͏͜ͱ͕ಉٛ Ͱ͋Δ͜ͱɺֶతʹಋ͘͜ͱ͕Ͱ͖Δ https://en.wikipedia.org/wiki/Quantile_regression ϐϯϘʔϧଛࣦؔͷܭࢉɺ ͋Δ֬ʹै͏֬ม:ʢ࣮ଌʣͱ ҐVͱͷࠩͷظͱݴ͍͑ͯྑ͍ ߹͚ʹैͬͯղ͢Δʢࢄͷ߹ʣ ࠷খԽͷͨΊɺVʹ͍ͭͯඍ ਪఆҐV R@aUBV
ʹ͓͚Δ:ͷྦྷੵີ͕Нͱ͘͠ͳΔ
5. ར༻ՄೳͳϥΠϒϥϦ
import statsmodels.formula.api as smf q = .975 mod = smf.quantreg('y
~ x', data) upper_mod = mod.fit(q=q) lower_mod = mod.fit(q=1-q) import lightgbm as lgb q = .975 clf_upper = lgb.LGBMRegressor(objective='quantile', alpha=q).fit(x, y) clf_lower = lgb.LGBMRegressor(objective='quantile', alpha=1-q).fit(x, y) # lossʹԼهͷΑ͏ͳϐϯϘʔϧଛࣦؔΛఆٛͯ͠ࢦఆ͢Δ class QuantileLoss(nn.Module): def __init__(self, quantiles): super().__init__() self.quantiles = quantiles def forward(self, preds, target): assert not target.requires_grad assert preds.size(0) == target.size(0) losses = [] for i, q in enumerate(self.quantiles): errors = target - preds[:, i] losses.append( torch.max( (q-1) * errors, q * errors ).unsqueeze(1)) loss = torch.mean( torch.sum(torch.cat(losses, dim=1), dim=1)) return loss ઢܗϞσϧʢPython: statsmodelsʣ ޯϒʔεςΟϯάܾఆʢPython: Lightgbmʣ Deep LearningʢPython: Pytorchʣ ઢܗϞσϧʢR: quantreg R͍ͬͺ͍͋Δʣ library(quantreg) rq(y~x, data=data, tau=seq(0,1,0.25))
※KaggleͰ༧ଌ۠ؒਪఆͷίϯϖ͕։࠵த
• R Koenker, Kf Hallock, Quantile Regression, Journal Of Economic
Perspectives, 2001 • Wikipedia, Quantile Regression • Https://En.Wikipedia.Org/Wiki/Quantile_Regression • Lokad • Https://Www.Lokad.Com/Jp/Ґ༧ଌ-ٕज़ • Https://Www.Lokad.Com/Jp/ΫΥϯλΠϧ-ճؼ-ʢ࣌-ܥྻʣ-ఆٛ • Https://Www.Lokad.Com/Jp/ϐϯϘʔϧϩεػೳ-ఆٛ • ҐճؼΛͬͯɺʮͦͷճؼ༧ଌͲΕ͙Β͍֎ΕΔͷʁʯΛઆ໌͢Δ • Https://Devblog.Thebase.In/Entry/2018/12/06/110655 • Qrnn χϡʔϥϧωοτΛ༻͍ͨҐճؼ • Https://Aotamasaki.Hatenablog.Com/Entry/2019/01/29/191604 • ฏۉ͔ΒҐɿҐճؼ • Https://Www.N-Insight.Co.Jp/Niblog/20150903-1087/ • Quantile Regression — Part 2 • Https://Medium.Com/The-Artificial-Impostor/Quantile-Regression-Part-2-6Fdbc26B2629 ࢀߟ