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
Transcript
9 slides
データを可視化する一般的なテク(?) ~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で属性を設定するのがわかりやすいか
More Decks by threecourse
See All by threecourse
Cloud_RunとOptunaでヒューリスティックコンテスト
threecourse
0
680
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
270
kaggle tokyo meetup #2 opening talk
threecourse
0
490
過去のコンペをただ語る
threecourse
3
1k
Featured
See All Featured
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.3k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
400
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
850
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
770
The agentic SEO stack - context over prompts
schlessera
0
1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
490
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
3.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k