Students deepen their understanding of Table Plans, learning how to write a good sample table. They also choose their own datasets, and explore them by writing filters and column builders using the Design Recipe.
Students use Table Plans to answer questions using pie and bar charts
Students choose a dataset they are interested in
Standards and Evidence Statements:
Standards with prefix BS are specific to Bootstrap; others are from the Common Core. Mouse over each standard to see its corresponding evidence statements. Our Standards Document shows which units cover each standard.
BS-DR.1: The student is able to translate a word problem into a Contract and Purpose Statement
BS-DR.2: The student can derive test cases for a given contract and purpose statement
BS-PL.3: The student is able to use the syntax of the programming language to define values and functions
Length: 95 Minutes
Glossary:
bar chart: a visualization in which a data set is represented by vertical bars, with length proportional to values
pie chart: A chart where the size of each pie slice corresponds to a value in the data set
Open your "Animals Dataset (w/Functions)" file. (If you do not have this file, or if something has happened to it, you can always make a new copy.)
Look at the pie and bar charts on Page 21, and write down what you notice and wonder. Why are some questions easier to answer with one kind of chart or another?
Have students share back. Encourage students to read their observations aloud, to make sure they get practice saying and hearing these observations.
You’ve now seen two kinds of charts for visualizing quantity: bar charts and pie charts. Both charts involve quantities and labels: each bar and slice is a measure of a quantitative column, and each one has a label. Both charts help us look at the whole dataset at once, and answer questions about quantity. As you’ve observed, bar charts are great when we want to know exactly "how much" of a thing is contained in a single row. Pie charts, on the other hand, are best when we want to know "what percent" of the thing in our table is contained in a single row.
Table Plan
Overview
Learning Objectives
Evidence Statementes
Product Outcomes
Students use Table Plans to answer questions using pie and bar charts
Materials
Preparation
Table Plan(Time 20 minutes)
Table PlanSample Tables are about a lot more than checking our work. Data Analysis is often used to make predictions, and if the sample dataset is bad those predictions can be wrong - and sometimes, really really wrong!
Uber and Google are making self-driving cars, which use artificial intelligence to interpret sensor data and make predictions about whether a car should speed up, slow down, or slam on the breaks. This AI is trained on a lot of sample data, which it learns from. What might be the problem if the sample data only included roads in California?
Law enforcement in many towns has started using facial-recognition software to automatically detect whether someone has a warrant out for their arrest. A lot of facial-recognition software, however, has been trained on sample data containing mostly white faces. As a result, it has gotten really good at telling white people apart, but often can’t tell the difference between people who aren’t white. Why might this be a problem?
Sample Data Mattters!
Even for simple analysis, it is critical to think carefully about the sample tables you use.
Up to now, the Sample Table has been provided for you. But for our next Table Plan, you’ll need to make one of your own! A good Sample Table should have:
At least the columns that matter - whether we’ll be ordering or filtering by those columns.
A good Sample Table has enough rows to be a representative sample of the dataset. If our dataset has a mix of dogs and cats, for example, we want at least one of each in this table.
A good Sample Table has rows in random order, so that we’ll notice if we need to order the table or not.
It will take some practice for you to get good at making Sample Tables, but you can start by identifying bad ones! turn to Page 22, and write down what’s wrong with each of these tables.
If you’re teaching a math or statistics class, go deeper to discuss sampling techniques and sample errors.
Can you come up with a good sample table of your own?
Turn to Page 23. Here is a mostly-complete Table Plan, but it’s missing some important parts! Complete this table plan by filling in the Contract, constructing a good sample table, and drawing the result.
Choose Your Dataset
Overview
Learning Objectives
Evidence Statementes
Product Outcomes
Students choose a dataset they are interested in
Materials
Preparation
Choose Your Dataset(Time 20 minutes)
Choose Your DatasetSo far, you’ve had a chance to run some simple analyses on the Animals Dataset. You’ve made charts, written functions using the Design Recipe and then used them with methods to filter rows and build columns. You’ve used Table Plans to map out your analysis, tying together the Design Recipe and methods.
If students need more practice with the Design Recipe, now’s the time. Do NOT proceed past this point without making sure they are comfortable writing simple functions.
Now it’s time to choose a dataset of your own! Throughout this course, you’ll be analyzing this dataset and writing up your findings. As you learn new tools for data science, you’ll continue to refine this analysis, answering questions and raising new ones of your own!
Take 10 minutes to look through the following datasets, and choose one that interests you:
Or find your own dataset, and use this (Blank Starter file) for your project.
Make sure students realize this is a firm commitment! The farther they go in the course, the harder it will be to change datasets.
Once you’ve found a Starter file for a dataset that interests you, click "Save a Copy" and save the project to your own account.
Complete Page 24. Brainstorm a few questions you would like to ask of this dataset. What kinds of questions are they?
Exploring Your Dataset
Overview
Learning Objectives
Evidence Statementes
Product Outcomes
Students choose a dataset they are interested in
Materials
Preparation
Exploring Your Dataset(Time 40 minutes)
Exploring Your Dataset
Look at the spreadsheet for your data. What do you notice? What do you wonder?
Write down your noticings and wonderings on Page 14.
Have students share back.
Think about all the different ways you might want to look at your dataset. Would you want to sort it by one column or another? Filter it into different subsets, like we did with the Animals Dataset? Would you want to build new columns?
Take a minute to think about how you’d like to experiment with your dataset, and write your plans on Page 25.
In the Interactions Area, use .order-by to sort your dataset according to what you wrote on Page 25.
In the Definitions Area, use .row-n to define at least three values, representing different rows in your table.
Turn to Page 26, and use the Design Recipe to write the filter functions that you planned out on Page 25. When the teacher has checked your work, type them into the Definitions Area and use the .filter method to define your new tables.
Turn to Page 27, and use the Design Recipe to write the builder functions that you planned out on Page 25. When the teacher has checked your work, type them into the Definitions Area.
It’s okay if the functions they design aren’t useful - this is for practice.
Take 10min to make at least one bar and pie chart of columns in one of your tables, and write up your findings on Page 28.
Have students share back. Encourage students to read their observations aloud, to make sure they get practice saying and hearing these observations.
Closing
Overview
Learning Objectives
Evidence Statementes
Product Outcomes
Materials
Preparation
Closing(Time 5 minutes)
Closing
Make sure to save your work. Hit the Save button in the top left. This will save your program in the code.pyret.org folder within your Google Drive.
If your students are working in groups, make sure that each student has access to a version of the program. Students can share their program with anyone by hitting the Publish button in the top left, choosing "Publish a new copy", then clicking the "Share Link" option.