generate¶
The dispatcher. Takes a model name and forwards the remaining keyword arguments to that model's generator unchanged.
See Choosing a model for which name to pass, and the Generators page for each generator's own signature.
interface
¶
Interface module to unify access to all survival data generators.
Example: >>> from gen_surv import generate >>> df = generate(model="cphm", n=100, model_cens="uniform", cens_par=1.0, beta=0.5, covariate_range=2.0)
generate
¶
Generate survival data from a specific model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
ModelType
|
Name of the generator to run. Must be one of |
required |
**kwargs
|
object
|
Arguments forwarded to the chosen generator. These vary by model.
|
{}
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Simulated survival data with columns specific to the chosen model. All models include time/duration and status columns. |
Raises:
| Type | Description |
|---|---|
ChoiceError
|
If an unknown model name is provided. |
Examples:
>>> from gen_surv import generate
>>> df = generate(model="cphm", n=100, beta=0.5, covariate_range=2.0,
... model_cens="uniform", cens_par=1.0)
>>> df.head()