cleverly.datasets.make_weak_overlap#
- cleverly.datasets.make_weak_overlap(n: int = 1000, *, seed: int | Generator | None = None, strength: float = 3.0, backend: Literal['pandas', 'polars'] | str | None = None) tuple[Any, dict[str, float]][source]#
A practical positivity violation.
Propensity scores reach into the tails, so a handful of units carry enormous inverse-probability weight. Used to check that truncation diagnostics fire and that the estimate degrades gracefully rather than catastrophically.
- Parameters:
- n
int Number of observations.
- seed
int,Generator,orNone Seed or NumPy random generator.
- strength
float Coefficient scale of the treatment mechanism. Larger values push more propensity scores towards zero and one.
- backend{“pandas”, “polars”, “pyarrow”}
orNone, default=None Dataframe backend.
Noneuses pandas when installed, then the first available backend.
- n
- Returns: