cleverly.datasets.heart_failure_truth#

cleverly.datasets.heart_failure_truth(readmission_dose: int, death_dose: int, *, first: str = 'death') → pd.DataFrame[source]#

The exact risks of make_heart_failure() when each part of the dose is set apart.

Parameters:
readmission_dose{0, 1, 2}

The dose whose fluid part, which acts on readmission, every patient gets.

death_dose{0, 1, 2}

The dose whose potassium part, which acts on death, every patient gets.

first{“death”, “readmission”}

Which event counts first within a month. "death" is the order of the simulated law, so it gives the risks of the world where the two parts are set apart. "readmission" gives the other order’s functional of the same data, which differs when the two doses differ.

Returns:
pandas.DataFrame

One row per check day, with the columns day, readmission and death: the share of patients with that event first by that day, had every patient stayed in follow-up. At equal doses it is the risk of that dose.

Examples

>>> from cleverly.datasets import heart_failure_truth
>>> heart_failure_truth(2, 0)["readmission"].round(4).tolist()
[0.0998, 0.1752, 0.2327]