# π₯ Algerian Forest Fire Prediction using Machine Learning
This project predicts the **Fire Weather Index (FWI)** based on meteorological data from the Algerian Forest Fire dataset. It includes complete preprocessing, model training with regression algorithms, evaluation, and deployment using **Flask** and **AWS Elastic Beanstalk**. A **CI/CD pipeline** is also configured using **AWS CodePipeline**.
---
## π Problem Statement
The goal is to build a regression model that can predict the Fire Weather Index (FWI), which quantifies the fire risk, based on various environmental and meteorological parameters. The project also includes feature selection, model tuning, and deployment for real-world input predictions.
---
## π Dataset
- **Source**: Algerian Forest Fire Dataset (
kaggle.com)
- **Features**: Temperature, RH, WS, Rain, FFMC, DMC, DC, ISI, BUI, etc.
- **Target**: FWI (Fire Weather Index)
- **Cleaning**: Dropped date columns, encoded categorical target column (`Classes` β binary).
---
## βοΈ Tech Stack
- **Languages**: Python
- **Libraries**: pandas, numpy, seaborn, matplotlib, scikit-learn
- **ML Models**: Linear Regression, Ridge, Lasso, ElasticNet, with CV
- **Deployment**: Flask, AWS Elastic Beanstalk
- **CI/CD**: AWS CodePipeline, GitHub, S3
---
## π Key Steps
### β
1. Data Preprocessing
- Dropped non-relevant columns (`day`, `month`, `year`)
- Label encoded `Classes` feature (Fire / Not Fire)
- Feature selection using correlation analysis (> 0.85 threshold)
- Feature scaling using `StandardScaler`
### β
2. Model Training
- Trained multiple regression models:
- Linear Regression
- Ridge, Lasso, ElasticNet
- RidgeCV, LassoCV, ElasticNetCV for hyperparameter tuning
- Evaluated with Mean Absolute Error and RΒ² Score
### β
3. Web App
- Built a **Flask** web application that:
- Accepts user input via a form
- Applies saved preprocessing (`scaler.pkl`)
- Loads model (`ridge.pkl`)
- β¦