Ridge regression model that predicts the Fire Weather Index (FWI) from weather observations collected in two Algerian regions (Bejaia and Sidi-Bel Abbes).
# FWI Prediction — Algerian Forest Fires
Ridge regression model that predicts the **Fire Weather Index (FWI)** from weather observations collected in two Algerian regions (Bejaia and Sidi-Bel Abbes).
## Project structure
```
.
├── application.py # Flask app with /home and /predict endpoints
├── models/
│ ├── ridge.pkl # Trained Ridge model
│ └── scaler.pkl # StandardScaler used during training
├── notebooks/
│ └── ML_production_Project1.ipynb # EDA & model training
└── templates/
└── home.html # Web UI
```
## Setup
```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
## Run
```bash
python application.py
```
Visit `
127.0.0.1` for the web UI, or send a JSON POST to the same endpoint:
```bash
curl -X POST
127.0.0.1 \
-H "Content-Type: application/json" \
-d '{"Temperature":29,"RH":57,"Ws":18,"Rain":0.0,
"FFMC":65.7,"DMC":3.4,"ISI":1.3,"Classes":0,"region":0}'
```
### Input features
| Feature | Description |
|---------|-------------|
| Temperature | Temperature in °C |
| RH | Relative humidity (%) |
| Ws | Wind speed (km/h) |
| Rain | Rainfall (mm) |
| FFMC | Fine Fuel Moisture Code |
| DMC | Duff Moisture Code |
| ISI | Initial Spread Index |
| Classes | 0 = Not fire, 1 = Fire |
| Region | 0 = Bejaia, 1 = Sidi-Bel Abbes |
## API
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/predict` | GET | Web UI |
| `/predict` | POST | Returns `{"fwi": }` |