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) – IfTrue, actions have two columns,vasopressor_binandfluid_bin, matching the BigQuery medication actions. Otherwise actions are one binary column.
- Returns:
Trajectories with zero rewards and metadata
died,feature_names,sofa_scores, andaction_sizes.- Return type:
- Raises:
ValueError – If
n_patientsortrajectory_lengthis out of range.