How to Create an Interactive Dash Web Application

Using Dash, Heroku, XGBoost and Pickling to Create a Predictive Web App

Jim King
7 min readDec 9, 2019

--

You’ve done the data science, now you need to present the results to the world! Dash is a python framework for building web applications. Written on top of Flask, Plotly.js and React.js, Dash is well-suited for quickly building customized web applications. Once built, the web application can easily be deployed on a cloud platform such as Heroku.

Let’s start with the final product. The simple web app below enables the user to determine the predicted price to pay for a home facing a bidding a war. The predicted price is based on historical data from 2015–2019 for all single-family homes sold in Marin County, CA receiving two or more offers. The user can select the area, number of bedrooms, number of baths, number of expected offers and listing price and the app will provide the predicted sales price.

To use the web app simply select the Predict tab, select the criteria and the app will return the predicted offer price. For an explanation of the goals, data, evaluation protocol and model selection use the Explain tab. The Evaluation tab provides metrics used to evaluate the accuracy of the predictions versus the actual winning offers.

Interactive Web App for Predicting the Winning Price in a Bidding War

If you’d like to understand how to develop your own interactive web app follow along as I step you through the process.

A Word About the Code

All the code, data and associated files for the project can be accessed at my GitHub. After installing Dash, run the code on your local computer from the the directory the code resides in and from your terminal run python app.py. This will run the app on your local host (127.0.0.1:8050).

The Data Science

As this article is focused on the creation of an interactive web app, I will briefly describe the data science used to predict the optimal bid price. For details take a look at the colab notebook here.

The raw data is historical data from 2015–2019 for all single-family homes sold in Marin County, CA receiving two or more offers. After importing the raw data…

--

--

I’m an aspiring data scientist with a background in software development and real estate.