| --- |
| pretty_name: "Blood Donation Registry — Synthetic Donors, Prevalence & Compatibility" |
| license: cc-by-4.0 |
| language: |
| - en |
| size_categories: |
| - 10K<n<100K |
| task_categories: |
| - tabular-classification |
| - tabular-regression |
| tags: |
| - blood-donation |
| - transfusion |
| - healthcare-operations |
| - decision-support |
| - risk-scoring |
| - calibration |
| - thresholding |
| - synthetic |
| - tabular-data |
| annotations_creators: |
| - no-annotation |
| source_datasets: |
| - synthetic |
| configs: |
| - config_name: ml_ready |
| data_files: |
| - split: train |
| path: "data/blood_donation_registry_ml_ready.csv" |
| - config_name: population_distribution |
| data_files: |
| - split: train |
| path: "data/blood_population_distribution.csv" |
| - config_name: compatibility_lookup |
| data_files: |
| - split: train |
| path: "data/blood_compatibility_lookup.csv" |
| - config_name: data_dictionary |
| data_files: |
| - split: train |
| path: "data/data_dictionary.csv" |
| --- |
| |
| # 🩸 Blood Donation Registry — Synthetic Donors, Prevalence & Compatibility |
|
|
| Synthetic, decision-focused tables for blood donation operations: donor eligibility/deferrals, donation history, rare blood types, country-level prevalence, and RBC transfusion compatibility (ABO/Rh). |
|
|
| **Synthetic data** (safe for experimentation and teaching) |
| **Not clinical/medical ground truth** — do not use for real-world medical decisions. |
|
|
| --- |
|
|
| ## 📦 What’s inside |
|
|
| This repo provides **four loadable dataset configs** via `datasets.load_dataset`: |
|
|
| - **`ml_ready`** *(default / recommended)* → donor-level ML-ready table |
| - **`population_distribution`** → country-level blood type prevalence |
| - **`compatibility_lookup`** → RBC transfusion compatibility matrix (8×8) |
| - **`data_dictionary`** → column-level documentation (all files) |
|
|
| --- |
|
|
| ## 🚀 Quick start (Hugging Face) |
|
|
| ```python |
| from datasets import load_dataset |
| |
| repo_id = "tarekmasryo/blood-donation-registry-dataset" |
| |
| donors = load_dataset(repo_id, "ml_ready")["train"].to_pandas() |
| pop = load_dataset(repo_id, "population_distribution")["train"].to_pandas() |
| compat = load_dataset(repo_id, "compatibility_lookup")["train"].to_pandas() |
| |
| # Example join: add country population + Rh- rate to each donor |
| donors = donors.merge( |
| pop[["country_code", "population_size", "rh_negative_rate"]], |
| on="country_code", |
| how="left", |
| ) |
| print(donors.shape) |
| print(donors.head(3)) |
| ``` |
|
|
| > Tip: `load_dataset(repo_id)` will load the first config (here: `ml_ready`). |
| |
| --- |
| |
| ## 🗂️ Data files |
| |
| ### 1) `data/blood_donation_registry_ml_ready.csv` (30,000 rows × 27 columns) |
| |
| Donor-level snapshot with a fixed reference date: |
| |
| - `as_of_date = 2024-12-31` |
| |
| **Key groups** |
| |
| - **Identity & geography:** `donor_id` (unique), `country_code`, `region` |
| - **Profile:** `age`, `sex` (M/F), `bmi`, `smoker` (0/1), `chronic_condition_flag` (0/1) |
| - **Eligibility & deferrals:** `eligibility_status`, `eligible_to_donate` (0/1), `deferral_reason` |
| - **Donation behavior/history:** `donation_count_last_12m`, `lifetime_donation_count`, `first_donation_year`, |
| `years_since_first_donation`, `last_donation_date`, `recency_days`, `is_regular_donor` (0/1), |
| `donor_age_at_first_donation`, `preferred_site` |
| - **Blood context:** `blood_type` (8 types), `is_rare_type` (0/1), `blood_type_country_prevalence` |
| - **Engineered score (optional):** `donation_propensity_score` |
|
|
| **Outcome columns** |
|
|
| - `donated_next_6m` (0/1) |
| - `next_6m_donation_count` (0–3) |
|
|
| --- |
|
|
| ### 2) `data/blood_population_distribution.csv` (39 rows × 12 columns) |
|
|
| Country-level population + blood type prevalence: |
|
|
| - keys: `country_code`, `region` |
| - `population_size` |
| - proportions: `p_o_pos`, `p_o_neg`, `p_a_pos`, `p_a_neg`, `p_b_pos`, `p_b_neg`, `p_ab_pos`, `p_ab_neg` |
| - `rh_negative_rate` |
|
|
| **Integrity expectation:** blood type proportions sum to **1.0** per country. |
|
|
| --- |
|
|
| ### 3) `data/blood_compatibility_lookup.csv` (64 rows × 4 columns) |
|
|
| RBC transfusion compatibility matrix: |
|
|
| - `donor_blood_type`, `recipient_blood_type` |
| - `compatible_for_rbc_transfusion` (0/1) |
| - `compatibility_level`: `ideal | acceptable | incompatible` |
|
|
| --- |
|
|
| ### 4) `data/data_dictionary.csv` |
| |
| Column-level documentation for all files: |
| |
| - `file`, `column_name`, `type`, `description`, `allowed_values_or_range`, `missing_values` |
|
|
| --- |
|
|
| ## 🔗 Relationships |
|
|
| - `blood_donation_registry_ml_ready.country_code` |
| ↔ `blood_population_distribution.country_code` |
|
|
| - `blood_donation_registry_ml_ready.blood_type_country_prevalence` |
| is derived from the matching country prevalence proportions. |
|
|
| - `blood_compatibility_lookup` |
| provides rule-based compatibility for donor/recipient blood type pairs. |
|
|
| --- |
|
|
| ## 🧪 Recommended tasks |
|
|
| ### 1) Donation likelihood (binary classification) |
| - Target: `donated_next_6m` |
| - Suggested evaluation: ROC-AUC, PR-AUC, F1 + **calibration** (reliability curve / Brier score) |
|
|
| ### 2) Donation frequency (count prediction) |
| - Target: `next_6m_donation_count` |
| - Suggested evaluation: MAE, RMSE (optional Poisson/ordinal baselines) |
|
|
| ### 3) Decision policy under constraints |
| Turn probabilities into an outreach policy: |
| - choose an operating threshold under **capacity/budget** |
| - compare FP/FN tradeoffs |
| - validate stability across segments (region, rare types, eligibility) |
|
|
| ### 4) Rare-blood operations analytics |
| - analyze `is_rare_type` by country prevalence |
| - explore compatibility-aware matching using the lookup matrix |
|
|
| --- |
|
|
| ## 🧯 Modeling notes (avoid leakage / shortcuts) |
|
|
| - `donated_next_6m` is derived from `next_6m_donation_count` → use **one** outcome as the target. |
| - `eligible_to_donate` overlaps with `eligibility_status` → keep one for simpler baselines. |
| - `eligible_to_donate == 0` implies `donated_next_6m == 0` → for behavior modeling, consider training on `eligible_to_donate == 1`. |
| - `donation_propensity_score` is engineered; exclude it for “feature-only” benchmark baselines. |
|
|
| --- |
|
|
| ## ✅ Data quality expectations |
|
|
| - `donor_id` is unique (no duplicate donors) |
| - no duplicate rows |
| - snapshot consistency (`as_of_date` fixed) |
| - `recency_days` aligns with `as_of_date - last_donation_date` |
| - country codes match the prevalence table keys |
| - compatibility lookup covers all 8×8 donor/recipient pairs |
|
|
| --- |
|
|
| ## 🧬 Synthetic data generation (high-level) |
|
|
| Records are simulated to reflect realistic constraints and patterns: |
| - eligibility rules and deferral reasons (age/BMI/health flags) |
| - donation history distributions and recency behavior |
| - country-level blood type prevalence used to derive per-donor prevalence context |
| - ABO/Rh compatibility rules encoded in the lookup table |
|
|
| Synthetic distributions may not match any specific real-world population. |
|
|
| --- |
|
|
| ## ⚠️ Limitations |
|
|
| - snapshot-style dataset (not a full longitudinal event log beyond history fields) |
| - synthetic distributions may differ from real operational settings |
| - engineered signals (e.g., `donation_propensity_score`) can act as shortcut features if used without care |
|
|
| --- |
|
|
| ## 🧾 Citation |
|
|
| Tarek Masryo. (2025). *Blood Donation Registry — Synthetic Donors, Prevalence & Compatibility*. |
|
|
| --- |
|
|
| ## 📜 License |
|
|
| CC BY 4.0 — attribution required. |
|
|
| --- |
|
|
| ## 👤 Author |
|
|
| Tarek Masryo |
|
|