cleverly.datasets.make_population_impact#
- cleverly.datasets.make_population_impact(n: int = 4000, *, seed: int | Generator | None = None, backend: Literal['pandas', 'polars'] | str | None = None) tuple[Any, dict[str, float]][source]#
Draw the population-impact program data and return the exact truths.
- Parameters:
- Returns:
dataframeOne row per discharge:
top_box(1 for a top-box transition, missing where the survey did not come back),transition_navigation(1 for the offer), the three standardized baseline covariates,pcp_visit_7d(1 for a primary-care visit within 7 days) andresponded(1 where the survey came back).- truth
dictofstrtofloat The population truths of
population_impact_truth().
See also
cleverly.datasets.population_impact_truthThe truths, without a draw.
cleverly.datasets.navigation_protocolThe program protocol a tutorial derives its own from.
Examples
>>> from cleverly.datasets import make_population_impact >>> frame, truth = make_population_impact(n=500, seed=3) >>> print(*frame.columns, sep="\n") top_box transition_navigation discharge_risk age prior_utilization pcp_visit_7d responded >>> bool(frame["top_box"].isna().equals(frame["responded"] == 0)) True