cleverly.datasets.make_cde#
- cleverly.datasets.make_cde(n: int = 1000, *, seed: int | Generator | None = None, intermediate_value: float = 0.0, backend: Literal['pandas', 'polars'] | str | None = None) tuple[Any, dict[str, float]][source]#
Controlled direct effect: the effect of
AwithZheld fixed.The truth reported is the CDE at
intermediate_value. With the interaction in this process the CDE differs betweenz = 0(0.9) andz = 1(1.5), so a fit that ignoresZcannot match either.- Parameters:
- n
int Number of observations.
- seed
int,Generator,orNone Seed or NumPy random generator.
- intermediate_value
float Level the intermediate variable is held at when the truth is computed.
- backend{“pandas”, “polars”, “pyarrow”}
orNone, default=None Dataframe backend.
Noneuses pandas when installed, then the first available backend.
- n
- Returns: