Skip to content

Jewelglory/maleria_detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🦟 Malaria Pre-Diagnosis Prediction App

A machine learning web application that predicts malaria strain type from patient symptoms and vitals — before lab tests are conducted.

Project Structure

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

Setup & Run

# 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.py

Model Details

Three 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.

Features Used (30 total)

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

Disclaimer

This tool is for clinical decision support only. It does not replace laboratory diagnosis.

About

A web application that predicts whether a patient has malaria and identifies the specific strain (P. falciparum, P. malariae, or P. vivax) based on symptoms, vitals, and medical history, before lab tests are conducted. It uses three independently trained machine learning models and displays results with confidence scores.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages