You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cox at-risk rule (tl < tau) & (x >= tau) hand-rolled in three Python loops (cox_ph.baseline:289-295 — O(K·N), _prepare_exact_tie_data:519-527, diagnostics._risk_set_means:102-105) while vectorised equivalents (at_risk_beta_Z + not_yet_entered) exist in the same file. Minimum: vectorise baseline(); add one documented risk-set-convention helper so the entry-strict/exit-inclusive rule lives in one place. Pinned by the R/lifelines comparison tests.
degradation/_bounds.pybootstrap_cb vs bootstrap_cb_accelerated (~40 lines): same resample→refit→quantile loop; merge with Z=None.
CB transform sharing: parametric.py:1394-1465 and regression/_bounds.py:48-116 implement the same logit-sf / log-rate transforms with different jacobian engines (autograd vs FD — keep both engines, share only the transform functions and align the two-sided output layout).
Cox TVC entry-point quartet (cox_ph.py:955-1132) structurally mirrors TVCFitMixin (tvc_fit.py:42-148); a _post_tvc_fit hook collapses at least the two *_from_df wrappers (Cox's docstrings are worth keeping, which limits the net win).
CopulaModel.to_dict (multivariate/parametric/copula/copula_model.py:89-99) is the only to_dict without stamp_schema, has no from_dict, and writes a "parameterization" tag surpyval.from_dict doesn't recognise — it serialises to something nothing can read. Either register + implement from_dict, or document one-way export.
Each item should land with before/after numerical-equality checks on the relevant suites. (Low-risk simplification items from the same review are being applied directly.)
Remaining medium-risk items from the simplification review, grouped:
competing_risks/nonparametric/competing_risks.py:245-248,competing_risks/regression/competing_risks_proportional_hazard.py:110-120(same Competing risks: CIF uses S(t) instead of S(t-); queries before first event wrap to last value; fit_from_df shadows df() #253/Competing risks: default Nelson-Aalen method produces CIFs that exceed 1 #278 comments),gray_test.py:190-205(loop form). Oneaalen_johansen_iif(S_km, hazard_increments)helper; Competing risks: default Nelson-Aalen method produces CIFs that exceed 1 #278 was exactly one of these copies going wrong.(tl < tau) & (x >= tau)hand-rolled in three Python loops (cox_ph.baseline:289-295— O(K·N),_prepare_exact_tie_data:519-527,diagnostics._risk_set_means:102-105) while vectorised equivalents (at_risk_beta_Z+not_yet_entered) exist in the same file. Minimum: vectorisebaseline(); add one documented risk-set-convention helper so the entry-strict/exit-inclusive rule lives in one place. Pinned by the R/lifelines comparison tests.degradation/_bounds.pybootstrap_cbvsbootstrap_cb_accelerated(~40 lines): same resample→refit→quantile loop; merge withZ=None.parametric.py:1394-1465andregression/_bounds.py:48-116implement the same logit-sf / log-rate transforms with different jacobian engines (autograd vs FD — keep both engines, share only the transform functions and align the two-sided output layout).cox_ph.py:955-1132) structurally mirrorsTVCFitMixin(tvc_fit.py:42-148); a_post_tvc_fithook collapses at least the two*_from_dfwrappers (Cox's docstrings are worth keeping, which limits the net win).CopulaModel.to_dict(multivariate/parametric/copula/copula_model.py:89-99) is the onlyto_dictwithoutstamp_schema, has nofrom_dict, and writes a"parameterization"tagsurpyval.from_dictdoesn't recognise — it serialises to something nothing can read. Either register + implementfrom_dict, or document one-way export.Each item should land with before/after numerical-equality checks on the relevant suites. (Low-risk simplification items from the same review are being applied directly.)