This project is a Machine Learning web application that predicts the Fire Weather Index (FWI) using meteorological and environmental parameters. The model is trained using the Algerian Forest Fires Dataset, which contains weather observations and fire occurrence records collected from two regions of Algeria.
The goal of this project is to demonstrate the end-to-end Machine Learning workflow, including:
- Data Cleaning
- Exploratory Data Analysis (EDA)
- Feature Engineering
- Model Training
- Model Evaluation
- Deployment using Flask Web Framework
Users can input environmental parameters through a web interface, and the trained machine learning model predicts the Fire Weather Index value, which indicates the potential risk of forest fires.
The Fire Weather Index (FWI) is a numerical rating system used worldwide to estimate the intensity of forest fires based on weather conditions.
It combines multiple environmental factors such as:
- Temperature
- Humidity
- Wind speed
- Rainfall
- Fuel moisture
A higher FWI value indicates a higher probability and intensity of fire spread.
Typical interpretation:
| FWI Value | Fire Risk |
|---|---|
| < 5 | Low |
| 5 – 20 | Moderate |
| > 20 | High |
This project uses the Algerian Forest Fires Dataset.
Dataset characteristics:
- 244 observations
- Collected from Bejaia region and Sidi Bel-Abbes region
- Weather and fire occurrence data
Features used in the model:
| Feature | Description |
|---|---|
| Temperature | Air temperature in Celsius |
| RH | Relative Humidity (%) |
| Ws | Wind Speed (km/h) |
| Rain | Rainfall amount (mm) |
| FFMC | Fine Fuel Moisture Code |
| DMC | Duff Moisture Code |
| ISI | Initial Spread Index |
| Classes | Fire occurrence indicator |
| Region | Geographic region |
Target Variable:
- FWI (Fire Weather Index)
The project follows a standard ML pipeline:
- Handling missing values
- Removing inconsistent entries
- Converting categorical variables
- Distribution analysis
- Correlation analysis
- Outlier detection
- Encoding categorical features
- Scaling numerical features using StandardScaler
Multiple regression models were explored:
- Linear Regression
- Ridge Regression
- Lasso Regression
- ElasticNet Regression
Models were evaluated using:
- R² Score
- Mean Absolute Error
- Mean Squared Error
The best performing model was selected for deployment.
A simple Flask-based web application was built to allow users to interact with the trained model.
Users provide the following environmental values:
- Temperature
- Relative Humidity
- Wind Speed
- Rainfall
- FFMC
- DMC
- ISI
- Classes
- Region
The application processes these inputs and returns the predicted Fire Weather Index.
linear-regression-project
│
├── notebooks
│ ├── Data_cleaning_observation.ipynb
│ └── Regularizations_and_CrossValidation.ipynb
│
├── templates
│ └── home.html
│
├── application.py
├── requirements.txt
├── README.md
└── .gitignore
Clone the repository:
git clone https://github.com/yourusername/linear-regression-project.gitNavigate to the project directory:
cd linear-regression-projectCreate a virtual environment:
python -m venv venvActivate the environment:
Windows
venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtRun the Flask app:
python application.pyOpen your browser and go to:
http://127.0.0.1:5000/
You will see the FWI Prediction Interface where you can enter weather parameters and obtain predictions.
- Enter weather parameters in the form
- Click Predict
- The trained machine learning model processes the inputs
- The predicted Fire Weather Index value is displayed
- Python
- Pandas
- NumPy
- Scikit-learn
- Matplotlib
- Seaborn
- Flask
- HTML / CSS
Through this project, the following concepts are demonstrated:
- End-to-end Machine Learning workflow
- Data preprocessing and feature engineering
- Regularization techniques (Ridge, Lasso, ElasticNet)
- Model evaluation techniques
- Deployment of ML models using Flask
- Building simple ML web applications
Possible improvements for this project:
- Deploy the application using Docker
- Host the model on AWS / Render / Railway
- Add interactive visualizations
- Include automatic input validation
- Use REST API for predictions
Shibam Sadhukhan
Machine Learning Enthusiast | Data Science Learner
Please consider starring the repository on GitHub.