Skip to content

An urban fire risk prediction model using machine learning. Visualization of findings with map and table in interactive Streamlit app.

License

Notifications You must be signed in to change notification settings

catherman/FIRE-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FIRE 2024

An urban fire risk prediction model using machine learning. A joint project with ATLytiCS and DeKalb County Fire and Rescue (DCFR). (2022-2023)

Business Challenge: Allocation of DCFR’s limited Community Risk Reduction resources to properties at greatest risk of fire.

Solution: Engineer a machine learning model in Python to identify fire risk probability and ranking of multifamily properties.

Domain Knowledge: Consulted with a domain expert and researched similar urban fire risk analysis, reviewing summary reports, approach & code for inspiration and strategies to improve model’s performance.

Data: Conducted statistical & spatial analytics using large microdata sets such as: local government geospatial, parcel, NFIRS (EMS calls), land use, socio-economic, demographic, google reviews, and shape files (county and TIGER). Collaborated with team on formulating exploratory data analysis, data preparation, visualization, feature selection & engineering, joining of large “messy” & complex data sets.

Model selection, fitting and parameter tuning of Random Forest and AdaBoost to optimize probability metrics (Brier loss and Log loss). Random Forest Classification Model accuracy: 83%.

Deliverables: An interactive Tableau Dashboard, Streamlit app, and Summary Report, ranking 1046 multifamily properties in DeKalb County, identifying property risk levels, address, geo coordinates, fire district and station, to be used by DCFR in their Community Risk Assessment (CRA). Presented strategy and findings to industry professionals.

How to reproduce the Streamlit App

Screen Shot 2024-05-05 at 1 57 02 PM The Streamlit library allows for app creation using only Python. While there are limitations to the format, it is useful to quickly generate apps for internal review.
  1. Move the required code & csvs to your OS, either:

    a. Clone this repository to GitHub or VSCode; OR

    b. Copy/download to your OS & Python interpreter only files needed for the multifamily or single family app, noted below:

    -Data required:  “data/processed/pred_mf_stion.csv” &/or “data/processed/pred_sf_stion.csv”
    
    -Code required: “src/apps/Fire_Risk_Map_MF.py” &/or “src/apps/Fire_Risk_Map_MF.py”
    
  2. Install required libraries, if not already installed: "!pip install streamlit"

  3. Run either the MF or SF code. The app will appear in a few minutes on a new browser.


For more info, see Streamlit documentation

Contents of Repository

Note: Complete raw data not provided, as this is an internal project for DCFR. Rather, this repository is meant to provide a reference for other similar projects. Production pipeline: work in progress, incomplete files noted with “add”.

Screen Shot 2024-07-06 at 9 34 48 AM

Screen Shot 2024-07-06 at 9 35 06 AM

Screen Shot 2024-07-06 at 9 35 20 AM