Ravisutha / CrimePrediction

Predicting chicago crime data using network science

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chicago Crime Prediction

The objective is to predict the number of crimes for all types of crimes listed in the City of Chicago dataset.

Getting Started

To reproduce our result, start by cloning this repo.

git clone https://github.com/Ravisutha/CrimePrediction.git

Prerequisites


Following are some packages that are a must to run the code.

  1. networkx - To build the graph and to find similar communities.
  2. sklearn - To predict number of cirmes.
  3. pandas - To handle data.

If you use anaconda, it would be simpler to use the environment crime_predict.yml which can be found in the root directory of this repo.

conda env create -f crime_predict.yml

Run prediction models


The Code directory contains code for handling dataset, creating network using networkx, analyzing the data (making predictions) and for visualizing the results. These are categorized into appropriate folders. To predict the number of crime for a given period, navigate to Analysis directory and run the predict.py code.

cd ./Code/Analysis
python predict.py

You can check the predicted outputs in ./Data/Total_Data/Output. To visualize the output:

cd ./Code/Visualize
jupyter notebook boxplot_fullcrime.ipynb

Authors


About

Predicting chicago crime data using network science


Languages

Language:HTML 63.9%Language:Jupyter Notebook 33.1%Language:Python 3.0%