Facilitator’s Guide:
Regression and Color
AAIC Water Quality Modules · Lesson 3
Use color, scatterplots, and linear regression to help predict water quality.
Lesson Objectives and Standards
By the end of the lesson, students will be able to:
- CS Use Python to generate a linear regression model and predict outcomes.
- DS Understand and create models of the relationship between RGB color values and nitrate concentrations using self-collected data.
- AgScience Create and apply a linear model predicting dissolved nitrogen concentrations in waterways.
- 3.2 Models: Develop models for the flow of energy and matter (inorganic forms and overall biomass) in various ecosystems impacting agricultural and environmental systems. Using these models, calculate rates of productivity by analyzing the major components of a food chain. Employ mathematical models to explain growth patterns and rates, both density-dependent and density-independent factors, observed in ecosystems energy and nutrients flow.
- 3-5.B.3.1d: Creating your own data: Plan and conduct measurements by identifying measurable characteristics and collecting both categorical and numerical variables of objects/events.
- 9-10.C.2.3b: Defining relationships: Analyze data to uncover correlations, trends, and groupings that inform decision-making processes across diverse fields.
- 9-10.C.5.2a: Creating models: Construct and analyze models to represent linear and non-linear relationships in data.
- 9-10.C.5.2b: Creating models: Use technology to create, test, and refine models.
- CS.AT.1: Algorithmic Thinking: Use lists to simplify solutions, generalizing computational problems instead of repeatedly using simple variables.
- CS.DA.1: Data Analysis: Create computational models that represent the relationships among different elements of data collected from a phenomenon or process.
- CS.DA.2: Data Analysis: Utilize data to answer a question using a variety of computing and data visualization methods.
- CS.DA.3: Data Analysis: Use data analysis tools and techniques to identify patterns in data representing complex systems.
This lesson assumes that students have already had an introduction to:
- Bivariate linear regression within their mathematics classes.
| Term | Student-friendly definition |
|---|---|
| Regression | A statistical method for finding the relationship between two variables, often shown as a “line of best fit” that runs through a set of data points. |
| Prediction | An estimate of what will happen or what a value will be, based on patterns found in data. For example, using a regression line to guess a test score from hours studied. |
| Scatterplot | A graph that uses dots to show the relationship between two sets of data. Each dot represents one pair of values. |
| Independent Variable | The variable you change or control in an experiment. It goes on the x-axis (horizontal). |
| Dependent Variable | The variable you measure to see how it responds to changes in the independent variable. It goes on the y-axis (vertical) and “depends” on the other variable. |
Lesson Materials
✅ Exit Ticket
The exit ticket asks students to describe a regression line, apply the idea of prediction to another real-world context, and apply their knowledge of prediction to the buoy’s ML regression process.
🛒 Walmart Cart
Share-A-Cart link for the stickers, poster markers, and Post-It gridded sticky pad easels.
Facilitation Notes
For an in-depth walkthrough, see the slides with visible facilitator notes.
- [Pose after gruops record RGB value for each purple card with PPM values] Compare your observed values with another group. Do you have the same values? Why do you think that that is?
- [Pose after prediction card activity] Does each group get the same predicted concentration for each card? Why do you think that is?
- [Pose near end of lesson] Today, we learned to use a regression model to predict nitrate concentrations from RGB values. What other things could we predict in AgriScience? What variable(s) could be useful to predict them?
Extra support:
- Prelabeling the grid paper axes will support students who have never been asked to count by multiples on an axis.
- Data entry into the code cells that generate the linear regression model is prone to error. Consider assigning one team member to enter the data, and another to double check the work before generating the model.
- Assigning group roles can support different students’ strengths. Consider drawing from complex instruction strategies and assigning a role to each team member:
- Facilitator: Keeps the group on track and makes sure everyone gets a turn to share. Asks the group’s questions to the teacher, but only after checking with teammates first.
- Resource Manager: Gets the materials your group needs and puts them away at the end. Goes to the teacher when the whole group needs help or supplies.
- Recorder: Records the group’s ideas, answers, and data so nothing gets lost.
- Reporter: Shares the group’s findings with the class when the work is done.
Extension:
In most machine learning regression models, we use multiple independent variables to predict a dependent variable. The buoy uses all three RGB channels (to different degrees) to predict nitrate concentrations. Ask students to brainstorm a situation when more than one independent variable predicts a dependent variable. You may wish to suggest the dependent variable of interest (e.g., observing a snow day) to get students started.
If you’re short on time:
Skip the (1) two YouTube videos and model correctly placing the stickers onto the coordinate plane and (2) prediction of the regression line placement with the yardstick.
Issue Accessing Applet
- Students must grant permission for the applet to access their webcam. If they decline, reload the applet.
- Only one working applet/computer combination per group is necessary.
Generated Regression Model is a Poor Fit
- Double check the data entered into the lists for
color_dataandnitrate_data. Typos are common.
Lesson Prep
(This list is built automatically from the step titles below.)
Purchase/Gather Materials for Lesson
Materials needed:
- 🛒 1 Sheet of Post-It Super Sticky Easel Pad GRIDDED Paper Per Group
- 🛒 1 Black Poster Marker Per Group
- 🛒 2 Sheets of the Avery ¾” Circular Multi-Color Labels Per Group
- 1 Yardstick Per Group (purchaseable at home improvement stores)
Each group will be assigned either red, green, or blue. They will only need their assigned color of stickers from each of the two sheets. Before class, cut the sheets into strips to conserve materials and only provide two strips of the color needed to each group.

