# π₯ Algerian Forest Fire Predictor
> Predict forest fire risk in Algerian regions using machine learning and meteorological data.
> Built with regression models, Flask, and deployed on Render.
---
## π Dataset
The dataset is sourced from Kaggle and includes meteorological data from two Algerian regions relevant to forest fire prediction.
**Included files:**
- `Algerian_forest_fires_dataset_UPDATE.csv` β raw dataset
- `Algerian_forest_fires_cleaned_dataset.csv` β cleaned and preprocessed version
---
## π§ͺ Feature Engineering
Preprocessing and transformation steps are documented in the notebook:
π `Algerian forest - Ridge, Lasso Regression(1).ipynb`.ipynb)
**Key steps:**
- Removal of missing or incorrect values
- Encoding categorical variables (e.g., `Region`)
- Feature correlation analysis and dimensionality reduction
- Input scaling using `StandardScaler`
---
## π§ Model Training
The following regression models were trained and evaluated:
- Linear Regression
- Lasso Regression
- Ridge Regression β
- ElasticNet Regression
π **Final Model**: Ridge Regression
π **RΒ² Score**: 98.4% (via cross-validation)
---
## πΎ Model Artifacts
- `ridgecv.pkl` β Trained Ridge Regression model
- `scaler.pkl` β Fitted `StandardScaler` for preprocessing
---
## π Flask Web App
A lightweight web application built using Flask to make real-time predictions from user input.
**File structure:**
```
application.py β Flask backend script
index.html β User input form (served directly)
ridgecv.pkl β Trained model
scaler.pkl β Scaler for input normalization
requirements.txt β Python dependencies
````
### βΆοΈ Run Locally
```bash
pip install -r requirements.txt
python application.py
````
Then open your browser and go to:
127.0.0.1
---
## π Deployment
The app is deployed using Render.
π **Live App**:
algerian-forest-fire-predicβ¦
---
## π¨βπ» Author
Created by **Sayanjib Sur**
As pa β¦