cleverly.longitudinal.LearnedRegimenRecord#
- class cleverly.longitudinal.LearnedRegimenRecord(label: str, seed: int | None, fold_sizes: tuple[int, ...], nodes: tuple[LearnedRegimenNode, ...], fold_rules: ndarray, fold_blips: ndarray)[source]#
Record what a learned-regimen fit estimated, under
result.learned_regimen.The fitted fold models are not kept. Each fold’s rule pair on every row is, so a refit of a fold’s rules can be checked against it, and the stitched assignment each row followed is
result.fits[...].assignment.- Parameters:
- label
str The label of the regimen.
- seed
intorNone The seed of the split and the learners, as
result.repeats[0].seedrecords it.- fold_sizes
tupleofint The validation rows of each outer fold.
- nodes
tupleofLearnedRegimenNode One record per decision node, in time order.
- fold_rules
numpy.ndarray The
(V, n, 2)arm codes of every fold’s rule pair on every row, asLearnedRules.assignmentsholds them.- fold_blips
numpy.ndarray The
(V, n, 2)blips behind them, asLearnedRules.blipsholds them.
- label
- Attributes:
n_foldsintReturn the number of outer folds.
fold_weightstupleoffloatReturn each fold’s weight
n_v / nin the target and the estimate.targetstrReturn what the reported value is (
LEARNED_REGIMEN_TARGET).quantile_levelstupleoffloatReturn the levels of each node’s gap quantiles.
Methods#
Attributes#
- LearnedRegimenRecord.fold_weights#
Return each fold’s weight
n_v / nin the target and the estimate.
- LearnedRegimenRecord.n_folds#
Return the number of outer folds.
- LearnedRegimenRecord.quantile_levels#
Return the levels of each node’s gap quantiles.
- LearnedRegimenRecord.target#
Return what the reported value is (
LEARNED_REGIMEN_TARGET).
- LearnedRegimenRecord.nodes: tuple[LearnedRegimenNode, ...]#