Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Data Science en production avec R — Quels enjeux ? Quelles solutions?

Colin Fay
November 05, 2018

Data Science en production avec R — Quels enjeux ? Quelles solutions?

Intervention au Meetup Lyon Data Science

Colin Fay

November 05, 2018
Tweet

More Decks by Colin Fay

Other Decks in Programming

Transcript

  1. Data Science en production avec R
    Quels enjeux ? Quelles solutions?
    Colin FAY - ThinkR
    2018-11-05
    Colin Fay, ThinkR - http://thinkr.fr 1 / 34

    View Slide

  2. $ whoami
    Colin FAY
    Data Scientist & R-Hacker chez ThinkR, agence spécialisée en Data Science et en
    langage R.
    Cofondateur du Breizh Data Club, et fondateur de Data-Bzh.
    http://thinkr.fr
    http://breizhdataclub.org
    http://data-bzh.fr
    http://twitter.com/_colinfay
    http://github.com/colinfay
    Colin Fay, ThinkR - http://thinkr.fr 2 / 34

    View Slide

  3. ThinkR
    Colin Fay, ThinkR - http://thinkr.fr 3 / 34

    View Slide

  4. Agence d'expert en Data Science et en
    langage R
    Formation
    Analyse
    Développement
    Consulting
    ThinkR
    Colin Fay, ThinkR - http://thinkr.fr 4 / 34

    View Slide

  5. C'est quoi R ?
    Colin Fay, ThinkR - http://thinkr.fr 5 / 34

    View Slide

  6. Langage de programmation, lingua
    franca de la Data Science
    Open Source
    Gratuit
    Multiplateforme
    Modulable
    C'est quoi R ?
    Colin Fay, ThinkR - http://thinkr.fr 6 / 34

    View Slide

  7. R en prod
    Colin Fay, ThinkR - http://thinkr.fr 7 / 34

    View Slide

  8. Facebook
    Google
    Twitter
    Microsoft
    Uber
    Airbnb
    IBM
    Ford
    Capgemini
    Deloitte Consulting
    Gartner
    KPMG
    Un usage en entreprise
    Source : http://www.listendata.com/2016/12/companies-using-r.html
    Et en France ?
    EDF, BNP Paribas, SNCF, Sanofi, RTE, Servier, Orange, Axa, INSEE, Ipsos, Banque de
    France, CNRS...
    Colin Fay, ThinkR - http://thinkr.fr 8 / 34

    View Slide

  9. R en prod, quels enjeux ?
    Utilisabilité
    Accessibilité
    Scalabilité
    Interopérabilité
    Maintainabilité
    Colin Fay, ThinkR - http://thinkr.fr 9 / 34

    View Slide

  10. R en prod, l'enjeu n°1
    Colin Fay, ThinkR - http://thinkr.fr 10 / 34

    View Slide

  11. From CLI...
    Colin Fay, ThinkR - http://thinkr.fr 11 / 34

    View Slide

  12. Colin Fay, ThinkR - http://thinkr.fr 12 / 34

    View Slide

  13. ... to IDE ...
    Colin Fay, ThinkR - http://thinkr.fr 13 / 34

    View Slide

  14. Colin Fay, ThinkR - http://thinkr.fr 14 / 34

    View Slide

  15. ... to UI
    De la ligne de commande à l'interface utilisateur.
    => Applications web avec Shiny
    Colin Fay, ThinkR - http://thinkr.fr 15 / 34

    View Slide

  16. Colin Fay, ThinkR - http://thinkr.fr 16 / 34

    View Slide

  17. Shiny
    Produit rstudio
    Facile d'utilisation (enfin, relativement)
    Arrivé dans le monde R en 2012
    Omniprésent dans les conférences et les meetups R
    Colin va nous montrer des exemples
    Colin Fay, ThinkR - http://thinkr.fr 17 / 34

    View Slide

  18. D'autres exemples
    Gallerie Shiny: https://shiny.rstudio.com/gallery/
    Show Me Shiny https://www.showmeshiny.com
    Shiny showcase https://www.rstudio.com/products/shiny/shiny-user-showcase/
    Colin Fay, ThinkR - http://thinkr.fr 18 / 34

    View Slide

  19. Problème
    Colin Fay, ThinkR - http://thinkr.fr 19 / 34

    View Slide

  20. Rendre le code rapide
    Rendre le code accessible
    Rendre le code maintenable
    => Passer de la R&D à la production
    => D'une app "qui marche sur sa
    machine" à la production
    Scalabilité
    Colin Fay, ThinkR - http://thinkr.fr 20 / 34

    View Slide

  21. Problème
    R est 'single-threaded'
    Solution
    Programmation asynchrone.
    {future} & {promises}
    Programmation asynchrone
    Colin Fay, ThinkR - http://thinkr.fr 21 / 34

    View Slide

  22. JavaScript
    Colin Fay, ThinkR - http://thinkr.fr 22 / 34

    View Slide

  23. Logiciel libre récent (2013)
    Empaqueter une application et ses
    dépendances dans un conteneur
    isolé
    Déployable "partout" (sur sa
    machine, sur un serveur local, sur le
    cloud...)
    => Adieu "Works on my machine"
    Docker
    Colin Fay, ThinkR - http://thinkr.fr 23 / 34

    View Slide

  24. Shiny Proxy
    Une app shiny == une image
    Un visiteur == un containeur
    Colin Fay, ThinkR - http://thinkr.fr 24 / 34

    View Slide

  25. Colin Fay, ThinkR - http://thinkr.fr 25 / 34

    View Slide

  26. Publication en clic-boutton
    Colin Fay, ThinkR - http://thinkr.fr 26 / 34

    View Slide

  27. Shiny Server
    Colin Fay, ThinkR - http://thinkr.fr 27 / 34

    View Slide

  28. RStudio Connect
    Colin Fay, ThinkR - http://thinkr.fr 28 / 34

    View Slide

  29. RStudio Connect
    Colin Fay, ThinkR - http://thinkr.fr 29 / 34

    View Slide

  30. API REST exécutant du R
    Requêtes http
    Format "lisible" par d'autres
    langages
    Interopérabilité - R via API
    Colin Fay, ThinkR - http://thinkr.fr 30 / 34

    View Slide

  31. Maintainabilité
    Gestion des dépendances
    Colin Fay, ThinkR - http://thinkr.fr 31 / 34

    View Slide

  32. RSPM
    Colin Fay, ThinkR - http://thinkr.fr 32 / 34

    View Slide

  33. RSPM
    install.packages(
    "pkgtest",
    repos = "http:////latest",
    type = "source"
    )
    Colin Fay, ThinkR - http://thinkr.fr 33 / 34

    View Slide

  34. [email protected]
    http://twitter.com/_colinfay
    http://twitter.com/thinkr_fr
    https://github.com/ColinFay
    https://thinkr.fr/
    http://colinfay.me/
    breizhdataclub.org/
    Merci !
    Colin Fay
    Colin Fay, ThinkR - http://thinkr.fr 34 / 34

    View Slide