Using web apps to share your work with the world

Categories: Big Data & AnalyticsTechnology

October began on a high note for the data science team within GL, after attending the Shiny in Production conference organised by JumpingRivers. After a long time spent socially distancing and usually joining data science events remotely, it was a welcome change to finally interact with like-minded data enthusiasts in person!

What even is Shiny, you may ask? It is a web app tool intended (mainly) for R developers, however it has recently expanded into Python. Shiny (and a host of similar tools) can be used to showcase data science & analytics insights to an end user, who may for instance be interested in interactively exploring some data in graphical or tabular format, understanding model forecasts and basing their next best actions on them, or rerunning scheduled tasks and outputs in order to assess status changes across the business, and more.

The conference programme included talks on such diverse topics as: the dangers of including (excessive) widgets in your web app, the flexibility of Shiny apps in R which (among other things) allow you to incorporate Python and JavaScript code as well, on demand simulations of virtual patient populations for clinical applications, surfacing large amounts of IoT/sensor data efficiently using Raspberry Pi and Arrow, best practices (and pitfalls!) of using Docker with your Shiny app, customising native JavaScript data visualisation tools, porting them into R and then Shiny, streamlining your app’s code by offloading lengthy data manipulations via RStudio Connect and the {pins} R package (while also making the Shiny app more robust).

My talk: Journey through a landscape of options: Choosing among web app frameworks for your project

The talk I contributed to this excellent line-up provided app developers a way to navigate the vast landscape of interactive tools (of which Shiny is only one). Data scientists (and other developers) may often find themselves pressed for time – hence it could be challenging to pause more urgent work just to explore what other options may be available. To support this issue, I’ve illustrated /compared various app frameworks by building the same solution across the different frameworks: Shiny, Streamlit, Dash and Gradio. This solution hinged on a fictitious project brief from the area of Energy and Utilities (based on a subset of the NEED dataset).

The resulting apps needed:

  • To allow users to toggle various menus (i.e., filter the data by the type of energy concerned: gas/electricity, as well as the UK region shown), 
  • To compute a forecast based on the user’s selections (a model predicting energy usage for the next 2 years),
  • To output a graph to visualise the forecast that was generated. By keeping thesethree aims constant, this allowed me to highlight some differences between the alternative frameworks themselves.

If you would like to check the fine details about what this comparative exercise revealed, you can find my slides here, and my example code here.

Guidelines for use

However (and without creating any hard and fast rules which often do not work in data science), I can offer a few broad guidelines, which include: the choice of framework will depend on the maturity of your project (for example Gradio lends itself naturally to POCs for ML models, whereas Shiny and Dash allow much finer control for more advanced projects); also, the relative strengths of each ecosystem may guide which one you tap into, e.g., Shiny in R may be a better choice for statistical projects, whereas something like Streamlit could easily make use of Python’s Machine Learning capabilities. Of course, this does not mean that ML is an unusual occurrence in R, but it is a useful conceptual division which can help you decide on a tool to pursue. For further nuances, do check out my recorded talk.

Attending and presenting at Shiny in Production was a really rewarding experience for me. The curated content was technically enriching and delivered to a high standard by all the speakers, while the opportunities for networking were ample within a very welcoming and relaxed data science crowd. I am of course really looking forward to next year’s iteration! 

Little bit about the author:

Caterina is a Psychology PhD and data scientist with varied interests and expertise across areas such as research methods, data analysis, data visualisation and manipulation. She has used these skills across a variety of domains, from national health data, online retail, occupational therapy, transport, data for good and tourism to financial sector data.



Caterina Constantinescu

Principal Consultant

View all Articles

Top Insights

Manchester City Scores Big with GlobalLogic

Manchester City Scores Big with GlobalLogic

AI and MLBig Data & AnalyticsCloudDigital TransformationExperience DesignMobilitySecurityMedia
Twitter users urged to trigger SARs against energy companies

Twitter users urged to trigger SARs against energy...

Big Data & AnalyticsDigital TransformationInnovation
Retail After COVID-19: How Innovation is Powering the New Normal

Retail After COVID-19: How Innovation is Powering the...

Digital TransformationInsightsConsumer and Retail

Top Authors

Mark Norkin

Mark Norkin

Consultant, Engineering

Sujatha Malik

Sujatha Malik

Principal Architect

Juan Rella

Juan Rella

Solution Architect, Technology

Top Insights Categories

  • URL copied!