A machine learning web application that predicts the **Fire Weather Index (FWI)** — a critical measure of forest fire risk — based on weather and environmental conditions in two regions of Algeria: **Bejaia** and **Sidi Bel-Abbes**.
# 🌲 Algerian Forest Fire Prediction System
A machine learning web application that predicts the **Fire Weather Index (FWI)** — a critical measure of forest fire risk — based on weather and environmental conditions in two regions of Algeria: **Bejaia** and **Sidi Bel-Abbes**.
This project combines **data cleaning**, **exploratory data analysis (EDA)**, **regression modeling**, and a **Flask-based web interface** to deliver real-time fire risk predictions.
---
## 📌 Table of Contents
- Project Overview
- Dataset
- Key Features
- Exploratory Data Analysis (EDA)
- Model Training
- Flask Web Application
- How to Run the App
- Folder Structure
- Dependencies
---
## 🚀 Project Overview
This system predicts the **Fire Weather Index (FWI)** using a **Ridge Regression model** trained on real weather data collected from June to September 2012. The FWI is a continuous index that reflects the potential for fire spread and intensity.
While the original dataset includes a binary label (`fire` / `not fire`), this project treats **FWI prediction as a regression task**, enabling more granular fire risk assessment.
The trained model is deployed via a **Flask web application**, where users can input weather parameters and get an instant FWI prediction.
---
## 📂 Dataset
- **Name**: Algerian Forest Fires Dataset
- **Source**: Kaggle / UCI ML Repository
- **Time Period**: June – September 2012
- **Instances**: 244 (122 from Bejaia, 122 from Sidi Bel-Abbes)
- **Features**:
- `Temperature`: Temperature in °C
- `RH`: Relative Humidity (%)
- `Ws`: Wind Speed (km/h)
- `Rain`: Rainfall (mm)
- `FFMC`, `DMC`, `DC`, `ISI`, `BUI`, `FWI`: Components of the Canadian Forest Fire Weather Index (FWI) System
- `Classes`: 0 = "not fire", 1 = "fire"
- `Region`: 0 = Bejaia, 1 = Sidi Bel-Abbes
- **Target Variable**: `FWI` (predicted as a continuous value)
---
## 🔍 Key Features
- Data cleaning and region-based splitting
- Removal of multicollinear features (correlation > 85%)
- Feature scaling us …