A Chicago crime data dispatch system to help officers arrest more people to further fuel mass incarceration. Got to love America.
make
python3
(andpip
)
make setup
- Install graphiz package for your OS (ubuntu might have a seperate graphviz-devel?)
make format
make
(ormake run
) - to test ourChicagoCrime.py
file, which, at the moment, outputs some metadata about the CSVmake web
- serves the flask appmake test
- small script w/ made-up data to test the ADT
The AVL tree now correctly balances the tree after each insertion. The tree also correctly prioritizes the values of each node. The way we did this was by now keeping track of a parent node which helped us keep track of the node we were setting as our pivot and rotating. The visualization of the tree is now done by graphviz because it was a easy way to visualize the tree. We have tried other visualization packages but they were not as easy to visualize since the code was not working properly.
Using print statements and the debugging tool that visual studio code provides. We also created a TestAVLTree.py
file which tests the ADT.
Also, see the section on web app!
We feel that the approach we've taken to assigning priority, while not perfect, is fairly equitable given issues discussed in the assigned readings. The fact of the matter is that the percieved bias in predictive policing is largely due to outside social factors in the United States, and systematic opression of minority groups. Thus, our design of this system is (or would be) merely one tiny factor in the larger social justice context.
Of course, we aknowledge that a system like this in production would likely be regularly inspected (we hope!) by department staff and those it affects. We've made sure to document how functions work, and tried to make the code as readable as possible so that hopefully anyone can see that it is functioning as the comments claim.
To make our predictions more presentable to the average police dispatcher, we’ve developed a web-frontend, to get results and useful information from our dispatch recommendations.
The flask app is also written in a way that should allow for other groups to plug in their ChicagoCrimeFun.py
files to get results based on their own decision algorithm.
To place police stations, we would likely write a method to find the GPS coordinates of each indcident of a given type. (For example, ROBBERY
)
Then, we could use a FastPriorityQueue to store each pair under it's priority ranking.
Finally, we can average all elements of each priority tier. These datapoints would then be considered the rough geographic center of each type.
Depending on the number of stations desired, you could either:
- average the datapoints, to get one rough geographic center of crime
- or, use those location points as new stations
Obviously, option 1 above would result in a massive station that's roughly in the center of the whole city, so that might not be particuarally useful. However, the second option could potentially yield new insight, and hence be useful in staging resources near enough the potential location for, say, vehicle hijacking so that a response could be made in time.
See for instructions and warnings when using
web.py
with other projects.