## Background

Emergency departments in Turkiye process tens of millions of patient encounters annually across a geographically and demographically diverse national healthcare network. The system spans university hospitals, state hospitals, city hospitals, training and research hospitals, and private institutions distributed across 25 metropolitan and provincial centers covering all NUTS-2 statistical regions, from Istanbul and Izmir in the west to Diyarbakir, Erzurum, and Van in the east.

Early identification of patients at elevated risk of critical deterioration at the moment of ED presentation is one of the most clinically impactful unsolved problems in applied health informatics. Validated clinical scoring systems such as MEWS, NEWS2, and SOFA provide structured physiological summaries but are designed as threshold tools rather than probabilistic classifiers. Machine learning approaches offer the ability to integrate heterogeneous data types, model nonlinear interactions, and incorporate institutional and temporal context that rule-based scores ignore.

---

## Dataset

The dataset comprises **1,000,000 emergency department encounters** recorded between January 2019 and December 2024. Each encounter is characterized by **135 features** spanning:

- Patient demographics and anthropometrics
- Vital signs at initial triage assessment
- 29 laboratory values with clinically realistic missing data patterns
- 18 binary comorbidity indicators and computed Charlson Comorbidity Index
- 10 binary medication class indicators
- 14 binary ED procedure and intervention indicators
- Institutional features: hospital type, annual volume, bed category
- Geographic features: city, NUTS-2 region, urban/rural classification
- Temporal features: year, hour, season, night shift, weekend, COVID-19 period flag
- Clinical severity scores: MEWS, NEWS2, SOFA approximations
- Socioeconomic features: insurance type, SES index
- COVID-19 specific features: tested, positive, vaccinated status

The dataset is anchored in the clinical and epidemiological characteristics specific to Turkiye, incorporating SGK (Social Security Institution) insurance coding, nationally standardized Manchester Triage System levels, and regional hospital infrastructure variation across all NUTS-2 regions.

---

## Missing Data

Seven laboratory columns contain informative missingness (Missing Not At Random, MNAR) at rates of 25% to 42%. These tests are selectively ordered for higher-acuity patients, meaning the missingness indicator itself carries predictive signal. Participants are encouraged to engineer binary missingness indicator features prior to imputation.

| Column | Approximate Missing Rate |
|--------|--------------------------|
| troponin\_i\_ngml | 35% |
| bnp\_pgl | 40% |
| d\_dimer\_mgfl | 42% |
| lactate\_mmoll | 25% |
| lipase\_ul | 38% |
| procalcitonin\_ngl | 30% |
| albumin\_gdl | 28% |

---

## Target Construction

The `adverse_outcome` target was generated via a logistic regression model encoding established clinical risk relationships. The strongest predictors include triage level 1 (log-odds +1.2), GCS below 9 (+0.8), lactate above 4 mmol/L (+0.6), SBP below 90 mmHg (+0.5), and age as a continuous predictor (+0.05 per year above 40).

---

## Feature Engineering Directions

The following engineered features are demonstrated in the starter notebook and are provided as starting points:

$$\text{Shock Index} = \frac{\text{Heart Rate (bpm)}}{\text{Systolic BP (mmHg)}}$$

$$\text{Modified Shock Index} = \frac{\text{Heart Rate (bpm)}}{\text{MAP (mmHg)}}$$

$$\text{Anion Gap} = \text{Na}^+ - (\text{Cl}^- + \text{HCO}_3^-)$$

$$\text{eGFR} \approx \frac{120}{\text{Creatinine} + 0.1}$$

Additional high-value interaction terms include `age x charlson_comorbidity_index`, `sofa_score_approx x triage_level`, and `is_night_shift x is_weekend`.

---

## Dataset Construction Methodology

The dataset was generated using a mechanistic simulation framework (seed = 42) calibrated against published epidemiological parameters. City-level sampling is proportional to population across 25 cities. Hospital type and infrastructure features vary systematically by city size and region. The COVID-19 period (2020 to 2021) introduces structured distribution shift in testing patterns, presentation characteristics, and disposition rates. 

---

## Files

| File | Rows | Columns | Description |
|------|------|---------|-------------|
| train.csv | 700,000 | 135 | Training encounters with both target variables |
| test.csv | 200,000 | 132 | Test encounters with targets withheld |
| sample\_submission.csv | 200,000 | 3 | Submission format template |
| supplemental\_data.csv | 100,000 | 135 | Additional labeled data for training or validation |
| hospital\_reference.csv | 25 | 13 | Hospital infrastructure metadata by city |
| icd10\_reference.csv | 21 | 7 | ICD-10 diagnostic code reference table |
| setup\_solution.ipynb | — | — | Official starter notebook with baseline models |