项目作者: varun1524

项目描述 :
Crime Prediction
高级语言: Jupyter Notebook
项目地址: git://github.com/varun1524/Crime_Prediction.git
创建时间: 2018-04-16T00:39:12Z
项目社区:https://github.com/varun1524/Crime_Prediction

开源协议:

下载


Crime-Prediction

Crime Prediction

-crimepred.ipynb can be opened on jupyter notebook
-crimepred.py can be executed directly a executable file
-Since data can be fetched from website using API (which is implemented in the provided source code). For that user needs to install sodapy library using following command:
pip install sodapy
-Also, it can be downloaded from the following link:
https://data.sfgov.org/Public-Safety/-Change-Notice-Police-Department-Incidents/tmnf-yvry

Libraries Used:
-Python2.7
-pandas
-Numpy
-sklearn
-sodapy

  • Program can be executed in sequence in jupyter
  • Following steps to execute program:
    -Execute everything till you reach to “Method for Classification”
    -From here there are methods developed for the ease of user to train classification model and perfirm prediction on testing data
    -predictCrimeCategory() can be executed to perform classification for specific district
    1. Parameters:
    2. -district name
    3. -Classifier
    -classifyAllDistricts() can be executed to perform classification for all the districts in San Francisco
    1. Parameters:
    2. -Classifier
    3. -path where output needs to be stored
    -ensamble_classifiers() can be executed for city as well as district and it generates all 3 classifier predictions and from that performs ensembling in order to generate better prediction
    1. Parameters:
    2. -district name
    3. -city - if true classification will be performed on city level else on district level