Exploratory analysis and predictive models of how Chicago's neighborhoods interact with the City's 311 service requests.
This is project is a part of the 2013 Data Science for Social Good fellowship, in partnership with City of Chicago and the Chapin Hall at the University of Chicago.
Through the City of Chicago's 311 system, every Chicagoan can ask for city services, from graffiti removal to pothole filling to abandoned car removal. The 311 data these service requests produce reflect - albeit imperfectly - the needs of the city and its inhabitants.
We want to investigate how patterns of service requests are related to the social and economic makeup of Chicago's neighborhoods. Specifically, we want to answer two related questions:
Read more about 311 in Chicago in our wiki.
To answer those big questions, we performed a three-step analysis:
Read more about exploratory analysis, clustering, and statistical models in our wiki.
We used the main data sources:
Read more about the data we used in our wiki.
The folder munging
contains some Python and R code that retrieves and preprocesses the data, aggregating it according to some specified spatial and temporal resolution (e.g. by Community Area, monthly.)
The code that implements our exploratory analysis lives in the analysis/viz
folder. It's a set of functions that operates on 311 service request data from the City of Chicago open data portal. Most of this analysis is performed at the level of community areas.
The folder analysis/clustering
contains code that applies the k-means clustering algorithm on a highly-dimensional space of 311 requests, aggregated by census tract. It uses the scikit-learn machine learning Python library.
The code that implements our predictive models for graffiti removal and pothole filling requests is contained in the folder analysis/prediction
. This part of the project is implemented in R.
The project consists of Python scripts and modules, and R scripts.
analysis/viz/viz_311_data.py
), import the module within a Python file or a Python interpreter and call the functions.Some external libraries are needed:
Python
scikit-learnPython
SciPyPython
matplotlibCopyright (C) 2013 Data Science for Social Good Fellowship at the University of Chicago
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.