# Algerian Forest Fire Prediction Project
This is my end-to-end Machine Learning project where I built a web application that can **predict the chances of a forest fire** in Algeria based on different weather and environmental features.
I worked on data preprocessing, model training, evaluation, and deployment using Flask.
## Project Summary
The main goal of this project is to help understand how different weather conditions (like temperature, humidity, wind, and rain) affect the possibility of forest fires.
I used a public dataset from the UCI Machine Learning Repository which contains real meteorological data from two regions in Algeria — **Bejaia** and **Sidi Bel-abbes**.
I trained and tested multiple regression models and finally selected the **Lasso Regression** model as it gave me the best results.
## Dataset Details
**Dataset Name:** Algerian Forest Fires Dataset
**Source:** UCI Machine Learning Repository
**Features used in this project:**
- Temperature (°C)
- Relative Humidity (%)
- Wind Speed (km/h)
- Rain (mm)
- Fine Fuel Moisture Code (FFMC)
- Duff Moisture Code (DMC)
- Drought Code (DC)
- Initial Spread Index (ISI)
- Class (Fire / Not Fire)
The dataset has two regions of data — **Bejaia** and **Sidi Bel-abbes** — collected during the summer of 2012.
## Tools and Technologies
- Python (v3.10)
- Flask (for web app)
- Pandas, NumPy (for data handling)
- Scikit-learn (for ML algorithms)
- Matplotlib, Seaborn (for visualization)
- Pickle (for saving models)
- HTML, CSS (for frontend)
## Model Comparison
I trained three models and compared their R² scores:
| Model | R² Score |
|--------|-----------|
| Linear Regression | 0.9497 |
| Ridge Regression | 0.9501 |
| **Lasso Regression** | **0.9543**|
Based on this, I selected **Lasso Regression** as my final model since it performed the best.
## Project Workflow
1. **Data Preprocessing**
- Cleaned missing values
- Encoded labels and scaled numerical data using `StandardScaler`
2. **Model Training** …