cleverly.datasets.navigation_data#

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

Draw the point-treatment program data, with the columns under the program’s names.

Parameters:
nint

Number of observations.

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

The draw of make_nonlinear_bounded() with each column renamed. The values and the column order are unchanged.

truthdict of str to float

Exact causal parameters for the data-generating process.

See also

cleverly.datasets.make_nonlinear_bounded

The generator this function renames.

cleverly.datasets.navigation_protocol

The protocol of the program these data describe.

Notes

The same seed gives the same rows as make_nonlinear_bounded(). Only the names change.

The transition score is a share of the maximum score, so every value lies in (0, 1). A cross-fitted fit of it declares q_bounds=(0.0, 1.0).

Each patient’s true probability of navigation lies in [0.05, 0.95], as in nonlinear_dgp(). This bound gives strong positivity, so the ATE has a finite efficiency bound.

generator

program

Y

transition_score

A

transition_navigation

W1

discharge_risk

W2

prior_utilization

W3

medication_burden

W4

age

Examples

>>> from cleverly.datasets import navigation_data
>>> frame, truth = navigation_data(n=500, seed=21)
>>> print(*frame.columns, sep="\n")
transition_score
transition_navigation
discharge_risk
prior_utilization
medication_burden
age
>>> frame.shape
(500, 6)
>>> round(truth["ate"], 3)
0.163