This is a data-driven Early Intervention System (EIS) for police departments. The system uses a police department's data to predict which officers are likely to have an adverse interaction with the public. An adverse incident can be defined on a department by department basis, but typically includes unjustified uses of force, officer injuries, preventable accidents and sustained complaints. This is done such that additional training, counseling and other resources can be provided to the officer before any adverse interactions occur.
The pipeline has two main configurations. In the modelling configuration, there are three distinct steps.
python3 -m eis.run --config officer_config.yaml --labels labels_config.yaml --buildfeatures
In this stage, features and labels are built for the time durations specified in the config files.
Features are stored in the features schema defined by schema_feature_blocks
in the config file. Labels are stored in the table specificed by the officer_labels_table
in the config.
python3 -m eis.run --config officer_config.yaml --labels labels_config.yaml --generatematrices
All possible configurations of the train/test splits are saved. They are saved in the directory specified by project_path
in the config.
python3 -m eis.run --config officer_config_collate_daily.yaml --labels labels_config.yaml
Running the pipeline with no flags will complete the modeling run. The pipeline first checks to see if the feature building and matrix generation stages have been completed. If not, these processes are run before the modeling run of the pipeline.
The results schema is populated in this stage. The schema includes the tables:
After the model runs are completed and a model is picked, the production setup lets the user run a specific model group and score the list of active officers for a provided date.
python3 -m eis.run --config officer_config.yaml --labels labels_config.yaml --production --modelgroup 5709 --date 2015-02-22
The production schema will be populated at this stage. The schema includes the tables:
Our modeling pipeline has some prerequisites and structure documentation:
Once the pipeline has been run, the results can be visualized using the webapp.
Deprecated Documentation Quick Links:
Please use Github's issue tracker to report issues and suggestions.