To understand the spatial relationship between crime and the risk of crime, a fishnet is built to to treat crime risk as something that varies contentiously across time and space.
A correlation test was then used to compare count and nearest neighbor side by side. This helps give more insight on features that may predict property damages.
in order to test the model if the model is actually generalized across different various time and space, two different methods cross validation regression was used.This allows us to better observe if our model performs well on a different dataset, and on a different geographical context. In this case different neighborhoods will be use to observe how well the model performs. The function LOGO-CV or “leave one group out’ is used to best assess if the crime predictive model can learn what is happening in once area and and can be generalized on another area. A 100 fold test, or random K test was also used to to test each neighborhood.
4 regression will be used, two on just risk factors and the other two on risk factors plus the Local Moran’s features. Neighborhood name and police district will be used for spatial cross validation.
The figure below visualizes both the Random K folds on both spatial and risk factors and LOGO-CV on risk factors and spatial processes. The map demonstrates that adding the spatial process increases the error in areas that have high counts of property damages. ### Visualizing MAE for each fold
In both figures above and below it appears that including spatial process features does improve our model.The histogram demonstratives that as spatial features are added our model generalizes pretty well, particularity in hotpots areas. This can be seen in the kable below.
Regression | Mean_MAE | SD_MAE |
---|---|---|
Random k-fold CV: Just Risk Factors | 1.08 | 0.76 |
Random k-fold CV: Spatial Process | 0.87 | 0.70 |
Spatial LOGO-CV: Just Risk Factors | 2.81 | 2.30 |
Spatial LOGO-CV: Spatial Process | 1.78 | 1.68 |
The figure below displays how are model significantly over predicts in areas that have low property damage rates, and under predicts in areas with that have higher property damage rates.
The map below visualizes our models spatially, and as demonstrated, when spatial processes are introduced, errors are reduced.
Regression | Morans_I | p_value |
---|---|---|
Spatial LOGO-CV: Just Risk Factors | 0.1944784 | 0.001 |
Spatial LOGO-CV: Spatial Process | 0.1691450 | 0.008 |
The model on average under-predicts in majority non-white areas, and over predicts in majority white neighborhoods. Broadly speaking the model generalizes well within the racial context. But I wonder if this has to do with the type of crime chosen. More on this in the conclusion.
Regression | Majority_Non_White | Majority_White |
---|---|---|
Spatial LOGO-CV: Just Risk Factors | -1.4905068 | 1.6167755 |
Spatial LOGO-CV: Spatial Process | -0.2136402 | 0.2063569 |
The three maps below visualizes three Kernel density maps at three different scales.
Next, a goodness of fit indicator was generated to compare whether the 2017 kernel density or risk predictions capture more of the 2018 incidents of property damages. The map belwo illustrates that the model is decent at predicting property damage incidents in 2018.
In summary this model seems mediocre at best when compared to traditional algorithms used by the Chicago police department(CPD). The model outperforms the traditional algorithm used by CPD in risk category 3 but in the higher risk category the traditional algorithm performs better. This tells me that CPD would probably not hire me because my model almost performed worse than theirs? I am not sure this would be a helpful tool in allocating police resources.
Honestly, I am okay with this conclusion for a number of reasons. One,the dependent of variable chosen;property damages, is a category of crime that is a bit niche and that more features would be needed to better predict criminal damages to property. Affordable housing, and noise complaints do not really explain the association to property damage incidents, and there will have to be more thought into what kind of features would more accurately predict this type of crime. I also think property damage is such an interesting crime to try and predict where the next occurrence will be.What are the chances of an incident of property crime occurring again in the same area spatially? Property crime also usually occurs in connection with other crimes like assault, or theft, so I think a different dependent variable altogether would perform better and make for a more interesting analysis. Although the model generalized decently across other context such as race, like the book points out, I too cannot be certain that the model chosen and the data set collected does not fall victim to selection bias.
Using biased features to predict on biased policing datasets feels icky. But I am hopeful that in their intrinsic disastrous nature, we can all come to the conclusion that hard tools like algorithmic prediction and modeling, paired with soft tools like social programming, economic interventions,and proper & intentional investments are both needed to better protect our most vulnerable communities. As technology continues to advance, and we employ more technologies and collect more and more data about communities of color, I really hope we reach that junction sooner rather than later.