A machine learning web application that predicts malaria strain type from patient symptoms and vitals — before lab tests are conducted.
malaria_project/
├── app.py ← Streamlit web app (main entry point)
├── train_models.py ← Full training pipeline (run this first)
├── group01.csv ← Hospital patient dataset (317 usable records)
├── models/ ← Trained model files (generated by train_models.py)
│ ├── falciparum.pkl
│ ├── malariae.pkl
│ ├── vivax.pkl
│ └── meta.pkl
├── malariapic.jpg ← App image asset
├── requirements.txt
└── README.md
# 1. Install dependencies
pip install -r requirements.txt
# 2. Train models (only needed once, or to retrain)
python train_models.py
# 3. Launch the app
streamlit run app.pyThree separate Random Forest Classifiers (sklearn Pipeline with StandardScaler), one per malaria strain:
| Strain | Positive Cases | Accuracy | ROC-AUC | CV F1 |
|---|---|---|---|---|
| P. falciparum | 153 / 317 | 84% | 0.86 | 0.68 ± 0.09 |
| P. malariae | 34 / 317 | 92% | 0.80 | 0.28 ± 0.05 |
| P. vivax | 120 / 317 | 78% | 0.82 | 0.74 ± 0.05 |
P. malariae has low CV F1 due to severe class imbalance (~11% positive).
class_weight='balanced'is applied.
Symptoms (duration in days): Fever grade, Headache, Body ache, Vomiting, Chills, Cough, Weakness, Loose stool
Severe symptoms (binary): Abdominal discomfort, Breathlessness, Rigors, Decreased appetite, Nausea, Urinal variation, Pallor, Icterus, Cyanosis, Lymphadenopathy, Diet-mixed, Drowsy, Discomfort, Abnormal appetite, Abnormal sleep
Vitals & history: Blood pressure (encoded 0–5), Pulse rate, Respiratory rate, Temperature (°F), Diabetes, Previous malaria history, Bronchial condition
This tool is for clinical decision support only. It does not replace laboratory diagnosis.