survivalgpu.simulate_dataset_batch
- survivalgpu.simulate_dataset_batch(max_time, n_patients, list_covariates, batchsize=None, compress=True, seed=None)
Simulates a dataset of n_patients patients by concatenating smaller chunks.
Simulating all n_patients at once with simulate_dataset can be too slow or memory-intensive for large datasets. Instead, this function simulates successive chunks of batchsize patients (with a final, smaller chunk for the remainder, if any) and concatenates the results, offsetting the “patients” column of each chunk so that patient ids remain unique across the full dataset.
- Parameters:
max_time (int) – the maximum follow-up time, passed to simulate_dataset.
n_patients (int) – the total number of patients in the final dataset.
list_covariates (list) – the covariates to simulate, passed to simulate_dataset.
batchsize (int, optional) – the number of patients to simulate per chunk. Defaults to n_patients, i.e. a single chunk.
compress (bool, optional) – whether to compress each chunk, passed to simulate_dataset. Defaults to True.
seed (int, optional) – random seed for the first chunk. Subsequent chunks use seed + i for reproducibility. Defaults to None.
- Returns:
pandas.DataFrame –
- the concatenated dataset, with n_patients distinct,
contiguous patient ids.