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
データを可視化する一般的なテク(?)~heatmapの拡張~ kaggle meetup #3
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
threecourse
October 28, 2017
1.2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
データを可視化する一般的なテク(?)~heatmapの拡張~ kaggle meetup #3
threecourse
October 28, 2017
More Decks by threecourse
See All by threecourse
Cloud_RunとOptunaでヒューリスティックコンテスト
threecourse
0
670
frontend-nanimo-wakaranai-20191224
threecourse
0
750
Kaggle_Days_Tokyo_-_Feature_Engineering_and_GBDT_Implementation.pdf
threecourse
5
8k
OpeningTalk-KaggleTokyoMeetup6.pdf
threecourse
0
8.5k
Kaggle Tokyo Meetup #4 Opening Talk
threecourse
0
7k
Opening Talk - Kaggle Tokyo Meetup #3
threecourse
0
260
kaggle tokyo meetup #2 opening talk
threecourse
0
480
過去のコンペをただ語る
threecourse
3
1k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Tell your own story through comics
letsgokoyo
1
1.1k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The Cult of Friendly URLs
andyhume
79
7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Transcript
データを可視化する一般的なテク(?) ~heatmapの拡張~ threecourse
motivation • Heatmapのセルの大きさを可変にするこ とにより、もう一つ情報を加えたい • 具体的な想定は商品×地域で、収益率とボ リュームを同時に見せるイメージ • ボリュームを見せることで、重要度や統計的 な信頼度についても把握できる
成果物
成果物 • Sample png2
成果物 • Kaggle Kernel https://www.kaggle.com/threecourse/heatm ap-with-change-cell-size-feature • Github https://github.com/threecourse/kaggle- meetup-heatmap
やったこと • Seabornのheatmapを改造 – Heatmapはseaborn/matrix.pyの_HeatMapper クラス、heatmapメソッドに記述されている – Heatmapでは内部的にpcolormeshが使われてい る。これでは実現が難しいので、rectを1個1個書 く方法に変更。
– argumentとその使われ方を修正。keyword argumentの使い方をもう少し明示的にしてほし い。 – annotationの追加はもともと機能にあった
既存のライブラリで 何かが足りないときにどうするか method pros cons スクラッチで書く • 簡潔、動きがわかり やすい •
ライブラリでいろん な状況を受け入れて いるところを結局自 分で書くことになる 既存のライブラリの一 部をコピペする(適宜 importを修正する) • ライブラリの上手い やり方を取り込むこ とができる • 小さな修正で済む場 合がある • ライブラリの理解が 深まる • いろんな状況を受け 入れる設計になって いるため、考えるこ とが増える(ばっさ り切るのもあり) • ライブラリの理解や ライブラリの思想に 合わせる必要がある
seaborn • Seabornの見た目が綺麗な理由 – sns.set()でset_context, set_style, set_paletteの3点を変更 する。 – context:ラベルや線やその他プロットの要素
– style : axesの色、グリッドの有無やその他美的要素 – palette : カラーパレット https://seaborn.pydata.org/tutorial/aesthetics.html • heatmapではargumentである程度のことはできる。ちゃん とドキュメントの引数の説明くらいは読んでおくのが良い。 • 値から色空間へのマッピングが“組み込まれすぎ”な気がする。 もう少し疎結合であってほしい。(例えば、d3.jsのdomain, rangeを指定してマッピングする)
matplotlib • つらい • matplotlibの概念・構成、plotを作ったり修正するときにど ういう順番に考えていけば良いかがわかる本がほしい • (stackoverflowとかで調べて)plt.xxxでできるのはわかるけ ど、ax.xxxでやりたいんですけど… •
globalに値を突っ込まれる場合が多いような・・・ • 全体的な設定はrcparamsでできる。 • rcparamsと各オブジェクトの操作が対応しているわけではな いので、各ArtistのAPIを見ていくしかない • Artistクラスに属するオブジェクトは、set(dict)とすると、 set_key1(value1), set_key2(value2)という関数がそれぞ れ呼びだされる。 • ちょっとした関数を作るときには、ax_kwsのような引数に dictを入れて、setで属性を設定するのがわかりやすいか