A machine learning project that analyzes and forecasts crime trends in South Africa using SAPS and Stats SA datasets. Includes classification of crime hotspots, time series forecasting, interactive Streamlit dashboard, and drone simulation for crime monitoring.
# 🧠 Crime Hotspot Classification and Forecasting in South Africa
---
## Project Overview
Crime in South Africa remains one of the country’s most pressing social and economic challenges.
This project applies **Machine Learning (Classification and Time Series Forecasting)** to identify crime hotspots and predict future crime trends.
The goal is to turn raw SAPS statistics into actionable intelligence that can guide **law enforcement** and **policy decisions**.
Additionally, a **Streamlit Dashboard** was developed to make the analysis interactive and easy to interpret.
Finally, a **Drone Simulation** was designed to illustrate how autonomous systems could monitor high-crime areas efficiently.
---
## Datasets
| Dataset Name | Source | Description | Purpose |
|---------------|---------|-------------|----------|
| `aggravated_robbery_incidents_by_category.csv` | SAPS Open Data | Records the number of aggravated robbery incidents per province and financial year. | Used for classification and forecasting models. |
| `ProvincePopulation.csv` | Statistics South Africa (Stats SA) | Provides population, area, and density per province. | Provides contextual socio-economic data and supports the multi-relational merge. |
### Dataset Justification
- **Relevance:** Both datasets directly support the tasks of classification (crime hotspots) and forecasting (crime trends).
- **Completeness:** Data spans multiple years and covers all provinces in South Africa.
- **Credibility:** Both datasets are sourced from **official South African government** data providers.
- **Limitations:** Some datasets may have underreporting or differences in data collection across years.
---
## Data Cleaning and Preparation
- Columns were standardized (lowercased, stripped spaces).
- Missing values were handled and unnecessary columns removed.
- Datasets were merged using the common field `province`.
- A new column `incident_count` was created from the `count` field for consistency.
- A binary co …