What is Bokeh?
Bokeh is a Python library for interactive visualization. It uses the web browser to render the visualizations.
Why use Bokeh?
Bokeh's approach helps develop scalable, interactive data science tools with minimal graphic user interface (GUI) dependencies. It also fits with the 'browser is the computer' application development philosophy at Moad Computer. Since our goal at Moad Computer is to develop scalable data science applications within the comfort, safety and familiarity of a web browser, Bokeh fits very nicely into our development workflow.
What is this Bokeh cheat sheet for?
This cheat sheet is aimed at developers looking to deploy Bokeh either locally or in a cloud server.
"Remember this rule: intuition cannot be trusted in the absence of stable regularities in the environment."
In this very first Actionable Insights blog piece, we are bringing you a very topical content. This article is about the ongoing COVID19 pandemic and how we built a simple, yet effective visualization tool. In this example, we are using the COVID19 outbreak public data from India. The data is aggregated from the Ministry of Health and Family Welfare (MoHFW), Government of India website, that publishes daily statistics about the COVID19 outbreak in the country.
We picked the India data because of its importance in fighting to overcome this pandemic. India is the second most populous country in the world, home to 1.34 billion people. In this visualization tool, we are overlaying the state-wise data onto a country map, providing a quick visual summary of the pandemic. The state-wise hover panels provide a great interactive mechanism for users interested in learning more about the data. By using the power of colors and visual summaries, we wanted to tell the story of how this disease is affecting the country, without overwhelming the users with a lot of information in one go.
There is a basic mode and a forecast mode in the visualization tool. The basic visualization mode displays the sate-wise COVID19 cases and deaths. It is the default mode when the visualization tool is newly loaded. The forecasting visualization can be activated using the 'Forecast' tab in the tool. In the forecasting visualization, the hovering information panel shows the state-wise case forecasts, for three time periods: a day (+1 day) ahead, three days (+3 days) ahead and a week (+7 days) ahead. The case forecasting model is developed using the historic data of the COVID19 outbreak. The forecasting model also incorporates state-wise: population, total land area, nominal gross domestic product (GDP) per-capita and human development index (HDI).
Algorithm used here for the forecasting combines Bayesian statistics with an ensemble deep neural network. It is trained daily on the historic COVID19 India data. Our Bayesian statistical forecasting approach generates a range of predictions, instead of a typical point prediction generated by a traditional (non Bayesian) deep neural network. Using these range of predictions, we are also quantifying the algorithmic uncertainties associated with each forecast.
The training process of the forecasting algorithm is designed to 'look ahead' 'n' number of days. Using the trained model weights and the latest MoHFW COVID19 data, the state-wise case forecasts are generated and updated daily. We are currently training to forecast cases for three 'look ahead' periods: a day in advance (+1 day), three days in advance (+3 days) and a week in advance (+7 days). The state-wise case forecast uncertainty is reported in the form of standard deviation (±) in the hover panel. Quality of the state-wise forecasting is also evaluated daily using the mean absolute percentage error (MAPE) metric. The state-wise forecasting MAPE can be accessed using the 'Forecast quality' tab in the visualization tool. A lower MAPE means smaller errors were made while forecasting cases, which in-turn translates into a better performing forecasting model.
A key motivation behind the development of this tool is the quote by Daniel Kahneman, the Nobel prize winning economist, at the beginning of this article. In this unprecedented crisis of the COVID19 pandemic, where everything is new, irregular and chaotic, intuitive thinking can often be counter-productive. With the help of data, visual story telling and predictive modeling, we want to help individuals and organizations make better decisions, that rely less on intuition and more on deliberate thinking and evidence.
Significantly, our mission is to help individuals and organizations with better resource management and in reducing some of the societal impact of COVID19. Our approach of case forecasting can help guide a systematic strategy to restore normalcy. With the help of an easy to understand interface, we managed to improve the accessibility of our advanced forecasting techniques to a wider non-technical audience.