| --- |
| tags: |
| - 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 |
| dataset_info: |
| features: |
| - name: country |
| dtype: string |
| - name: patient_age |
| dtype: int64 |
| - name: gender |
| dtype: string |
| - name: practitioner_type |
| dtype: string |
| - name: years_practicing |
| dtype: int64 |
| - name: reason_for_visit |
| dtype: string |
| - name: herb_type |
| dtype: string |
| - name: preparation_method |
| dtype: string |
| - name: administration_route |
| dtype: string |
| - name: dosage_known |
| dtype: int64 |
| - name: frequency_daily |
| dtype: int64 |
| - name: duration_weeks |
| dtype: int64 |
| - name: concurrent_western_meds |
| dtype: string |
| - name: disclosure_to_doctor |
| dtype: int64 |
| - name: adverse_event |
| dtype: string |
| - name: severity |
| dtype: string |
| - name: time_to_onset_days |
| dtype: int64 |
| - name: outcome |
| dtype: string |
| - name: hospitalisation_required |
| dtype: int64 |
| - name: previous_adverse_events |
| dtype: int64 |
| - name: registration_status |
| dtype: int64 |
| - name: quality_control |
| dtype: int64 |
| - name: label |
| dtype: int64 |
| - name: practitioner_experience_score |
| dtype: float64 |
| - name: herb_risk_score |
| dtype: float64 |
| - name: concurrent_med_risk |
| dtype: float64 |
| - name: care_integration_score |
| dtype: float64 |
| - name: patient_vulnerability |
| dtype: float64 |
| - name: event_severity_score |
| dtype: float64 |
| - name: high_risk_traditional |
| dtype: float64 |
| splits: |
| - name: train |
| num_bytes: 2845971 |
| num_examples: 10000 |
| download_size: 137715 |
| dataset_size: 2845971 |
| configs: |
| - config_name: default |
| data_files: |
| - split: train |
| path: data/train-* |
| --- |
| |
| # 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 |
| |
| ```python |
| from datasets import load_dataset |
|
|
| dataset = load_dataset("electricsheepafrica/africa-traditional-medicine-safety", split="train") |
| df = dataset.to_pandas() |
| ``` |
| |
| ```python |
| 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 |
| 1. Positive cases with adverse events and risky use |
| 2. Controls with safe use and known dosages |
| 3. Leakage filtering for no events |
| 4. Balanced 5,000 + 5,000 |
| 5. Experience, risk, and vulnerability features |
| 6. Seed 42 |
| |
| ## Preprocessing Recommendations |
| |
| 1. **One-hot encode** categorical columns (country, facility type, region, etc.) |
| 2. **Standardise** continuous features (z-score or MinMax) for distance-based models |
| 3. **Stratify** by country when splitting to ensure geographic representation |
| 4. **Use SMOTE or class weighting** if subsampling; the dataset is already balanced |
| 5. **Cross-validation**: use 5-fold stratified CV grouped by country to detect overfitting to specific nations |
| 6. **Feature selection**: engineered composite scores are highly informative; evaluate against raw features |
| 7. **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 |
| ```bibtex |
| @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 |
| electricsheepafrica@proton.me |
| |
| ## Version History |
| - v1.0 — Initial release |
| |