These are examples of supervised machine learning problems. In other words, we know the right answer for at least a subset of the data, but want to predict which observations fall into which categories.
Machine learning is a very large field, and there are entire courses on the theory and applications. Here, we will give a very high-level overview. We’ll skate over the theoretical underpinnings and focus on implementing the models in Python.
In this module, we’ll walk through data preparation, and the process of estimating a common machine learning model: random forests.
Learning objectives
By the end of this module, you should be able to:
- Perform more complex joins and other data wrangling operations
- Split a dataset into training and testing portions
- Estimate a random forests model
- Interpret a random forests decision tree
Required readings
The first two papers are examples of applied machine learning in the urban and environmental planning context. Pick one to focus on and skim the second. In particular, think about the advantage (if any) of the machine learning algorithms compared to a traditional regression model.
Optional readings
Here’s another applied example of random forests models in planning.
Video 5a: Data preparation
In this lecture, we’ll practice data wrangling and spatial joins, through preparing a dataset for a machine learning analysis. The example: Accessory Dwelling Units in Los Angeles.
As you watch the video, follow along with the code here.
Video 5b: Random forests
We’ll demonstrate how and why to split a dataset into training and testing subsets, and how to estimate and interpret one of the most common machine learning models – random forests.
As you watch the video, follow along with the code here.
Please take the quiz below to check your understanding of this module.
This notebook practices the concepts that we’ve developed in the lecture notebooks. We’ll work through it in class.
It’s the Module 5 class activity in your GitHub repository here.
You have now completed Module 5. Please navigate to the homepage or to the next module by using the green navigation bar at the top.