Published July 16, 2026
| Version 0.1.18
Software
Open
KFRE: A Python Library for Reproducing The Kidney Failure Risk Equation
Authors/Creators
Description
Fixed
risk_predno longer raisesUnboundLocalErrorwhen inputs for multiple models are supplied at once. Model selection is now resolved a single time with an explicit 8 > 6 > 4 precedence, so the coefficient block and the risk-score adjustment always agree on the chosen model.RiskPredictor.predict_kfrenow validatesnum_varsand raisesValueErrorfor unsupported values (e.g.num_vars=5) instead of falling through and returningNone.- Unrecognized or missing sex values are no longer silently coerced to female in the batch paths (
upcr_uacr,RiskPredictor.predict_kfre). Recognized values are matched case-insensitively (female/f,male/m); unrecognized non-empty values raise a warning and yieldNaN. - Non-positive uACR values are no longer silently clamped to
1e-6. A non-positive scalar uACR now raisesValueError; in batch inputs, offending rows are set toNaNwith a warning. - Corrected the direction described in the
perform_conversionscomments and docstring (the conversion factors themselves were already correct and are unchanged), and documented the single-pass scope ofconvert_all.
Added
bootstrap_metric_ci: bootstrap confidence intervals for any supported metric (auc_roc,average_precision,precision,sensitivity,specificity,brier), with reproducible resampling viaseedand a progress bar over resamples.- Out-of-bounds covariate warnings in
risk_pred: aUserWarningis emitted when covariates fall outside broad, physiologically plausible ranges for the KFRE's intended population (adults, CKD stages G3-G5). Predictions are still returned. Applies to all public entry points. censor_incompleteoption onclass_esrd_outcome: whenTrue, non-event patients whose follow-up ends before the horizon are labeledNaN(censored) rather than0, so right-censored patients can be excluded from fixed-horizon evaluation. Defaults toFalseto preserve existing behavior.- uPCR-to-uACR approximation disclaimer:
upcr_uacrnow documents that the conversion is an approximation without universal consensus and emits a one-timeUserWarningwhen it produces estimated values. - Explicit
num_varsoverride onrisk_predto force a specific model variant (4, 6, or 8) regardless of which optional inputs are present. - Regression test suites for input validation, out-of-bounds warnings, and bootstrap confidence intervals.
Changed
- Corrected docstring and README wording to consistently describe estimating the risk of kidney failure in patients with CKD, rather than "CKD development" or "CKD progression."
class_esrd_outcomedocumentation corrected: the event indicator is a user-supplied dialysis/transplantation (kidney replacement therapy / ESKD) flag; the function applies a time window to it and does not derive the event from eGFR.- Serum measurements labeled explicitly for albumin, phosphorous, bicarbonate, and calcium in the parameter documentation.
Dependencies
- Added
tqdm(>= 4.0) as a dependency, now used for thebootstrap_metric_ciprogress bar. (It had been removed in 0.1.16.)
Notes
- No KFRE coefficients or baseline survival values were changed. Risk estimates for valid inputs are identical to 0.1.17.
Files
lshpaner/kfre-0.1.18.zip
Files
(75.0 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:e58c9e4ad2f1bb387bfec11d718d944b
|
75.0 kB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/lshpaner/kfre/tree/0.1.18 (URL)
Software
- Repository URL
- https://github.com/lshpaner/kfre