Synthetic data

ehr2rl.make_synthetic_dataset(n_patients=100, trajectory_length=48, seed=42, include_medication_metadata=False)

Create a deterministic synthetic dataset with plausible ICU value ranges.

Each trajectory has hourly steps and four state features: heart rate, mean blood pressure, lactate, and creatinine. About 20% of patients die. The data are for development and testing, not for drawing clinical conclusions.

Parameters:
  • n_patients (int) – Number of trajectories. Must be positive.

  • trajectory_length (int) – Timesteps per trajectory. Must be greater than 1.

  • seed (int) – Random seed. The same seed always gives the same data.

  • include_medication_metadata (bool) – If True, actions have two columns, vasopressor_bin and fluid_bin, matching the BigQuery medication actions. Otherwise actions are one binary column.

Returns:

Trajectories with zero rewards and metadata died, feature_names, sofa_scores, and action_sizes.

Return type:

EHRDataset

Raises:

ValueError – If n_patients or trajectory_length is out of range.