Ridge Regression model predicting Fire Weather Index from weather and fire-index data (Algerian Forest Fires dataset). R²: 0.984, MAE: 0.564. Flask app, deployed with Gunicorn.
# Algerian Forest Fire Predictor
End-to-end ML lifecycle project predicting forest fire risk (FWI — Fire Weather Index) from weather and regional data, built on the Algerian Forest Fires dataset. Served as a Flask web app.
---
## What it does
A user enters weather/fire-index readings through a web form, and a trained Ridge Regression model predicts the Fire Weather Index (FWI) — a measure of forest fire risk.
**Input features:**
- Temperature
- RH (Relative Humidity)
- Ws (Wind speed)
- Rain
- FFMC (Fine Fuel Moisture Code)
- DMC (Duff Moisture Code)
- ISI (Initial Spread Index)
- Classes (fire / not fire, from the source dataset)
- Region
Inputs are scaled using a pre-fit `StandardScaler` before being passed to the Ridge Regression model.
---
## Tech stack
**Backend:** Flask
**ML:** scikit-learn (Ridge Regression, StandardScaler)
**Data handling:** pandas, numpy
**EDA/visualization:** matplotlib, seaborn
**Deployment:** Gunicorn, configured for platforms like Render (reads `PORT` from environment)
---
## Project structure
```
.
├── application.py # Flask app — home page + prediction route
├── models/
│ ├── ridge.pkl # Trained Ridge Regression model
│ └── scaler.pkl # Fitted StandardScaler
├── noteboooks/
│ ├── 2.0-EDA And FE Algerian Forest Fires.ipynb # Exploratory data analysis + feature engineering
│ ├── 3.0-Model Training.ipynb # Model training and evaluation
│ └── Algerian_forest_fires_dataset_UPDATE.csv # Source dataset
├── templates/
│ ├── index.html
│ └── home.html # Prediction form + results
└── requirements.txt
```
---
## How it works
1. `noteboooks/2.0-EDA And FE Algerian Forest Fires.ipynb` — exploratory analysis and feature engineering on the Algerian Forest Fires dataset.
2. `noteboooks/3.0-Model Training.ipynb` — trains the Ridg …