Demo AI Solutions with Shiny

Deliver data science solutions in a cool and visual way

Photo by Filip Varga on Unsplash

One of the most important skills for any data scientist is the ability to clearly communicate and deploy results to a general audience. These are the people who need to understand the insights in order to take further action. Unfortunately, too many data science projects bog down in math and computation that is difficult to understand for the general reader. This is why tools like Shiny are quickly becoming every data scientist’s best friend.

Shiny

Shiny is an R package for developing interactive web apps. A few of its benefits:

Diversity. You can communicate results via interactive charts, visualizations, text, or tables. Ease-of-use. If you already know R, you can rapidly develop a cool Shiny app. Check out this excellent tutorial to quickly learn the core concepts. Share-ability. Built-in capabilities let you share your work easily with colleagues and friends. Design. Even the default display for Shiny apps is elegant and intuitive.

To convince you, let me show you two examples. To run these examples on your own, check out these instructions.

Car accident predictions based on weather

To predict car accidents in New York City, my team and I built a model that we trained on historical data of car accidents as well as IBM’s weather data. We used weather conditions per zip code as features to train a logistic regression with Spark that outputs the probability of car accidents for specific areas, dates, and times. Here’s a screenshot of the Shiny app that displays the results within an interactive map:

Probability of Accident by Zip Code Given Date and Time

Planning your next vacation

I decided to keep experimenting with travel data, but jumped from cars to planes. Specifically, I decided to build a Shiny app that lets users explore the average flight arrival delays (in minutes) for each airport in the US. Interactive features let users explore the predictions by month and year, and let users view additional data like the airport name, code, state, city and average delay. In the screenshot below, the size of the bubbles correlates to the volume of flights for each airport. A negative average delay indicates that flights typically arrive ahead of schedule.

Flight Arrival Delays

Would you like to build your own Shiny app?

Those are just two projects that Shiny helped us bring to bear. And we’ve got more in the pipeline, which I’ll share soon. In the meantime, I encourage you to jump in. Again, follow these instructions to run the Shiny examples.