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.
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)
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.
- 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
git clone https://github.com/amritrajrajput/testforestfires.git
cd testforestfirespython -m venv env
source env/bin/activate # (Linux/macOS)
env\Scripts\activate # (Windows)pip install -r requirements.txt(If requirements.txt is not yet created, you can generate it using:)
pip freeze > requirements.txtStart the Flask app:
python application.pyThen 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: 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
| Model | Description | Evaluation Metric |
|---|---|---|
| Linear Regression | Baseline model | R², MAE |
| Ridge Regression | Regularized model to prevent overfitting | R², MSE |
| Multiple Regression | Combines multiple predictors | R² |
lr.ipynb– Linear Regression model training and visualizationmr.ipynb– Multiple and Ridge Regression models comparison
Each notebook includes:
- Data cleaning
- Feature engineering
- Model training
- Performance visualization
- 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
Amrit Raj Rajput
🌐 LinkedIn
🔗 Linktree
This project is open-source and available under the MIT License.