This is the first in a series of articles that explains some of the basic concepts behind data science. Everyone has heard the terms AI, ML, big data, algorithms ad nauseum. These articles attempts to bridge the divide between data scientists and the non-technical people who are working alongside them.

What is the point of data science?

Broadly, to extract useful knowledge from data.

Haven’t we always been doing that?

Yes, but we have a lot more data and far superior storage, processing, and networking power than ever before. Essentially, it has never been cheaper to analyze ever more data.

A few side notes about those tasks we talked about in Part I, the steps in the data mining process, and then data-related terms that often overlap with data mining. In Part III, we start getting into the meat of data mining tasks.

The tasks fall into one of two categories — supervised or unsupervised.

A task is supervised when we are trying to find out the value of a target variable. So, to continue with the telecom customer example, let’s say we want to find out whether a customer will respond to a marketing offer or not. The target variable is Will Respond and it’s possible values are Yes or No…

Or, how to make a basic pie chart?

Sometimes a line chart or pie chart can represent underlying data more effectively than the basic bar charts or scatter plots. The d3-shape library was developed to create these — seemingly basic but actually quite tedious-to-code-manually — visualizations.

This blog breaks down the part of the d3-shape API used to create pie charts or donut charts, d3.pie() , also known as pie() for the rest of this blog. If you want to know how to set up d3, please see earlier blog:

Goal of this tutorial, the El-Dorado, if you will.

What makes a pie chart a pie chart?

Regardless of the medium, all pie or donut charts require the same basic elements:

  1. A circle divided into…

This tutorial picks up from a previous tutorial. As a reminder, this is what the data structure looks like:

Poverty Rate is the y-axis value and the indicator in the last column is the x-axis value and changes with each dataset.

In the previous tutorial, we changed the Province value but in this tutorial, we will update the Year. (All code on Github and demo available here). …

Micro, Small and Medium Enterprises (MSME) are crucial drivers of the global economy; they make up at least 90% of all businesses and half of all jobs globally. Further, MSMEs contribute up to 40% of GDP in emerging economies. Since the pandemic began, however, many MSMEs have paused operations as mandated by government rules for non-essential enterprises. This widespread shutdown of economic activity has contributed to four out of every five workers experiencing some form of unemployment, according to estimates from the International Labour Organization. …

This tutorial explains how to add interactivity to a scatter-plot that was built in an earlier tutorial. As a reminder, this is what the data structure looks like:

Poverty Rate is the y-axis value and the indicator in the last column is the x-axis value and changes with each dataset.

This tutorial will explain how to update Province. The final code can be viewed here.

There are two important aspects in building user interactivity:

  1. Capturing the user’s choice.
  2. Updating the page based on user’s choice.

As a reminder, the focus of this tutorial is d3.js so coverage of other topics will be minimal.

Capturing The User’s Choice

  • Add a select HTML tag with options for each of the province names and one for “All Provinces”.

Recently, the Government of Pakistan published a handy dataset of poverty and development indicators ready to download as an Excel file. I used it to practice my d3 skills and built a simple, interactive scatter-plot.

This blog outlines the steps to build a static version of this data visualization. It assumes a basic knowledge of HTML, CSS, JS and the ability to run a simple local server. I use Python’s http.server but feel free to use whatever you are most comfortable with. In a future blog, I will explain how to make this interactive.

Feel free to download the original

Sabahat Iqbal

International Dev | Tech4Dev | Open Data | Data Viz

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store