Skip to main content

Module predict

Module predict 

Source
Expand description

Library-side survival prediction pipeline.

Extracts the hazard/survival/cumulative-hazard math from the CLI’s run_predict_survival so that both the CLI and the Python FFI can share a single entry point. The CLI retains ownership of progress bars, CSV writing, and uncertainty bounds; everything else (design build, baseline + time basis evaluation, link/time wiggles, and hazard/survival conversion) flows through predict_survival.

Structs§

CompetingRisksPredictResult
Joint cause-specific competing-risks prediction result.
KaplanMeier
Right-continuous Kaplan–Meier survival estimator Ŝ(t) = ∏_{t_j ≤ t}(1 − d_j/n_j).
SurvivalPredictRequest
Inputs to the unified survival predict pipeline.
SurvivalPredictResult
Result of predict_survival.
SurvivalTimeColumns
Resolved survival entry/exit column indices for a saved survival model.

Enums§

SurvivalPredictError
Typed errors emitted by the survival prediction pipeline.

Functions§

apply_inverse_link_state_to_fit_result
build_saved_survival_marginal_slope_predictor
Build the saved survival marginal-slope predictor along with the matching PredictInput and a UnifiedFitResult repackaged into the layout BernoulliMarginalSlopePredictor::from_unified expects.
concat_array1_refs
Concatenate referenced 1-D arrays into a single owned Array1<f64>.
fit_result_from_saved_model_for_prediction
Canonical saved fit result for prediction.
harrell_concordance
Harrell’s concordance index (C-index) of a survival risk score against held-out outcomes. A larger risk[i] must predict a SHORTER survival time (higher hazard). Over every orderable pair — pairs whose earlier observed time is a genuine event, so the failure ordering is observed — a pair is concordant when the earlier-failing subject carries the larger risk; equal risks score half credit. C = (concordant + 0.5·tied) / comparable. C = 0.5 is random ranking, C = 1.0 a perfect ordering.
integrated_ipcw_brier_score
Integrated IPCW Brier score (IBS) — the time-integrated ipcw_brier_score, matching scikit-survival’s integrated_brier_score and pec’s integrated prediction-error curve.
ipcw_brier_score
IPCW (inverse-probability-of-censoring-weighted) Brier score of a predicted survival probability at a fixed horizon tau against held-out outcomes — the Graf et al. (1999) estimator used by scikit-survival brier_score, pec, and survival::brier.
predict_competing_risks_survival
predict_survival
Run the survival prediction pipeline.
require_saved_survival_likelihood_mode
Extract the saved survival likelihood mode from the model payload.
resolve_saved_survival_time_columns
Resolve saved survival entry/exit column names against the runtime col_map, treating an absent survival_entry as the right-censored shorthand (entry times synthesized as zero downstream).
resolve_survival_inverse_link_from_saved
Resolve the saved survival inverse-link from saved link metadata and fitted state.
resolve_termspec_for_prediction
Resolve the covariate TermCollectionSpec for prediction, remapping saved training-column indices onto the runtime dataset’s layout.
saved_baseline_timewiggle_components
Rebuild the saved baseline-timewiggle entry/exit/derivative design blocks from the saved runtime metadata. Returns None when the saved model has no baseline-timewiggle.
saved_survival_location_scale_fit_result
Resolve the saved survival location-scale fit result.
saved_survival_runtime_baseline_config
Baseline config persisted by the saved survival model.