cleverly.longitudinal.LearnedRegimen#
- class cleverly.longitudinal.LearnedRegimen(label: str = 'learned regimen')[source]#
Declare the two-node regimen whose fold-size-weighted value an
LTMLEfit estimates.Each outer training fold learns its own pair of rules by backward plug-in Q-learning on its training rows: the second-node rule treats where the fold’s outcome regression at the second node predicts a higher outcome under treatment, given the first-node arm, and the first-node rule treats where the first-node regression of that learned value predicts a higher one. A tie assigns the lower arm code. Every row then follows the rule pair of the fold that held it out.
The fit reports one parameter,
ey_regimen[<label>], the value of those rules weighted by each fold’s share of the rows. The target depends on the data, because the rules do (van der Laan and Luedtke 2015, Section 7).result.learned_regimenrecords the rules.Pass it as
LTMLE(regimens=LearnedRegimen()), alone. The fit needs two treatment nodes, each binary, an end-of-study outcome, at least two outer folds and explicit learners. ASuperLearneror a cross-validated selector as the first node’s regression is refused, because its internal risk would read a second-node rule trained on its own validation rows.- Parameters:
- label
str The label that the reported parameter carries, as in
ey_regimen[learned regimen].
- label
- Raises:
DataErrorIf
labelis not a non-empty string.
See also
cleverly.longitudinal.LTMLEThe estimator that fits it.
cleverly.longitudinal.DynamicRegimenA regimen of known rules, fixed before the fit.
Examples
>>> from cleverly.longitudinal import LearnedRegimen >>> LearnedRegimen().label 'learned regimen'
Methods#
- LearnedRegimen.is_mtp(time: int) bool[source]#
Return
False: no node holds a modified treatment policy.
- LearnedRegimen.is_policy(time: int) bool[source]#
Return
False: no node of a learned regimen draws its arm.
Attributes#
- LearnedRegimen.has_mtp#
Return
False: a learned regimen holds no modified treatment policy.
- LearnedRegimen.has_policy#
Return
False: every node of a learned regimen assigns its arm by a rule.
- LearnedRegimen.has_rule#
Return
True: every node holds a rule, learned in each training fold.
- LearnedRegimen.has_tilt#
Return
False: a learned regimen holds no odds tilt.