cleverly.datasets.make_navigation_doses#

cleverly.datasets.make_navigation_doses(n: int = 1000, *, seed: int | Generator | None = None, backend: Literal['pandas', 'polars'] | str | None = None) → tuple[Any, dict[str, float]][source]#

Draw discharges with two service doses and a binary transition success.

Parameters:
nint

Number of discharges.

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 discharge: transition_success (1 or 0), navigator_hours, pharmacist_minutes, discharge_risk, age and medication_burden.

truthdict of str to float

The exact values of navigation_doses_truth().

See also

cleverly.datasets.navigation_doses_truth

The exact success share under each dose plan.

cleverly.datasets.navigation_protocol

The protocol of the program these data describe.

Notes

Patients with a higher discharge_risk get more of both services and succeed less often, so a plain regression of success on the doses is confounded. The module docstring gives the law, and DOSE_PLANS the plans.

Examples

>>> from cleverly.datasets import make_navigation_doses
>>> frame, truth = make_navigation_doses(n=500, seed=3)
>>> frame.shape
(500, 6)
>>> sorted(truth)[:2]
['ate_policy[both vs current practice]', 'ate_policy[more navigator time vs current practice]']