Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Plotly dash and data visualisation in Python

3 134 vues

Publié le

Slides from PyData Berlin, July 2017 meetup
Plotly Dash is a newest addition to a rich ecosystem of tools to build visual data science and BI applications in Python.

Publié dans : Technologie

Plotly dash and data visualisation in Python

  1. 1. Volodymyrk 1 Berlin, 16th July, 2017 And Data Visualisation in Python
  2. 2. Volodymyrk Volodymyr ( Vlad ) Kazantsev Head of Data Science @ Wooga Head of Data @ Product Madness Product Manager MBA @LBS Graphics programming Writes code for money since 2002 Math degree 2
  3. 3. Live Demo-1
  4. 4. Volodymyrk Plotly dash .. 2 minute version - Build interactive data visualisations for the Web - In Pure Python - no HTML/JavaScipt required 5
  5. 5. Volodymyrk What is Plotly (visualisation library)? 6 + + API bindings: - Core is 100% Open Source - Has enterprise plans (and premium plugins) - 50%+ of all devs are working on Open Source code
  6. 6. Volodymyrk Data Visualisation Libraries in Python 1986 - GNU Plot 2003 - Matplotlib (14 years ago!) 2012 - Bokeh 2012 - Seaborn 2014 - Plotly.py June 2017 - Dash 7
  7. 7. Volodymyrk What are we trying to solve? Master Dashboard - External or internal clients - Lot’s of interactivity - Complex Layout 8 Analytics Portal - Lots of Dashboards - Many are similar - Interactive filters/selectors Report Generator - Produces HTML report - Based on inputs Interactivity/ Exploration Pre-made choices
  8. 8. Volodymyrk Option-1: Tableau ● Also Looker, Periscope, Superset, Qlick, Mode, Redash.. ● If existing functionality is enough ● If you don’t need to automate the creation ● If “creator and owner” of those dashboards is a Business Data Analyst (e.g. not code-savvy data scientist) 9
  9. 9. Volodymyrk Option-2: R-Shiny + Mature + Backed by RStudio (commercial company) + Looks good - R 10
  10. 10. Volodymyrk Option-3: Python back-end, JavaScript front-end + No middleman between browser code and you + Mature ecosystem - Too complex for a regular Data Scientist 11 Web Framework: Flask, Django, Tornado, etc. Data Layer: Numpy, Pandas, Scipy, etc HTML+JS: D3.js, NVD3, HighCharts, Plotly etc.
  11. 11. Volodymyrk Option-4: Bokeh Server ● Best-kept secret in Python Data Ecosystem ● Custom JavaScript library (Bokeh.js) ● Uses HTML Canvas (or WebGL) ● Historically used CoffeeScript 12
  12. 12. Volodymyrk Bokeh Server Bokeh.js: - Html Canvas, lots of custom JS code Bokeh Widgets: - Lots of custom code - Hard to style Bokeh Server: - Based on Tornado - Stateful 13 Plotly Dashvs. Plotly.js - Based on D3.js Dash Components: - All normal HTML components in Dash - Build on top of React! Plotly Server: - Just Flask - Stateless
  13. 13. Volodymyrk Bokeh Server Bokeh.js: - Html Canvas, lots of custom JS code Bokeh Widgets: - Lots of custom code - Hard to style Bokeh Server: - Based on Tornado - Stateful 14 Plotly Dashvs. Plotly.js - Based on D3.js Dash Components: - All normal HTML components in Dash - Build on top of React! Plotly Server: - Just Flask - Stateless
  14. 14. Volodymyrk Option-6: Jupyter Dashboards + Easy to build - Layouts/callbacks/interactivity is limited - Not suitable for building “client-facing” apps 15
  15. 15. Volodymyrk FrontEnd: D3, Plotly.js Highchart BackEnd: Python, Java In summary 16 Exploration Product For SalePrototype/Quick App Jupyter Notebook (Local) Tableau Excel Jupyter Dashboard Internal Data Product Tableau Server RShiny Bokeh Server Plotly Dash
  16. 16. Live Demo-2
  17. 17. Volodymyrk Case Study You just get the best job in the galaxy
  18. 18. Volodymyrk 19 Your new Boss Business domain Business case I love synthetic data
  19. 19. Volodymyrk 20 Class-1 Class-2 Class-3 Class-5 http://starwars.wikia.com/wiki/Droid
  20. 20. Volodymyrk Jabba’s Used Droid business 21 Multi Dimensional Event-level Time Series
  21. 21. Volodymyrk 22
  22. 22. Tips and Tricks
  23. 23. Volodymyrk Tip-1: truly data-driven apps - Dynamic, data-driven, layout Def build_layout(..): app.layout = build_layout 24 - Need to pre-define all callbacks app.config.supress_callback_exceptions = True
  24. 24. Volodymyrk Tip-2: Caching - App is Stateless! 25
  25. 25. Volodymyrk Tip-3: Production Deployment dash-project/ app1/ app.py datamodel.py app2/ app.py datamodel.py mycomponents/ ... server.py Run.py uwsgi .. --wsgi-file run.py https://community.plot.ly/t/multiple-dashboards/4656 26 Monolithic App UWSGI Emperor Mode Similar structure, but we are not there yet..
  26. 26. Volodymyrk Tip 4: Where to get help? Don’t use StackOverflow yet.. however there is a #plotly-dash tag already Official forum: https://community.plot.ly/c/dash 27
  27. 27. ● Data Scientist ● Senior Data Scientist ● Data Engineer ● Data Engineer (intern/student) ● Game Design, Art, UX ● Product Marketer ● Game devs (Unity and iOS) ● Product Manager, Live Operations ● Senior Product Manager (x3) ● And many more! . . . check out jobs.wooga.com is HIRING! jobs.wooga.com
  28. 28. Volodymyrk Appendix 29
  29. 29. Product Analytics Data Science Data Engineering Analytics is not a team, but describes the way Wooga approaches decisions Dashboards AB Tests Game Balancing Ad-hoc Insights Business reviews Deep-dive Analysis Machine Learning Data Processing: Airflow Data Pipeline: Kafka, Exasol Data Access: Periscope, Jupyter In-house Tools Infrastructure: kubernetes Stats ModellingBusiness modelling
  30. 30. Our Tech Stack Airflow Magic 8 Ball Predictive Analytics Research Dashboards & Data Viz.

×