Ensure Student Access to Webcam and Applet
This lesson is reliant on the student use of device webcams (at least one per group). Please double check that the webcams on their devices are enabled and work with the AAIC Applet used in this lesson.
What will it look like if the applet works?
- When the “What Humans See” option is select, a low-quality full-color image is shown
- When the “What Computers See” option is selected, squares of that color with numbers in them are shown (for red, green, and blue channels)

Check that Video Links are Accessible
Two YouTube videos are used in this lesson. Confirm that the two links are not blocked at your school, or you can access them when needed.
Prepare Purple Color Swatch Cards
Print and cut one deck of purple color swatch cards for each group. It is important that these cards be printed in color and of high quality. While the colors are approximations of the exact colors that result from the nitrate test strips used in lesson #1, the key is that they capture the mathematical differences in usefulness of the red, green, and blue channels in meaningfully predicting nitrate concentrations in water samples. This behavior mirrors the reality of the ML model driving the buoy’s predictions.
Card Deck Optimized for Fluorescent Lighting
Card Deck for Standard Lighting
Separate these decks into two separate piles. Groups will first use the eight cards with PPM values written on them to create their model.
Later, groups will need the three predictor cards to use in predicting nitrate concentrations from their created model.

Make Copies of the Student Handout
Each student will need one copy of the student handout. You can make a copy of the handout above.
Make (Digital) Copy of Student Exit Ticket and Link in Your LMS
We have drafted an exit ticket that aligns with this lesson. We are providing the Google Form here if you would like to use it or modify it for your own needs.
Make (Digital) Copy of Student Exercise and Link in Your LMS
We have also created an exercise that you can use with students to practice the concepts covered in this lesson. It is available here.
(Optional but Recommended) Pre-Label Grid Paper with X,Y Axis and Tick Marks
For the exercise to fit on the grid paper, the y and x axes will need to count by different units (y by 2s and x by 10s), given the size of the paper. This can sometimes be tricky for students. So, if pressed for time, we suggest pre-labeling the paper (see example below) so students can quickly begin plotting their values.

Estimated Time Per Lesson Component
Introduction to Regression Deliver Initial Slides/Lead up to Regression Activity Pt. I.
Regression Activity Pt. I Groups will use applet to record RGB values of purple swatches in deck.
Regression Activity Pt. II Students watch short scatterplot video and plot their assign color stickers on grid.
Regression Activity Pt. III Students input values from Pt. II into Python code block to generate digital scatterplot (should match) and linear regression model.
Regression Activity Pt. IV Students use the yardstick and marker to approximate the regression line on the gridpaper, making it match the computer version as much as possible.
Regression Activity Pt. V Students use linear regression model to predict nitrate concentrations for their three “prediction cards.”
Discussion/Reflection Use this time for whole-group discussion of the day’s work and then individual journaling/reflection about the learning.
Exit Ticket & (If Desired) Assignment of Practice Exercise Use the final 10 minutes of class for students to complete the exit ticket. Additionally, if you’d like to assign the practice exercise for homework, do so now.
Reference Materials
Whole-Class Videos
Other Useful Materials
- Introduction to Linear Regression Provides broad overview/intuition about how linear regression works
Questions or feedback on this lesson? Contact aaic [at] utk [dot] edu