Interactive Dashboard

The python visualisation landscape is rich and diverse. But also, given the diversity of the tools - it is hard for vis libraries, it has a lot of challenges in learning libraries and varying degree of maturity for the tools.

See this PyCon 2017 Talk from JakeVandeplas on the Landscape

We will use a tool called facet-dive for multidimensional exploration of data

Facet-Dive: Interactive Exploration of Data and Classification

Installation Instruction:

git clone https://github.com/PAIR-code/facets
cd facets
conda install protobuf
jupyter notebook --NotebookApp.iopub_data_rate_limit=10000000

In [7]:
import pandas as pd

In [10]:
df = pd.read_csv("../data/default.csv")

In [11]:
df.head()


Out[11]:
default amount grade years ownership income age y_pred y_proba
0 0 1000 B 2.0 RENT 19200.0 24 0 0.15
1 1 6500 A 2.0 MORTGAGE 66000.0 28 1 0.80
2 0 2400 A 2.0 RENT 60000.0 36 0 0.08
3 0 10000 C 3.0 RENT 62000.0 24 0 0.05
4 1 4000 C 2.0 RENT 20000.0 28 1 0.82

In [18]:
jsonstr = df.to_json(orient='records')

In [20]:
# Display the Dive visualization for this data
from IPython.core.display import display, HTML

HTML_TEMPLATE = """<link rel="import" href="/nbextensions/facets-dist/facets-jupyter.html">
        <facets-dive id="elem" height="600"></facets-dive>
        <script>
          var data = {jsonstr};
          document.querySelector("#elem").data = data;
        </script>"""
html = HTML_TEMPLATE.format(jsonstr=jsonstr)
display(HTML(html))



In [ ]: