Forest fires are a significant environmental concern, causing both ecological and economical damage, burning large land areas, and displacing communities. While forest ecosystems could once recover from naturally occurring fires, climate change—with its longer droughts and rising temperatures—has hindered this recovery process. Therefore, preventing wildfires or detecting them early to limit their damage is an increasingly important goal.
This project focuses on Algeria, one of many countries affected by this phenomenon. It uses Python-based machine learning and data science libraries to build a model capable of predicting forest fires based on meteorological data.
Given meteorological and locational data from two regions in Algeria, can we build a machine learning model to predict whether a forest fire will occur ("fire") or not ("not fire")?
The data for this project is a modified version of the Algerian Forest Fires Dataset, originally from the UCI Machine Learning Repository.
- Original Source: UCI ML Repository
- Dataset File:
ForestFire.csv
The dataset includes 243 instances covering forest fires across two regions of Algeria. It contains 11 attributes and 1 target attribute.
| Attribute | Description |
|---|---|
| Day | Day of the month |
| Month | Month of the year ('june' to 'september') |
| Temp | Temperature at noon (max) in Celsius (22 to 42) |
| RH | Relative Humidity in % (21 to 90) |
| Ws | Wind speed in km/h (6 to 29) |
| Rain | Total rain for the day in mm (0 to 16.8) |
| FFMC | Fine Fuel Moisture Code: Moisture of surface litter (key to ignition) |
| DMC | Duff Moisture Code: Moisture of shallow organic layers |
| DC | Drought Code: Moisture of deep organic layers |
| ISI | Initial Spread Index: Score correlating with fire velocity spread |
| BUI | Buildup Index: Combined cumulative effects of daily drying and precipitation |
| FWI | Fire Weather Index: Estimation of wildfire risk |
| Target | The target class: "Fire" or "not Fire" |
The analysis in the 2374707_notebook.ipynb follows this structure:
- Introduction: Defining the problem, data, and features.
- Data Description and Exploratory Analysis (EDA): Loading, cleaning, and visualizing the data to find patterns (e.g., frequency of fires by month, relationship between temperature, wind speed, and humidity).
- Building The Model:
- Preparing the data for modeling (splitting into train/test sets).
- Experimenting with different classification models (Logistic Regression, K-Nearest Neighbors, Random Forest).
- Discussion of Results: Analyzing model performance.
- Conclusion
- References
The goal for this proof-of-concept was to achieve over 92% accuracy in predicting wildfires.
The analysis was conducted using the following main Python libraries:
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-learn (for modeling and evaluation)