Datasets:
donor_blood_type string | recipient_blood_type string | compatible_for_rbc_transfusion int64 | compatibility_level string |
|---|---|---|---|
O+ | O+ | 1 | ideal |
O+ | O- | 0 | incompatible |
O+ | A+ | 1 | acceptable |
O+ | A- | 0 | incompatible |
O+ | B+ | 1 | acceptable |
O+ | B- | 0 | incompatible |
O+ | AB+ | 1 | acceptable |
O+ | AB- | 0 | incompatible |
O- | O+ | 1 | acceptable |
O- | O- | 1 | ideal |
O- | A+ | 1 | acceptable |
O- | A- | 1 | acceptable |
O- | B+ | 1 | acceptable |
O- | B- | 1 | acceptable |
O- | AB+ | 1 | acceptable |
O- | AB- | 1 | acceptable |
A+ | O+ | 0 | incompatible |
A+ | O- | 0 | incompatible |
A+ | A+ | 1 | ideal |
A+ | A- | 0 | incompatible |
A+ | B+ | 0 | incompatible |
A+ | B- | 0 | incompatible |
A+ | AB+ | 1 | acceptable |
A+ | AB- | 0 | incompatible |
A- | O+ | 0 | incompatible |
A- | O- | 0 | incompatible |
A- | A+ | 1 | acceptable |
A- | A- | 1 | ideal |
A- | B+ | 0 | incompatible |
A- | B- | 0 | incompatible |
A- | AB+ | 1 | acceptable |
A- | AB- | 1 | acceptable |
B+ | O+ | 0 | incompatible |
B+ | O- | 0 | incompatible |
B+ | A+ | 0 | incompatible |
B+ | A- | 0 | incompatible |
B+ | B+ | 1 | ideal |
B+ | B- | 0 | incompatible |
B+ | AB+ | 1 | acceptable |
B+ | AB- | 0 | incompatible |
B- | O+ | 0 | incompatible |
B- | O- | 0 | incompatible |
B- | A+ | 0 | incompatible |
B- | A- | 0 | incompatible |
B- | B+ | 1 | acceptable |
B- | B- | 1 | ideal |
B- | AB+ | 1 | acceptable |
B- | AB- | 1 | acceptable |
AB+ | O+ | 0 | incompatible |
AB+ | O- | 0 | incompatible |
AB+ | A+ | 0 | incompatible |
AB+ | A- | 0 | incompatible |
AB+ | B+ | 0 | incompatible |
AB+ | B- | 0 | incompatible |
AB+ | AB+ | 1 | ideal |
AB+ | AB- | 0 | incompatible |
AB- | O+ | 0 | incompatible |
AB- | O- | 0 | incompatible |
AB- | A+ | 0 | incompatible |
AB- | A- | 0 | incompatible |
AB- | B+ | 0 | incompatible |
AB- | B- | 0 | incompatible |
AB- | AB+ | 1 | acceptable |
AB- | AB- | 1 | ideal |
π©Έ 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 tablepopulation_distributionβ country-level blood type prevalencecompatibility_lookupβ RBC transfusion compatibility matrix (8Γ8)data_dictionaryβ column-level documentation (all files)
π Quick start (Hugging Face)
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_typecompatible_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_codeblood_donation_registry_ml_ready.blood_type_country_prevalenceis derived from the matching country prevalence proportions.blood_compatibility_lookupprovides 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_typeby country prevalence - explore compatibility-aware matching using the lookup matrix
π§― Modeling notes (avoid leakage / shortcuts)
donated_next_6mis derived fromnext_6m_donation_countβ use one outcome as the target.eligible_to_donateoverlaps witheligibility_statusβ keep one for simpler baselines.eligible_to_donate == 0impliesdonated_next_6m == 0β for behavior modeling, consider training oneligible_to_donate == 1.donation_propensity_scoreis engineered; exclude it for βfeature-onlyβ benchmark baselines.
β Data quality expectations
donor_idis unique (no duplicate donors)- no duplicate rows
- snapshot consistency (
as_of_datefixed) recency_daysaligns withas_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
- Downloads last month
- 49