/fire_risk_analysis

Modeling structure fire risk to inform fire inspections

Primary LanguageJupyter NotebookMIT LicenseMIT

Pittsburg Metro 21: Fire Risk Analysis Template

Edit: This is an modified template of the original open-source Pittsburg Fire Risk model (also called FireGuru and also called Firebird 2.0). The Pittsburg model was by Dr. Michael Madio and his team for Pittsburg fire department. This fork is to serve as an educational template for the Atlytics event to help Altanta metrocounties predict fire risk for new types of fires like residental fires. However, Pittsburg's Fire Risk model was designed to predict commerical fire risk, and Atlytics data is complete different for residental fires. Still, the fire risk model was being modified for predicting residental fire risk as of Feb 05 2019. Furthermore its based on the original firebird that was also a commerical fire risk model. As consequence, it should only serve as a starting point for predicting any other noncommerical type of fire risk. Please give citation and credit to the original creators (listed as authors below) not this fork.

Fire Risk Analysis

This is a set of scripts for a machine learning pipeline to predict structure fire risk and inform fire inspection prioritization decisions. A full technical report can be found here. For more details on the most recent changes please (see Singh Walia, Bhavkaran & Madaio, et al. (2018). A Dynamic Pipeline for Spatio-Temporal Fire Risk Prediction. 764-773. 10.1145/3219819.3219913)

Residental Risk Model

The residental risk model the team developed during "A Dynamic Pipeline for Spatio-Temporal Fire Risk Prediction" and "A Longitudinal Evaluation of a Deployed Predictive Model of Fire Risk" in 2018-2019 can be found here.

Run_Model.sh

Runs all three python scripts listed below in succession.

getdata.py

Scrapes WPRDC for:

  • City of Pittsburgh property data ("pittdata.csv")
  • City of Pittsburgh parcel data ("parcels.csv")
  • Permits, Licenses, and Inspections data ("pli.csv") (updated every 12 hours)

riskmodel.py

Runs the risk prediction model, using:

  • the three datasets from WPRDC
  • Fire Incident data from PBF (public, aggregated version available at WPRDC. However, please note that due to privacy concerns, the most detailed fire incident data that the model is trained on are not publicly accessible, but the aggregated version of the incident data is available, at the block-level, instead of the address-level. At the moment, this script is not able to run on the aggregated, block-level data. (Edit: This anonymization was a slight issue so the data provide is mostly a simulation

merger.py

Takes the output of the risk model, and merges each property's risk score with the rest of the property data in pittdata and parcels, sending the output to the Burgh's Eye View directory for map and dashboard visualization (on a private instance developed for Bureau of Fire inspectors; public version of BEV available here)

Fire Risk Dashboard: ui.R and server.R

Takes the output of the risk scores, merged with property data, and visualizes them in an R Shiny dashboard, for inspectors and fire chiefs to view property risk levels, by property type, neighborhood, and fire district.

requirements.txt

All of the packages you'll need to install for the scripts to run.

Extra Folders

datasets

  • Useful data dictionaries can be found in the dictionary subfolder. Of important note though is the Fire Code Dictionary (called data_dictionary_incident_type_fire_codes.xls). It contains the national standard fire codes. Though its strongly encourage to use APIs, the data can be obtained from the following locations:
  • Fire Inspection dataset: ~20,000 fires and 5 years. See riskmodel.py below for more details about issues with the data. Due to these issues the data is can be considered a simulated or rough approximation.
  • Pittsburg Commerical Inspection and Permit data(updated daily): This is the data that we can to compare the commerical fires too as technical report notes. For residental fire risk we will not have fire inspections, so we will probably use the property data and other sources (like smoke alarm locations). Still its a starting point.
  • Pittsburg Properties(updated monthly): Allegheny County Property Assessments. The map can be dashboard found here. The old source is linked below.
  • Pittsburg Parcels(updated yearly): Allegheny Parcel Centroids for the city of Pittsburg. The old source is linked below. Residental Datasets: The following data sources were used for residental simulation deeply buried in the code.
  • Unpaid Tax Information: The Pittsburg Unpaid Tax information. Useful for which regions have finacial difficulties related to property. Its related to vacancy, but a better measure might be vacany reports from the police.
  • occupancy.csv: The Census occupancy information by blockgroup (using the Census API)
  • income.csv: The Census median housing income information by blockgroup. As a curtousy, copies of these datasources have been zipped to the datasets folder.

articles

This is a collection of various research articles people might find useful.

image and log

The output of the models can be found here.

Authors:

  • Michael Madaio
  • Geoffrey Arnold
  • Bhavkaran Singh
  • Qianyi Hu
  • Nathan Kuo
  • Jason Batts