cleverly.datasets.make_shift_dose#
- cleverly.datasets.make_shift_dose(n: int = 1000, *, policies: Sequence[tuple[float, float | None, str]] = ((0.0, None, 'natural course'), (0.5, 5.0, '+0.5')), seed: int | Generator | None = None, backend: Literal['pandas', 'polars'] | str | None = None) tuple[Any, dict[str, float]][source]#
A confounded continuous dose with known means under each declared shift.
The default policies are the natural course and a
+0.5shift capped at5.0, which is whatShiftwould be given for the same analysis – and the names match, so the truth is keyed exactly as the estimator reports.- Parameters:
- n
int Number of observations.
- policiessequence
oftuple One
(delta, cap, name)per policy the truth is computed for.- seed
int,Generator,orNone Seed or NumPy random generator.
- backend{“pandas”, “polars”, “pyarrow”}
orNone, default=None Dataframe backend.
Noneuses pandas when installed, then the first available backend.
- n
- Returns: