Public Policy Analytics: Code and Context for Data Science in Government 0367507617, 9780367507619

Public Policy Analytics: Code & Context for Data Science in Government teaches readers how to address complex public

270 56 42MB

English Pages 228 [229] Year 2021

Report DMCA / Copyright

DOWNLOAD PDF FILE

Table of contents :
Cover
Half Title
Series Page
Title Page
Copyright Page
Contents
About the Author
Preface
Introduction
How governments make decisions
Context as the foundation
Data science as a planning tool
The importance of spatial thinking
Learning objectives
1. Indicators for Transit-oriented Development
1.1. Why start with indicators?
1.1.1. Mapping and scale bias in areal aggregate data
1.2. Set up
1.2.1. Downloading and wrangling census data
1.2.2. Wrangling transit open data
1.2.3. Relating tracts and subway stops in space
1.3. Developing TOD indicators
1.3.1. TOD indicator maps
1.3.2. TOD indicator tables
1.3.3. TOD indicator plots
1.4. Capturing three submarkets of interest
1.5. Conclusion: Are Philadelphians willing to pay for TOD?
1.6. Assignment Study TOD in your city
2. Expanding the Urban Growth Boundary
2.1. Introduction - Lancaster development
2.1.1. The bid-rent model
2.1.2. Set up Lancaster data
2.2. Identifying areas inside and outside of the Urban Growth Area
2.2.1. Associate each inside/outside buffer with its respective town.
2.2.2. Building density by town and by inside/outside the UGA
2.2.3. Visualize buildings inside and outside the UGA
2.3. Return to Lancaster’s bid-rent
2.4. Conclusion - On boundaries
2.5. Assignment - Boundaries in your community
3. Intro to Geospatial Machine Learning, Part 1
3.1. Machine learning as a planning
3.1.1. Accuracy and generalizability
3.1.2. The machine learning process
3.1.3. The hedonic model
3.2. Data wrangling - Home price and crime data
3.2.1. Feature engineering - Measuring exposure to crime
3.2.2. Exploratory analysis - Correlation
3.3. Introduction to ordinary least squares regression
3.3.1. Our first regression model
3.3.2. More feature engineering and colinearity
3.4. Cross-validation and return to goodness of fit
3.4.1. Accuracy - Mean absolute error
3.4.2. Generalizability - Cross-validation
3.5. Conclusion - Our first model
3.6. Assignment - Predict house prices
4. Intro to Geospatial Machine Learning, Part 2
4.1. On the spatial process of home prices
4.1.1. Set up and data wrangling
4.2. Do prices and errors cluster? The spatial lag
4.2.1. Do model errors cluster? - Moran’s I
4.3. Accounting for neighborhood
4.3.1. Accuracy of the neighborhood model
4.3.2. Spatial autocorrelation in the neighborhood model
4.3.3. Generalizability of the neighborhood model
4.4. Conclusion - Features at multiple scales
5. Geospatial Risk Modeling - Predictive Policing
5.1. New predictive policing tools
5.1.1. Generalizability in geospatial risk models
5.1.2. From broken windows theory to broken windows policing
5.1.3. Set up
5.2. Data wrangling: Creating the fishnet
5.2.1. Data wrangling: Joining burglaries to the fishnet
5.2.2. Wrangling risk factors
5.3. Feature engineering - Count of risk factors by grid cell
5.3.1. Feature engineering - Nearest neighbor features
5.3.2. Feature Engineering - Measure distance to one point
5.3.3. Feature Engineering - Create the final_net
5.4. Exploring the spatial process of burglary
5.4.1. Correlation tests
5.5. Poisson Regression
5.5.1. Cross-validated Poisson regression
5.5.2. Accuracy and generalzability
5.5.3. Generalizability by neighborhood context
5.5.4. Does this model allocate better than traditional crime hotspots?
5.6. Conclusion - Bias but useful?
5.7. Assignment - Predict risk
6. People-based ML Models
6.1. Bounce to work
6.2. Exploratory analysis
6.3. Logistic regression
6.3.1. Training/testing sets
6.3.2. Estimate a churn model
6.4. Goodness of fit
6.4.1. Roc curves
6.5. Cross-validation
6.6. Generating costs and benefits
6.6.1. Optimizing the cost/benefit relationship
6.7. Conclusion - Churn
6.8. Assignment - Target a subsidy
7. People-based ML Models: Algorithmic Fairness
7.1. Introduction
7.1.1. The specter of disparate impact
7.1.2. Modeling judicial outcomes
7.1.3. Accuracy and generalizability in recidivism algorithms
7.2. Data and exploratory analysis
7.3. Estimate two recidivism models
7.3.1. Accuracy and generalizability
7.4. What about the threshold?
7.5. Optimizing ‘equitable’ thresholds
7.6. Assignment - Memo to the mayor
8. Predicting Rideshare Demand
8.1. Introduction - Rideshare
8.2. Data wrangling - Rideshare
8.2.1. Lubridate
8.2.2. Weather data
8.2.3. Subset a study area using neighborhoods
8.2.4. Create the final space/time panel
8.2.5. Split training and test
8.2.6. What about distance features?
8.3. Exploratory Analysis - Rideshare
8.3.1. Trip_Count serial autocorrelation
8.3.2. Trip_Count spatial autocorrelation
8.3.3. Space/time correlation?
8.3.4. Weather
8.4. Modeling and validation using purrr::map
8.4.1. A short primer on nested tibbles
8.4.2. Estimate a rideshare forecast
8.4.3. Validate test set by time
8.4.4. Validate test set by space
8.5. Conclusion - Dispatch
8.6. Assignment - Predict bike share trips
Conclusion - Algorithmic Governance
Index

Public Policy Analytics: Code and Context for Data Science in Government
 0367507617, 9780367507619

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
File loading please wait...
Recommend Papers