Please run the command git clone https://github.com/shanbhag10/Crime-Predictor-Chicago.git
Please run the command cd <PATH_OF_CLONE_FOLDER>/Crime-Predictor-Chicago/scripts
Please run the command python3 preProcessData.py ../config/<PRE_PROCESS_FILE>.config ../config/<MAIN_PROCESS_FILENAME>.config
Example:
python3 preProcessData.py ../config/preprocess_all.config ../config/main.config
The structure of <PRE_PROCESS_FILE>.config is as follows
First Line: <OUTPUT_FILE_FOR_MAIN_ALGO>
Second Line<RAW_FILE_PATH>,<ROW_FILTER_KEY>,<COL_NAME_HAVING_THE_FILTER_KEY>,<COL_NAME_FOR_LATITUDE>,<COL_NAME_FOR_LONGITUDE>
For multiple files put each entry on a new line
NOTE: The ROW_FILTER_KEY and COL_NAME_HAVING_THE_FILTER_KEY can be empty if you don't want to filter rows
Example content:
../data/input/allFeatures.csv
../data/overlap/crime.csv,HOMICIDE,PRIMARY DESCRIPTION,LATITUDE,LONGITUDE
../data/overlap/bars.csv,,,LATITUDE,LONGITUDE
../data/overlap/church.csv,,,"LAT","LONG"
../data/overlap/library.csv,,,LAT,LONG
../data/overlap/school.csv,,,Lat,Long
../data/overlap/police.csv,,,LATITUDE,LONGITUDE
Create a file <MAIN_PROCESS_FILENAME>.config in the config directory with the names of clean combined input file separated by ','
Example Content:
../data/input/allFeatures.csv
Please make sure that the file above only has a UID, latitude, longitude and Feature values for each record for the corresponding feature in a new line
Example input file content: ../data/input/allFeatures.csv
1,41.86922,-87.66249,bars
2,41.86923,-87.66249,bars
3,41.86921,-87.66248,school
4,41.86923,-87.66248,school
5,41.86920,-87.66247,police
Run the following command
python3 colocationAlgo.py ../config/<MAIN_PROCESS_FILENAME>.config > ../data/output/<OUTPUT_FILE_NAME>.txt
Example:
python3 colocationAlgo.py ../config/main.config > ../data/output.txt