# Logistic Regression for Algerian Forest Fire Prediction
## Project Overview
This project uses **Logistic Regression** to predict the occurrence of forest fires in Algeria based on the Algerian Forest Fires dataset. The project is implemented in a Jupyter notebook (`Logistic Regression using Algerian Forest Fire dataset.ipynb`) using Python and libraries such as scikit-learn, pandas, numpy, seaborn, and matplotlib. The notebook includes data loading, cleaning, exploratory data analysis (EDA), preprocessing, model training, evaluation, and model persistence using pickling.
The goal is to classify whether a fire occurred (`fire`) or not (`not fire`) based on meteorological and fire weather index features. The model achieves an accuracy of 96% on the test set, with detailed performance metrics including precision, recall, F1-score, and confusion matrix.
## Dataset
The **Algerian Forest Fires dataset** contains 246 records from two regions in Algeria: Bejaia and Sidi Bel-Abbes, collected between June and September 2012. The dataset includes 14 features:
- **Date-related features**: day, month, year
- **Meteorological features**: Temperature, RH (Relative Humidity), Ws (Wind Speed), Rain
- **Fire Weather Index (FWI) components**: FFMC (Fine Fuel Moisture Code), DMC (Duff Moisture Code), DC (Drought Code), ISI (Initial Spread Index), BUI (Buildup Index), FWI (Fire Weather Index)
- **Target variable**: Classes (binary: `fire` or `not fire`)
- **Derived feature**: region (0 for Bejaia, 1 for Sidi Bel-Abbes)
**Source**:
- UCI Machine Learning Repository
- Kaggle
**Note**: The dataset file (`Algerian_forest_fires_dataset_UPDATE.csv`) is required to run the notebook. Download it from the above sources and place it in the project directory.
## Requirements
To run the notebook, you need the following Python libraries:
- pandas
- numpy
- seaborn
- matplotlib
- scikit-learn
- statsmodels
Install the dependencies using pip:
```bash
pip install pandas numpy seaborn matplotl …