Skip to content

Repository files navigation

🌲 Algerian Forest Fires Prediction

A Machine Learning project that analyzes and predicts forest fire occurrences in Algeria based on meteorological and environmental data.
This project uses multiple regression techniques to identify critical factors influencing forest fires and provides a deployable web application for real-time prediction.


📂 Project Structure

testforestfires/
├── model/                              # Serialized ML models (Pickle files)
├── notebook/                           # Jupyter notebooks for data exploration & training
│   ├── lr.ipynb                        # Linear Regression model training
│   ├── mr.ipynb                        # Multiple/Ridge Regression model training
├── templets/                           # HTML templates for the Flask app
├── Algerian_forest_fires_dataset_UPDATE.csv    # Original dataset
├── algerian_forest_fires_cleaned_dataset.csv   # Preprocessed dataset
├── application.py                      # Flask application for model deployment
├── train_ridge.py                      # Script to train Ridge Regression model
├── test_pickle.py                      # Testing serialized model loading
└── README.md                           # Project documentation (this file)

🔍 Overview

The Algerian Forest Fires Dataset includes temperature, humidity, wind speed, rainfall, and FWI (Fire Weather Index) data collected from two regions in Algeria.
Using this dataset, the project builds and compares multiple regression models to predict whether conditions are favorable for forest fires.


🎯 Objectives

  • Clean and preprocess the dataset for analysis
  • Train different regression models:
    • Linear Regression
    • Ridge Regression
    • Multiple Regression
  • Evaluate model performance
  • Deploy the best-performing model using a Flask web interface

⚙️ Installation and Setup

1. Clone the repository

git clone https://github.com/amritrajrajput/testforestfires.git
cd testforestfires

2. Create a virtual environment

python -m venv env
source env/bin/activate    # (Linux/macOS)
env\Scripts\activate       # (Windows)

3. Install dependencies

pip install -r requirements.txt

(If requirements.txt is not yet created, you can generate it using:)

pip freeze > requirements.txt

🚀 Run the Application

Start the Flask app:

python application.py

Then open your browser and navigate to:

http://127.0.0.1:5000/

You can input temperature, humidity, rainfall, and other factors to get fire risk predictions.


📊 Dataset Information

Dataset: Algerian Forest Fires Dataset (UCI Machine Learning Repository)
Attributes:

  • Temperature (°C)
  • RH (Relative Humidity)
  • WS (Wind Speed)
  • Rain (mm/m²)
  • FWI (Fire Weather Index)
  • Region
  • Date
  • Classes: Fire / No Fire

🧠 Models Used

Model Description Evaluation Metric
Linear Regression Baseline model R², MAE
Ridge Regression Regularized model to prevent overfitting R², MSE
Multiple Regression Combines multiple predictors

🧪 Notebooks

  • lr.ipynb – Linear Regression model training and visualization
  • mr.ipynb – Multiple and Ridge Regression models comparison

Each notebook includes:

  • Data cleaning
  • Feature engineering
  • Model training
  • Performance visualization

💡 Future Improvements

  • Add classification models (e.g., Random Forest, SVM) for binary fire/no-fire prediction
  • Integrate live weather data APIs
  • Build a dashboard for data visualization (Streamlit / Dash)
  • Containerize the app using Docker

👨‍💻 Author

Amrit Raj Rajput
🌐 LinkedIn
🔗 Linktree


🏷️ License

This project is open-source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages