cleverly.datasets.make_team_readmission#

cleverly.datasets.make_team_readmission(n_teams: int = 100, team_size: int = 40, *, seed: int | Generator | None = None, backend: Literal['pandas', 'polars'] | str | None = None) → tuple[Any, dict[str, float]][source]#

Draw the team-run discharge program: a discharge offer, a day-30 call, and dropout.

Parameters:
n_teamsint, default=100

The number of navigator teams.

team_sizeint, default=40

The patients of each team.

seedint, Generator, or None

Seed or NumPy random generator.

backend{“pandas”, “polars”, “pyarrow”} or None, default=None

Dataframe backend. None uses pandas when installed, then the first available backend.

Returns:
dataframe

One row per patient, with the columns team, lives_alone, discharge_risk, offer, followed_30, readmitted_30, call, followed_90 and readmitted_90 in time order.

truthdict of str to float

ey_regimen[...] for the plans always, never and offer_only, and ate_regimen[always vs never], under the names a fit reports them by.

See also

cleverly.datasets.team_readmission_protocol

The study description of the program.

cleverly.datasets.make_longitudinal

The two-decision law without teams.

Examples

>>> from cleverly.datasets import make_team_readmission
>>> frame, truth = make_team_readmission(n_teams=4, team_size=10, seed=0)
>>> frame.shape
(40, 9)
>>> round(truth["ate_regimen[always vs never]"], 4)
-0.1301