This project analyzes the effectiveness of preventive measures against malaria in African countries using machine learning techniques.
malaria/
├── malaria_analysis.py # Main analysis script
├── requirements.txt # Python dependencies
├── DatasetAfricaMalaria.csv # Input dataset (not included)
└── output/ # Generated visualizations
├── prevention_effectiveness_heatmap.png
└── prediction_accuracy_plot.png
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install required packages:
pip install -r requirements.txt
-
Place your
DatasetAfricaMalaria.csvfile in the project root directory -
Run the analysis script:
python malaria_analysis.py
-
Check the
outputdirectory for generated visualizations:prevention_effectiveness_heatmap.png: Shows correlation between preventive measures and malaria incidenceprediction_accuracy_plot.png: Displays model prediction accuracy with R² and RMSE metrics
The input CSV file should contain the following columns:
- country: Name of the African country
- bed_nets: Data about bed net usage
- antimalarial_medication: Data about antimalarial medication usage
- malaria_incidence: Target variable showing malaria cases
The script generates:
- A heatmap showing the effectiveness of different prevention methods across countries
- A prediction accuracy plot comparing actual vs. predicted malaria incidence
- Printed performance metrics (R² and RMSE)
The script includes error handling for:
- Missing input file
- Data loading issues
- Visualization creation errors
- Model training problems