Helping Your Kids Think Like Data Scientists
By: Nick Sokol
Tags: Regression, Clustering, Children, Teaching, Youth

Helping Your Kids Think Like Data Scientists

The future of data science rests with the next generation. While many tools within the data science toolbox are complex and far above the understanding of most children, there are ways we can begin to entrench data science thinking, methodologies, and practices in our youth today. This is advantageous, as it helps children develop critical thinking skills at an early age. However, the difficulty with doing this is that many children dislike looking at numbers all day, and even more, trying to instill an understanding of linear regression or clustering in a mathematical or philosophical sense can be outright impossible. With a little creativity, it is possible to mitigate the difficulties of teaching data science principles and I have decided to share some of my own methodologies for doing this below.

Linear Regression Made Easy

Linear regression is a technique that is used to model the relationship between two variables. It is both simple and complex at the same time. Simple because its application and mathematical formulation are easy to express. Complex because there are many rules that dictate if you are applying linear regression correctly.

Y = a + bX

Where a is the intercept (the value of y when x = 0), b is referred to as the slope of the line (or the amount of change expected in one step of the line), X is your independent variable (also called “explanatory variable”), and Y is your dependent variable (what you are measuring). In common tongue, this is best described as: “What is the relationship of Y on X given our total knowledge of a particular event.” Regression is useful for estimating future values as well. If your relationship is very good you can continue building your line beyond your known data. While this method may seem simple, the above information is not easy for children to digest.

However, here is one way of explaining linear regression in a non-quantitative and hands on way that I have devised and the steps are listed here:

Grab a sheet of paper and three to four different color pens, crayons, or markers (you can add more colors if you want to increase the difficulty). On that sheet of paper draw an X and Y axis (you can label them as I have in figure 1).

Figure 1. Example setup for the activity showing XY lines, and points to graph on it (Image made by author).

Now you can ask your data science pupil to plot a line from one end of the graph to the other while capturing the most points of the same color on one line (see figure 2 for an example). Ask them to describe if the change (relationship) was negative or positive, then you can ask them to calculate how much of the change occurred over the points. For fun, you can have them count out the number of points not on the line and how far away each point is on the graph.

Figure 2. Example of line plotted through the points to illustrate the relationship between our two variables (image made by author).

This technique may take quite a bit of time for very young learners to get correct, but it is a fun way to learn. After all, they are merely drawing lines on top of a bunch of points! To mix things up you can have them change from a straight line to a curved line (curvilinear regression). The takeaways from this exercise should be the identification of patterns within the points, accuracy in plotting a line and capturing the most number of points, and understanding how other points that are nowhere near the line still impact the overall result.

Clustering Made Easy

Now onto clustering. There are several clustering methods. K-means clustering, ward’s hierarchical agglomerative clustering, density based clustering methods, nearest neighbor, the list goes on and on. While they may seem expansive and complex, all of these methods have one goal and that is grouping information based on similar characteristics within a given data set. I personally believe the easiest to teach is nearest neighbor clustering as it assumes that values nearby are more likely to be alike than those farther apart. K-means clustering is probably my second favorite to teach as it highlights making clusters based on similarities around means (so 5 groups each with their own “centroid” or grouping value and all values similar to it are placed within that group).

Here is an easy activity to help teach both nearest neighbor clustering and k-means clustering. It’s probably best to use a dry erase board or an electronic tablet with a stylus for this one, but paper and pen work well too.

Using 4 or 5 different colors draw as many points as you like on a sheet of paper. You should try to keep the number of points across each color the same or have two groups with one or two more (e.g. 6 red points, 5 blue points, 4 green points, 3 purple points; see figure 3).

Figure 3. An example of how you may consider randomly distributing your points on a piece of paper (Image made by author).