# Algerian Forest Fire FWI Prediction App
A **real-time Fire Weather Index (FWI) prediction web application** built with **Flask**, **Scikit-learn**, and **Ridge Regression**. Uses the **Algerian Forest Fires Dataset** to predict fire danger based on weather and fuel conditions.
---
## Features
- **Real-time FWI Prediction** via interactive web form
- **Side-by-side layout**: Input on left, result with **animated fire** on right
- **Fire Status & Region** dropdowns (Bejaia / Sidi Bel-abbes)
- **ISI field highlighted** for emphasis
- **Responsive & Mobile-Friendly**
- **Glassmorphism UI** with floating fire sparks
- **No rounding** — exact model output
- **Trained on 244 real fire events (2012)**
---
## Dataset
- **Source**: Algerian Forest Fires Dataset
- **Regions**: Bejaia (0), Sidi Bel-abbes (1)
- **Features Used**:
- `Temperature`, `RH`, `Ws`, `Rain`
- `FFMC`, `DMC`, `ISI`
- `Classes` (fire / not fire)
- `Region`
---
## Model Performance
| Model | R² Score | MAE |
|---------------|----------|------|
| **Ridge Regression** | **0.98** | **0.45** |
| Lasso | 0.96 | 0.72 |
| Linear | 0.97 | 0.58 |
**Ridge selected** for best balance of accuracy & robustness.
---
## Tech Stack
| Technology | Purpose |
|------------------|--------|
| **Python** | Core logic |
| **Flask** | Web framework |
| **Scikit-learn** | Model training & scaling |
| **Pandas/NumPy** | Data processing |
| **HTML/CSS/JS** | Frontend (glassmorphism + animations) |
| **Bootstrap 5** | Responsive design |
| **Pickle** | Model persistence |
---
## Project Structure
Algerian-Forest-Fire-Prediction/
│
├── application.py # Flask app
├── model/
│ ├── ridge.pkl # Trained model
│ └── Scaler.pkl # StandardScaler
├── templates/
│ ├── index.html # Landing page
│ └── home.html …