Datasets:
tags:
- synthetic
- synthetic-data
- tabular-classification
- traditional-medicine
- safety
- africa
- healthcare
- pharmacovigilance
task_categories:
- tabular-classification
- other
task_ids:
- tabular-multi-class-classification
language: []
pretty_name: Traditional Medicine Safety Dataset
size_categories:
- 10K<n<100K
Traditional Medicine Safety Dataset
Description
A synthetic tabular dataset for traditional and complementary medicine safety in African populations. Models safety risks in the most widely used healthcare system on the continent.
Dataset Statistics
| Property | Value |
|---|---|
| Total rows | 10,000 |
| Positive cases (label=1) | 5,000 |
| Control cases (label=0) | 5,000 |
| Countries represented | 20 |
| Temporal coverage | 2019–2024 |
| Features (raw + engineered) | 40+ |
| Missing values | 0% (complete synthetic dataset) |
| Data type | Tabular CSV |
| Random seed | 42 |
Class Balance & Distribution
The dataset is perfectly balanced (50/50) to prevent class-imbalance bias in downstream models. Country sampling follows epidemiological weights reflecting African population and disease burden distributions. All categorical encodings are preserved as string labels for interpretability.
Research Gap
80% of Africans use traditional medicine but there is virtually no structured safety data. Herb-drug interactions, hepatotoxicity, practitioner regulation, dosage standardisation, and paediatric vulnerability are all critically underdocumented.
African Healthcare Context
- 80% use traditional medicine as primary care
- <10% of healers are registered
- Hepatotoxicity is a leading cause of acute liver failure
- Limited integration policies outside South Africa, Ghana, Nigeria
- Bioprospecting concerns complicate research
Intelligence Sources
| Source | URL |
|---|---|
| WHO TM Strategy | https://www.who.int/publications/i/item/9789240033895 |
| African Union | https://au.int/ |
| SA TMC | https://tmc.co.za/ |
| NMEDA Nigeria | https://nmeda.gov.ng/ |
Columns
| Column | Type | Description |
|---|---|---|
| country | string | Country |
| patient_age | int | Age |
| gender | string | Gender |
| practitioner_type | string | Type |
| years_practicing | int | Experience |
| reason_for_visit | string | Condition |
| herb_type | string | Herb type |
| preparation_method | string | Preparation |
| administration_route | string | Route |
| dosage_known | int | Known |
| frequency_daily | int | Frequency |
| duration_weeks | int | Duration |
| concurrent_western_meds | string | Concurrent |
| disclosure_to_doctor | int | Disclosure |
| adverse_event | string | Event |
| severity | string | Severity |
| time_to_onset_days | int | Onset |
| outcome | string | Outcome |
| hospitalisation_required | int | Hospital |
| previous_adverse_events | int | Prior |
| registration_status | int | Registered |
| quality_control | int | QC |
| label | int | 1 = adverse, 0 = safe |
Engineered Features
| Feature | Description |
|---|---|
| practitioner_experience_score | Years + registration + QC |
| herb_risk_score | Prep + route + dosage + frequency |
| concurrent_med_risk | Interaction severity |
| care_integration_score | Disclosure - risk |
| patient_vulnerability | Age + prior events |
| event_severity_score | Weighted severity |
| high_risk_traditional | Composite flag |
Feature Engineering Methodology
Composite scores are constructed using domain-specific weights derived from literature and clinical guidelines. Each score is rounded to 2 decimal places for reproducibility. Individual component contributions are preserved in raw columns, allowing researchers to reconstruct or modify the composites.
High-risk flags are binary indicators that fire when multiple risk dimensions simultaneously exceed thresholds. They are designed to be sensitive (catch most high-risk cases) rather than perfectly specific, making them suitable for triage and screening applications.
Feature Importance Notes
Based on preliminary Random Forest analysis:
- Composite risk scores typically rank in the top-5 most important features
- Country indicator variables provide strong geographic signal
- Temporal features (year, season) capture secular trends
- Interaction effects between infrastructure and patient-level variables are significant
- Always validate feature importance on held-out test sets to avoid leakage
Supported Use Cases
- Adverse event prediction
- Herb-drug interaction modelling
- Practitioner risk profiling
- QC benchmarking
- Integration policy design
- Paediatric safety
- Regulatory evaluation
Advanced Modelling Approaches
- Survival analysis: For datasets with time-to-event outcomes, Cox proportional hazards can model risk trajectories
- Multi-task learning: Jointly predict label and intermediate outcomes (e.g., complication type, severity grade)
- Cost-sensitive learning: Weight false negatives higher than false positives in screening applications
- Uncertainty quantification: Use conformal prediction or Bayesian methods to flag low-confidence predictions for human review
- Causal inference: Propensity score matching on facility type or country to estimate intervention effects
- Federated learning: Train models across simulated hospital nodes without centralising data
- Explainable AI: SHAP and LIME values help clinicians understand model-driven risk scores
Usage
from datasets import load_dataset
dataset = load_dataset("electricsheepafrica/africa-traditional-medicine-safety", split="train")
df = dataset.to_pandas()
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report, roc_auc_score
df = pd.read_csv("data/processed/traditional_features.csv")
X = df.select_dtypes(include=["int", "float"]).drop(columns=["label"])
y = df["label"]
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, stratify=y, random_state=42)
clf = RandomForestClassifier(random_state=42)
clf.fit(X_train, y_train)
print(classification_report(y_test, clf.predict(X_test)))
print("ROC-AUC:", roc_auc_score(y_test, clf.predict_proba(X_test)[:, 1]))
Data Generation
- Positive cases with adverse events and risky use
- Controls with safe use and known dosages
- Leakage filtering for no events
- Balanced 5,000 + 5,000
- Experience, risk, and vulnerability features
- Seed 42
Preprocessing Recommendations
- One-hot encode categorical columns (country, facility type, region, etc.)
- Standardise continuous features (z-score or MinMax) for distance-based models
- Stratify by country when splitting to ensure geographic representation
- Use SMOTE or class weighting if subsampling; the dataset is already balanced
- Cross-validation: use 5-fold stratified CV grouped by country to detect overfitting to specific nations
- Feature selection: engineered composite scores are highly informative; evaluate against raw features
- Leakage check: ensure
label-derived columns (outcome, diagnosis stage) are excluded from feature sets
Baseline Performance Expectations
| Model | Expected Accuracy | Expected ROC-AUC | Notes |
|---|---|---|---|
| Logistic Regression | 0.72–0.78 | 0.78–0.84 | Good interpretability baseline |
| Random Forest | 0.82–0.88 | 0.88–0.93 | Handles non-linear interactions well |
| XGBoost / LightGBM | 0.85–0.91 | 0.91–0.95 | Best tabular performance |
| Neural Network (MLP) | 0.80–0.86 | 0.85–0.90 | Requires scaling; risk of overfitting |
| Linear SVM | 0.74–0.80 | 0.80–0.85 | Sensitive to scaling |
These are approximate ranges on a stratified train/test split (80/20). Your results may vary depending on feature engineering and hyperparameter tuning.
Statistical Properties
- Positive cases are sampled from distributions centred on high-risk clinical profiles with intentional overlap to reflect real-world heterogeneity
- Control cases are sampled from low-risk profiles but retain realistic variance; ~10% of controls may show minor risk indicators
- Leakage filtering removes controls that would clinically be classified as positive, ensuring clean class separation
- Country weights are derived from WHO/UNICEF burden estimates and population sizes
- Correlation structure: engineered features intentionally correlate with raw clinical indicators; avoid double-counting in linear models
- Noise injection: continuous variables include uniform noise to prevent overfitting to exact synthetic thresholds
- Temporal consistency: year, season, and weather anomalies are coherently generated (e.g., drought months correlate with yield reductions)
Validation Checklist
Before using this dataset for research or production:
- Verify class balance in your train/test splits
- Check for unexpected correlations between engineered features and labels
- Validate that high-risk flags behave as expected on edge cases
- Confirm country stratification does not dominate model predictions spuriously
- Test model generalisation by holding out one or more countries entirely
Limitations
- Synthetic data
- Simplified herb categories
- Binary outcome
Ethical Considerations
- Respect traditional knowledge systems
- Avoid stigmatising healers or users
- Support integration
- Community consent
- Protect practitioner identities
Data Governance & Protection
- Anonymisation: All records are synthetic; no real patient, household, or facility identifiers are present
- Synthetic data validation: Before deployment, validate that synthetic distributions match real-world surveillance data in target countries
- Community engagement: Consult local health authorities and communities before deploying predictive tools
- Algorithmic fairness: Audit models for performance disparities across countries, genders, and socioeconomic strata
- Right to explanation: When used in clinical or policy decision-making, provide interpretable model outputs
- Data retention: Follow institutional and national data protection policies for any real data collected subsequently
- Benefit sharing: Ensure that communities contributing to or represented in the data benefit from resulting tools and insights
- Open science: Publish methodology, code, and model cards alongside any peer-reviewed findings
Recommended Splits
- Train: 70%
- Validation: 15%
- Test: 15%
Citation
@dataset{traditional_medicine_africa_2024,
title = {Traditional Medicine Safety Dataset},
author = {Electric Sheep Africa},
year = {2024},
url = {https://huggingface.co/datasets/electricsheepafrica/africa-traditional-medicine-safety}
}
License
CC BY-SA 4.0
Contact
Version History
- v1.0 — Initial release