Yim Register (University of Washington) and Dan Schneider (Code.org)
This lesson introduces the K-Nearest Neighbor (KNN) algorithm to students in a post-apocalypse, zombie-survival context. Students apply the KNN algorithm to predict how many zombies are likely to be at a new unknown location by comparing the features of the unknown location to other known locations.
This lesson is entirely unplugged and designed to be introduced to students without any prior machine learning experience, and by teachers with minimal machine learning knowledge. This document contains a lesson plan, slides, and activity guides for students to engage in the lesson.
More information about KNN and this lesson can be found in the abstract and summary below
A powerful, interpretable, and multipurpose AI algorithm is k-nearest neighbors (KNN). KNN capitalizes off of similarities between data points for either regression or classification. KNN is overwhelmingly taught using abstract data like red triangles and blue squares on a 2D plane. We present a completely unplugged KNN lesson that engages its K12 audience in a thrilling adventure to cross a map to safety during the zombie apocalypse.
Using a dataset that characterizes how many zombies congregate in certain areas (using features like noise level), students use the information to infer which areas on the map are likely to have fewer zombies and grant them safe passage. Students learn to make a prediction of how many zombies are likely in an area by tallying up the number of similarities between the new location and locations in their dataset. Next, they learn to take the mean number of zombies from those similar locations, and use this as a prediction. Finally, the lesson engages students with ideas about model performance in high-stakes scenarios.
While the zombie game is just for fun, we prompt students to also think about model accuracy for problems of distributing resources, gauging real world infection rates, or health decisions.
Summary | We present a KNN lesson that engages its K12 audience in a thrilling adventure to cross a map to safety during the zombie apocalypse. Using a dataset that characterizes how many zombies congregate in certain areas (using features like noise level), students use the information to infer which areas on the map are likely to have fewer zombies and grant them safe passage. Students learn to make a prediction of how many zombies are likely to be in an area by tallying up the number of similarities between the new location and locations in their dataset. |
Topics | Introduction to AI, K-Nearest Neighbors, Accuracy, Data, Algorithm |
Audience | 6-12. This assignment was designed with middle-school students in mind and requires students to take averages of numbers. However, it is appropriate as an introductory lesson for high school students too. |
Difficulty | No prior knowledge required; intended to beginners to AI concepts. The entire activity is designed to be completed within a 45 minute class period. |
Strengths |
|
Weaknesses |
|
Dependencies |
|
Variants | Instructors can use this framework for examining machine learning algorithms to adapt other unplugged activities for students. Instructors can also extend this activity and continue to explore the Zombie scenario to explore other machine learning algorithms, or extend their understanding of KNN (such as using different values of K, or choosing different features in the data). Beyond this lesson, instructors may decide to explore online activities such as ml-playground to see computational versions of the KNN algorithm. |