githubEdit

1Superset

This page documents the Superset step in our Proof of Concept (PoC), which consists of exploring the data through the creation of visual interactive displays.

circle-check

Initial steps

  1. Importing the paris.db

Once you are connected and have access to the Superset dashboard, the next step is uploading the PARIS database. First, you need to download this ready-to-use examples database: linkarrow-up-right. Second, click on Settings, then Database Connections, and click the + DATABASE button in the top right. In the "Choose a database" modal, select SQLite. Enter the SQLAlchemy URI using the path to the paris.db file. The path must be prefixed by sqlite:/// for Windows users and by sqlite://// for MacOS and Linux users. For example:

  • MacOS/Ubuntu : sqlite:////Users/Download/paris.db

  • Windows : sqlite:///C:\Users\Downloads\paris.db

All the steps are summarized in the figures below:

Fig 1 - Step 1: open database connections
Step 1: Click the + DATABASE button in the top right
Step 2: Select database type
Step 3: Set database path and conenct it
  1. Creating the PARIS dataset

Importing the paris.db The file does not automatically create the PARIS dataset in your Superset; you need to do it manually. First, go to the Datasets tab, and click the + Dataset button in the top right. Then select SQLite as the DATABASE, main as the SCHEMA, and PARIS_SYNTH as the TABLE. The steps are summarized in the following figure:

Imporing the PARIS table

Data visualization

Charts Creation

Once your PARIS table is imported, you can choose to create from a variety of charts. For example, we can create a pie chart to visualize differences in sex among our questionnaire participants. The figure below shows the steps to follow:

Fig 8 - Create a new pie chart

After creating the chart, we will select the information we would like to visualize. To do so, look up the column Sex and drag it to the Dimension box. Second, in the metric box, select the metric to display (COUNT). Finally, hit "Create Chart" to generate the chart, which should appear to the right of your screen. Once you're satisfied with your final chart, you can click "SAVE" to save it and add it to a dashboard.

Fig 9 - Create a Pie Chart for Sex distribution

In this proof of concept, we suggest the creation of three charts, using the following configurations to create each one of them:

  • Total number of participants chart:

    • Chart's type: BIG NUMBER

    • Metric: COUNT

Fig 10 - Defining total number of participants chat's settings
  • Age Distribution chart:

    • Chart's type: BAR CHART

    • X-Axis: Age

    • Metric: COUNT

Fig 12 - Defining the age distribution chat's settings

Dashboards Creation

The Superset dashboards are interactive visual data displays, created using the Superset charts. Therefore, the charts made in the previous section can be utilized to create a single dashboard to interact with our data, monitoring key metrics, statistics, etc. To create a dashboard, follow the steps laid out in the figure below:

Fig 13 - Creating a Superset Dashboard and adding charts to it

Final dashboard

heart

Do not hesitate to create a more beautiful dashboard!

Once all your charts have been imported and organized in your dashboard, you should have a similar result:

Fig 14 - PARIS final dashboard

Using Filters

In Superset dashboards, you can use filters to explore data dynamically. They enable users to explore data displayed based on a specific criterion, metric, etc., without modifying the underlying queries.

Part of this POC is the application of filters to our final dashboard, to help display data according to predefined criteria. To do so, follow the instructions laid out below:

Fig 15 - How to implement new filters into your dashboard

You now have a functioning interactive dashboard to explore your questionnaire data. Feel free to add new charts, filters, or create new dashboards.

Superset has many useful tools that cannot all be covered in this proof of concept. Therefore, we recommend checking the Superset's documentationarrow-up-right for more insights on how to use this tool to explore your dataset.

Export data to workspace

circle-info

Skip this step if you are using synthetic data.

In this last step, we will use Superset to export the data needed for the rest of the PoC to our workspace. First, in the Superset's SQL Lab, run the following command (see figure below):

Before clicking run, change the row limit according to your dataset's size. Once the query is executed, you can click Download to CSV and save the retrieved data to your DATA folder under your Workspace (we recommend using the name PARIS_ML.csv for the sake of consistency with the rest of the steps). Finally, refresh your workspace and ensure your file is there. The instructions are summarized in the following figure:

Fig 16 - How to export your dataset as a CSV file

This concludes the first step of this PoC. In the next one, we will dive deeper into the exploration of the dataset using the Exploratory Module.

Last updated