mlsurv 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. mlsurv-0.1.0/CHANGELOG.md +74 -0
  2. mlsurv-0.1.0/LICENSE +9 -0
  3. mlsurv-0.1.0/MANIFEST.in +1 -0
  4. mlsurv-0.1.0/PKG-INFO +297 -0
  5. mlsurv-0.1.0/README.md +248 -0
  6. mlsurv-0.1.0/mlsurv/__init__.py +215 -0
  7. mlsurv-0.1.0/mlsurv/_calibration_thresholds.py +25 -0
  8. mlsurv-0.1.0/mlsurv/_iter_warn.py +396 -0
  9. mlsurv-0.1.0/mlsurv/_loky_patch.py +34 -0
  10. mlsurv-0.1.0/mlsurv/_patient_select.py +109 -0
  11. mlsurv-0.1.0/mlsurv/_shared.py +585 -0
  12. mlsurv-0.1.0/mlsurv/_warnings.py +280 -0
  13. mlsurv-0.1.0/mlsurv/cli/__init__.py +173 -0
  14. mlsurv-0.1.0/mlsurv/cli/__main__.py +4 -0
  15. mlsurv-0.1.0/mlsurv/cli/_artifacts.py +471 -0
  16. mlsurv-0.1.0/mlsurv/cli/_commands.py +1891 -0
  17. mlsurv-0.1.0/mlsurv/cli/_data.py +450 -0
  18. mlsurv-0.1.0/mlsurv/cli/_exit_codes.py +16 -0
  19. mlsurv-0.1.0/mlsurv/cli/_helpers.py +143 -0
  20. mlsurv-0.1.0/mlsurv/cli/_output.py +69 -0
  21. mlsurv-0.1.0/mlsurv/cli/_parsers.py +1368 -0
  22. mlsurv-0.1.0/mlsurv/cli/_plot.py +879 -0
  23. mlsurv-0.1.0/mlsurv/constants.py +317 -0
  24. mlsurv-0.1.0/mlsurv/evaluation/__init__.py +92 -0
  25. mlsurv-0.1.0/mlsurv/evaluation/_bootstrap_iteration.py +971 -0
  26. mlsurv-0.1.0/mlsurv/evaluation/_bootstrap_workers.py +240 -0
  27. mlsurv-0.1.0/mlsurv/evaluation/_calibrators.py +482 -0
  28. mlsurv-0.1.0/mlsurv/evaluation/_coefficients.py +257 -0
  29. mlsurv-0.1.0/mlsurv/evaluation/_concordance.py +533 -0
  30. mlsurv-0.1.0/mlsurv/evaluation/_config.py +113 -0
  31. mlsurv-0.1.0/mlsurv/evaluation/_ctd.py +113 -0
  32. mlsurv-0.1.0/mlsurv/evaluation/_diagnostics.py +335 -0
  33. mlsurv-0.1.0/mlsurv/evaluation/_explain.py +168 -0
  34. mlsurv-0.1.0/mlsurv/evaluation/_feature_summary.py +388 -0
  35. mlsurv-0.1.0/mlsurv/evaluation/_incremental.py +437 -0
  36. mlsurv-0.1.0/mlsurv/evaluation/_interactions.py +1501 -0
  37. mlsurv-0.1.0/mlsurv/evaluation/_paired_comparison.py +706 -0
  38. mlsurv-0.1.0/mlsurv/evaluation/_prediction_bootstrap.py +660 -0
  39. mlsurv-0.1.0/mlsurv/evaluation/_prediction_helpers.py +482 -0
  40. mlsurv-0.1.0/mlsurv/evaluation/_recalibration.py +499 -0
  41. mlsurv-0.1.0/mlsurv/evaluation/_shap.py +389 -0
  42. mlsurv-0.1.0/mlsurv/evaluation/_subpopulation.py +807 -0
  43. mlsurv-0.1.0/mlsurv/evaluation/_univariate_cox.py +101 -0
  44. mlsurv-0.1.0/mlsurv/evaluation/bootstrap.py +1266 -0
  45. mlsurv-0.1.0/mlsurv/evaluation/evaluate.py +2177 -0
  46. mlsurv-0.1.0/mlsurv/evaluation/helpers.py +108 -0
  47. mlsurv-0.1.0/mlsurv/evaluation/importance.py +871 -0
  48. mlsurv-0.1.0/mlsurv/evaluation/metrics.py +2882 -0
  49. mlsurv-0.1.0/mlsurv/exceptions.py +54 -0
  50. mlsurv-0.1.0/mlsurv/guidance.py +865 -0
  51. mlsurv-0.1.0/mlsurv/learner/__init__.py +19 -0
  52. mlsurv-0.1.0/mlsurv/learner/_benchmarking.py +970 -0
  53. mlsurv-0.1.0/mlsurv/learner/_config.py +76 -0
  54. mlsurv-0.1.0/mlsurv/learner/_core.py +1384 -0
  55. mlsurv-0.1.0/mlsurv/learner/_cv_training.py +706 -0
  56. mlsurv-0.1.0/mlsurv/learner/_eval_context.py +64 -0
  57. mlsurv-0.1.0/mlsurv/learner/_eval_times.py +119 -0
  58. mlsurv-0.1.0/mlsurv/learner/_evaluation.py +71 -0
  59. mlsurv-0.1.0/mlsurv/learner/_evaluation_bootstrap.py +424 -0
  60. mlsurv-0.1.0/mlsurv/learner/_evaluation_core.py +1143 -0
  61. mlsurv-0.1.0/mlsurv/learner/_evaluation_helpers.py +932 -0
  62. mlsurv-0.1.0/mlsurv/learner/_evaluation_interactions.py +1642 -0
  63. mlsurv-0.1.0/mlsurv/learner/_explain.py +144 -0
  64. mlsurv-0.1.0/mlsurv/learner/_export.py +399 -0
  65. mlsurv-0.1.0/mlsurv/learner/_format.py +275 -0
  66. mlsurv-0.1.0/mlsurv/learner/_patient_report.py +510 -0
  67. mlsurv-0.1.0/mlsurv/learner/_patient_report_html.py +587 -0
  68. mlsurv-0.1.0/mlsurv/learner/_patient_report_template.py +385 -0
  69. mlsurv-0.1.0/mlsurv/learner/_patient_resolve.py +91 -0
  70. mlsurv-0.1.0/mlsurv/learner/_persistence.py +457 -0
  71. mlsurv-0.1.0/mlsurv/learner/_prediction.py +590 -0
  72. mlsurv-0.1.0/mlsurv/learner/_recalibration.py +290 -0
  73. mlsurv-0.1.0/mlsurv/learner/_references.py +193 -0
  74. mlsurv-0.1.0/mlsurv/learner/_reports.py +237 -0
  75. mlsurv-0.1.0/mlsurv/learner/_setup.py +2133 -0
  76. mlsurv-0.1.0/mlsurv/learner/_state.py +253 -0
  77. mlsurv-0.1.0/mlsurv/learner/_studies.py +235 -0
  78. mlsurv-0.1.0/mlsurv/learner/_sweep.py +568 -0
  79. mlsurv-0.1.0/mlsurv/learner/_training.py +1453 -0
  80. mlsurv-0.1.0/mlsurv/learner/_tuning.py +1134 -0
  81. mlsurv-0.1.0/mlsurv/learner/_views.py +453 -0
  82. mlsurv-0.1.0/mlsurv/learner/_visualization.py +1337 -0
  83. mlsurv-0.1.0/mlsurv/logging_utils.py +254 -0
  84. mlsurv-0.1.0/mlsurv/models/__init__.py +445 -0
  85. mlsurv-0.1.0/mlsurv/models/_auto_defaults.py +369 -0
  86. mlsurv-0.1.0/mlsurv/models/_metadata.py +35 -0
  87. mlsurv-0.1.0/mlsurv/models/_overflow.py +250 -0
  88. mlsurv-0.1.0/mlsurv/models/_reference_adapter.py +127 -0
  89. mlsurv-0.1.0/mlsurv/models/base.py +763 -0
  90. mlsurv-0.1.0/mlsurv/models/coxnet.py +470 -0
  91. mlsurv-0.1.0/mlsurv/models/coxph.py +442 -0
  92. mlsurv-0.1.0/mlsurv/models/deephit.py +459 -0
  93. mlsurv-0.1.0/mlsurv/models/deepsurv.py +624 -0
  94. mlsurv-0.1.0/mlsurv/models/fssvm.py +412 -0
  95. mlsurv-0.1.0/mlsurv/models/gbsa.py +181 -0
  96. mlsurv-0.1.0/mlsurv/models/rsf.py +170 -0
  97. mlsurv-0.1.0/mlsurv/models/weibull_aft.py +342 -0
  98. mlsurv-0.1.0/mlsurv/models/xgbaft.py +770 -0
  99. mlsurv-0.1.0/mlsurv/models/xgbcox.py +339 -0
  100. mlsurv-0.1.0/mlsurv/preprocessing/__init__.py +46 -0
  101. mlsurv-0.1.0/mlsurv/preprocessing/_cox_fit.py +285 -0
  102. mlsurv-0.1.0/mlsurv/preprocessing/indicators.py +64 -0
  103. mlsurv-0.1.0/mlsurv/preprocessing/pipelines.py +281 -0
  104. mlsurv-0.1.0/mlsurv/preprocessing/selection.py +1201 -0
  105. mlsurv-0.1.0/mlsurv/preprocessing/utils.py +221 -0
  106. mlsurv-0.1.0/mlsurv/py.typed +0 -0
  107. mlsurv-0.1.0/mlsurv/reports/__init__.py +7 -0
  108. mlsurv-0.1.0/mlsurv/reports/_constants.py +90 -0
  109. mlsurv-0.1.0/mlsurv/reports/_figure_export.py +103 -0
  110. mlsurv-0.1.0/mlsurv/reports/_helpers.py +213 -0
  111. mlsurv-0.1.0/mlsurv/reports/_text.py +38 -0
  112. mlsurv-0.1.0/mlsurv/reports/generator.py +697 -0
  113. mlsurv-0.1.0/mlsurv/reports/renderers/__init__.py +11 -0
  114. mlsurv-0.1.0/mlsurv/reports/renderers/_figures.py +415 -0
  115. mlsurv-0.1.0/mlsurv/reports/renderers/_scripts.py +488 -0
  116. mlsurv-0.1.0/mlsurv/reports/renderers/_styles.py +800 -0
  117. mlsurv-0.1.0/mlsurv/reports/renderers/html.py +537 -0
  118. mlsurv-0.1.0/mlsurv/reports/renderers/manuscript.py +345 -0
  119. mlsurv-0.1.0/mlsurv/reports/renderers/markdown.py +388 -0
  120. mlsurv-0.1.0/mlsurv/reports/sections/__init__.py +50 -0
  121. mlsurv-0.1.0/mlsurv/reports/sections/_metric_glossary.py +70 -0
  122. mlsurv-0.1.0/mlsurv/reports/sections/_subsection_base.py +48 -0
  123. mlsurv-0.1.0/mlsurv/reports/sections/_trained_details.py +314 -0
  124. mlsurv-0.1.0/mlsurv/reports/sections/base.py +565 -0
  125. mlsurv-0.1.0/mlsurv/reports/sections/benchmarking.py +987 -0
  126. mlsurv-0.1.0/mlsurv/reports/sections/data_preprocessing.py +1918 -0
  127. mlsurv-0.1.0/mlsurv/reports/sections/environment.py +469 -0
  128. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/__init__.py +10 -0
  129. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_base.py +35 -0
  130. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_calibration.py +413 -0
  131. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_discrimination.py +162 -0
  132. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_helpers.py +99 -0
  133. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_methodology.py +64 -0
  134. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_paired_comparison.py +196 -0
  135. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_performance.py +468 -0
  136. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_roc.py +224 -0
  137. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_section.py +233 -0
  138. mlsurv-0.1.0/mlsurv/reports/sections/evaluation/_stratification.py +678 -0
  139. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/__init__.py +20 -0
  140. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_audit.py +255 -0
  141. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_coefficient_analysis.py +100 -0
  142. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_coefficients.py +140 -0
  143. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_correlation.py +251 -0
  144. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_hazard_ratios.py +198 -0
  145. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_helpers.py +128 -0
  146. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_importance.py +445 -0
  147. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_interactions.py +253 -0
  148. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_interactive_table.py +353 -0
  149. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_section.py +858 -0
  150. mlsurv-0.1.0/mlsurv/reports/sections/feature_analysis/_shap.py +102 -0
  151. mlsurv-0.1.0/mlsurv/reports/sections/limitations.py +1027 -0
  152. mlsurv-0.1.0/mlsurv/reports/sections/model_development.py +851 -0
  153. mlsurv-0.1.0/mlsurv/reports/sections/references.py +863 -0
  154. mlsurv-0.1.0/mlsurv/reports/sections/subpopulation_analysis.py +288 -0
  155. mlsurv-0.1.0/mlsurv/reports/sections/summary.py +1114 -0
  156. mlsurv-0.1.0/mlsurv/reports/sections/tripod_checklist.py +474 -0
  157. mlsurv-0.1.0/mlsurv/reports/sections/validation/__init__.py +10 -0
  158. mlsurv-0.1.0/mlsurv/reports/sections/validation/_base.py +41 -0
  159. mlsurv-0.1.0/mlsurv/reports/sections/validation/_bootstrap.py +200 -0
  160. mlsurv-0.1.0/mlsurv/reports/sections/validation/_calibration.py +323 -0
  161. mlsurv-0.1.0/mlsurv/reports/sections/validation/_discrimination.py +120 -0
  162. mlsurv-0.1.0/mlsurv/reports/sections/validation/_helpers.py +179 -0
  163. mlsurv-0.1.0/mlsurv/reports/sections/validation/_performance_drop.py +150 -0
  164. mlsurv-0.1.0/mlsurv/reports/sections/validation/_section.py +496 -0
  165. mlsurv-0.1.0/mlsurv/reports/sections/validation/_stratification.py +377 -0
  166. mlsurv-0.1.0/mlsurv/reports/sections/validation/_table1.py +351 -0
  167. mlsurv-0.1.0/mlsurv/results/__init__.py +65 -0
  168. mlsurv-0.1.0/mlsurv/results/_containers_extraction.py +321 -0
  169. mlsurv-0.1.0/mlsurv/results/_containers_helpers.py +410 -0
  170. mlsurv-0.1.0/mlsurv/results/_containers_printing.py +343 -0
  171. mlsurv-0.1.0/mlsurv/results/_explanation.py +46 -0
  172. mlsurv-0.1.0/mlsurv/results/_prediction.py +733 -0
  173. mlsurv-0.1.0/mlsurv/results/containers.py +1662 -0
  174. mlsurv-0.1.0/mlsurv/results/printing.py +1599 -0
  175. mlsurv-0.1.0/mlsurv/results/tables.py +396 -0
  176. mlsurv-0.1.0/mlsurv/tuning/__init__.py +72 -0
  177. mlsurv-0.1.0/mlsurv/tuning/base.py +1528 -0
  178. mlsurv-0.1.0/mlsurv/tuning/exceptions.py +24 -0
  179. mlsurv-0.1.0/mlsurv/tuning/optuna_tuner.py +89 -0
  180. mlsurv-0.1.0/mlsurv/tuning/search_spaces.py +592 -0
  181. mlsurv-0.1.0/mlsurv/tuning/storage.py +108 -0
  182. mlsurv-0.1.0/mlsurv/tuning/studies.py +389 -0
  183. mlsurv-0.1.0/mlsurv/tuning/tuners/__init__.py +72 -0
  184. mlsurv-0.1.0/mlsurv/tuning/tuners/coxnet.py +50 -0
  185. mlsurv-0.1.0/mlsurv/tuning/tuners/coxph.py +46 -0
  186. mlsurv-0.1.0/mlsurv/tuning/tuners/custom.py +55 -0
  187. mlsurv-0.1.0/mlsurv/tuning/tuners/deephit.py +57 -0
  188. mlsurv-0.1.0/mlsurv/tuning/tuners/deepsurv.py +56 -0
  189. mlsurv-0.1.0/mlsurv/tuning/tuners/fssvm.py +78 -0
  190. mlsurv-0.1.0/mlsurv/tuning/tuners/gbsa.py +29 -0
  191. mlsurv-0.1.0/mlsurv/tuning/tuners/rsf.py +30 -0
  192. mlsurv-0.1.0/mlsurv/tuning/tuners/weibull_aft.py +27 -0
  193. mlsurv-0.1.0/mlsurv/tuning/tuners/xgbaft.py +44 -0
  194. mlsurv-0.1.0/mlsurv/tuning/tuners/xgbcox.py +35 -0
  195. mlsurv-0.1.0/mlsurv/utils.py +1730 -0
  196. mlsurv-0.1.0/mlsurv/viz/__init__.py +179 -0
  197. mlsurv-0.1.0/mlsurv/viz/_context.py +348 -0
  198. mlsurv-0.1.0/mlsurv/viz/_data.py +1323 -0
  199. mlsurv-0.1.0/mlsurv/viz/_data_metrics.py +1295 -0
  200. mlsurv-0.1.0/mlsurv/viz/_features_coefficients.py +795 -0
  201. mlsurv-0.1.0/mlsurv/viz/_features_correlation.py +286 -0
  202. mlsurv-0.1.0/mlsurv/viz/_features_hazard_ratios.py +966 -0
  203. mlsurv-0.1.0/mlsurv/viz/_features_helpers.py +144 -0
  204. mlsurv-0.1.0/mlsurv/viz/_features_importance.py +623 -0
  205. mlsurv-0.1.0/mlsurv/viz/_features_importance_multi.py +840 -0
  206. mlsurv-0.1.0/mlsurv/viz/_metrics_helpers.py +846 -0
  207. mlsurv-0.1.0/mlsurv/viz/_metrics_multi.py +527 -0
  208. mlsurv-0.1.0/mlsurv/viz/_metrics_renderers.py +603 -0
  209. mlsurv-0.1.0/mlsurv/viz/_metrics_roc.py +884 -0
  210. mlsurv-0.1.0/mlsurv/viz/_metrics_time.py +1214 -0
  211. mlsurv-0.1.0/mlsurv/viz/_palettes.py +1055 -0
  212. mlsurv-0.1.0/mlsurv/viz/_plot_impl.py +84 -0
  213. mlsurv-0.1.0/mlsurv/viz/_plot_impl_calibration.py +726 -0
  214. mlsurv-0.1.0/mlsurv/viz/_plot_impl_importance.py +69 -0
  215. mlsurv-0.1.0/mlsurv/viz/_plot_impl_metric.py +513 -0
  216. mlsurv-0.1.0/mlsurv/viz/_plot_impl_metric_time.py +821 -0
  217. mlsurv-0.1.0/mlsurv/viz/_plot_impl_roc.py +804 -0
  218. mlsurv-0.1.0/mlsurv/viz/_plot_impl_secondary.py +840 -0
  219. mlsurv-0.1.0/mlsurv/viz/_plot_impl_shared.py +494 -0
  220. mlsurv-0.1.0/mlsurv/viz/_plot_impl_survival.py +400 -0
  221. mlsurv-0.1.0/mlsurv/viz/_plotly_helpers.py +106 -0
  222. mlsurv-0.1.0/mlsurv/viz/_resolve.py +489 -0
  223. mlsurv-0.1.0/mlsurv/viz/_survival_figure.py +203 -0
  224. mlsurv-0.1.0/mlsurv/viz/_survival_helpers.py +376 -0
  225. mlsurv-0.1.0/mlsurv/viz/_survival_logrank.py +192 -0
  226. mlsurv-0.1.0/mlsurv/viz/_survival_maxstat.py +458 -0
  227. mlsurv-0.1.0/mlsurv/viz/_survival_renderers.py +692 -0
  228. mlsurv-0.1.0/mlsurv/viz/_theme.py +401 -0
  229. mlsurv-0.1.0/mlsurv/viz/_time_format.py +50 -0
  230. mlsurv-0.1.0/mlsurv/viz/_validation.py +45 -0
  231. mlsurv-0.1.0/mlsurv/viz/benchmarking_scatter.py +274 -0
  232. mlsurv-0.1.0/mlsurv/viz/calibration.py +1333 -0
  233. mlsurv-0.1.0/mlsurv/viz/diagnostics.py +713 -0
  234. mlsurv-0.1.0/mlsurv/viz/distributions.py +372 -0
  235. mlsurv-0.1.0/mlsurv/viz/explain.py +278 -0
  236. mlsurv-0.1.0/mlsurv/viz/export.py +337 -0
  237. mlsurv-0.1.0/mlsurv/viz/features.py +420 -0
  238. mlsurv-0.1.0/mlsurv/viz/flowchart.py +252 -0
  239. mlsurv-0.1.0/mlsurv/viz/interactions.py +1080 -0
  240. mlsurv-0.1.0/mlsurv/viz/metrics.py +911 -0
  241. mlsurv-0.1.0/mlsurv/viz/missing.py +145 -0
  242. mlsurv-0.1.0/mlsurv/viz/shap.py +637 -0
  243. mlsurv-0.1.0/mlsurv/viz/survival.py +509 -0
  244. mlsurv-0.1.0/mlsurv/viz/sweep.py +160 -0
  245. mlsurv-0.1.0/mlsurv.egg-info/PKG-INFO +297 -0
  246. mlsurv-0.1.0/mlsurv.egg-info/SOURCES.txt +450 -0
  247. mlsurv-0.1.0/mlsurv.egg-info/dependency_links.txt +1 -0
  248. mlsurv-0.1.0/mlsurv.egg-info/entry_points.txt +2 -0
  249. mlsurv-0.1.0/mlsurv.egg-info/requires.txt +31 -0
  250. mlsurv-0.1.0/mlsurv.egg-info/top_level.txt +1 -0
  251. mlsurv-0.1.0/pyproject.toml +139 -0
  252. mlsurv-0.1.0/setup.cfg +4 -0
  253. mlsurv-0.1.0/tests/test_add_eval_times.py +453 -0
  254. mlsurv-0.1.0/tests/test_base_subsection.py +139 -0
  255. mlsurv-0.1.0/tests/test_benchmark_scatter.py +238 -0
  256. mlsurv-0.1.0/tests/test_benchmarking.py +2637 -0
  257. mlsurv-0.1.0/tests/test_benchmarking_roc_nan_refs.py +321 -0
  258. mlsurv-0.1.0/tests/test_bootstrap_coalesce_followup.py +381 -0
  259. mlsurv-0.1.0/tests/test_bootstrap_correctness.py +347 -0
  260. mlsurv-0.1.0/tests/test_cal_cache_thread_safety.py +231 -0
  261. mlsurv-0.1.0/tests/test_cal_precompute.py +125 -0
  262. mlsurv-0.1.0/tests/test_calibration_coalesce.py +251 -0
  263. mlsurv-0.1.0/tests/test_calibration_helpers.py +286 -0
  264. mlsurv-0.1.0/tests/test_calibration_labels.py +469 -0
  265. mlsurv-0.1.0/tests/test_calibration_metrics.py +949 -0
  266. mlsurv-0.1.0/tests/test_categorical_groups.py +541 -0
  267. mlsurv-0.1.0/tests/test_cli_calibrate.py +287 -0
  268. mlsurv-0.1.0/tests/test_cli_patient_report.py +423 -0
  269. mlsurv-0.1.0/tests/test_cli_plot.py +1379 -0
  270. mlsurv-0.1.0/tests/test_coalesced_calibration_nan.py +402 -0
  271. mlsurv-0.1.0/tests/test_coalesced_incremental_nan.py +431 -0
  272. mlsurv-0.1.0/tests/test_config_persistence.py +785 -0
  273. mlsurv-0.1.0/tests/test_constants.py +126 -0
  274. mlsurv-0.1.0/tests/test_containers.py +2787 -0
  275. mlsurv-0.1.0/tests/test_core_resolve.py +102 -0
  276. mlsurv-0.1.0/tests/test_covariance_selectors.py +567 -0
  277. mlsurv-0.1.0/tests/test_coxph_alpha_tuning.py +164 -0
  278. mlsurv-0.1.0/tests/test_ctd.py +414 -0
  279. mlsurv-0.1.0/tests/test_custom_model_tuning.py +557 -0
  280. mlsurv-0.1.0/tests/test_cv_training.py +67 -0
  281. mlsurv-0.1.0/tests/test_data_leakage.py +578 -0
  282. mlsurv-0.1.0/tests/test_demos.py +73 -0
  283. mlsurv-0.1.0/tests/test_dense_ibs.py +442 -0
  284. mlsurv-0.1.0/tests/test_device_param.py +221 -0
  285. mlsurv-0.1.0/tests/test_diagnostics_consolidation.py +284 -0
  286. mlsurv-0.1.0/tests/test_edge_cases.py +855 -0
  287. mlsurv-0.1.0/tests/test_encoding_warning.py +101 -0
  288. mlsurv-0.1.0/tests/test_epv_dedup.py +86 -0
  289. mlsurv-0.1.0/tests/test_eval_time_clipping.py +468 -0
  290. mlsurv-0.1.0/tests/test_eval_times_resolver.py +375 -0
  291. mlsurv-0.1.0/tests/test_evaluation_helpers.py +641 -0
  292. mlsurv-0.1.0/tests/test_explain.py +636 -0
  293. mlsurv-0.1.0/tests/test_export_results.py +1155 -0
  294. mlsurv-0.1.0/tests/test_export_study.py +771 -0
  295. mlsurv-0.1.0/tests/test_feature_groups_report.py +242 -0
  296. mlsurv-0.1.0/tests/test_feature_importance_enhancements.py +706 -0
  297. mlsurv-0.1.0/tests/test_feature_summary.py +617 -0
  298. mlsurv-0.1.0/tests/test_filter_numeric_for_corr.py +74 -0
  299. mlsurv-0.1.0/tests/test_format_helpers.py +33 -0
  300. mlsurv-0.1.0/tests/test_format_helpers_import_discipline.py +109 -0
  301. mlsurv-0.1.0/tests/test_friendly_errors.py +1010 -0
  302. mlsurv-0.1.0/tests/test_fssvm_validation.py +748 -0
  303. mlsurv-0.1.0/tests/test_get_metric_vignettes.py +83 -0
  304. mlsurv-0.1.0/tests/test_gnd_n_bins.py +275 -0
  305. mlsurv-0.1.0/tests/test_gnd_sample_size_coalesce.py +414 -0
  306. mlsurv-0.1.0/tests/test_guidance.py +1167 -0
  307. mlsurv-0.1.0/tests/test_heavy_censoring_warning.py +240 -0
  308. mlsurv-0.1.0/tests/test_helpers_factory.py +142 -0
  309. mlsurv-0.1.0/tests/test_hr_dynamic_ticks.py +357 -0
  310. mlsurv-0.1.0/tests/test_hr_validity_gating.py +184 -0
  311. mlsurv-0.1.0/tests/test_import_discipline.py +211 -0
  312. mlsurv-0.1.0/tests/test_importance_method.py +153 -0
  313. mlsurv-0.1.0/tests/test_importance_test_invalidation.py +229 -0
  314. mlsurv-0.1.0/tests/test_inf_risk_scores.py +296 -0
  315. mlsurv-0.1.0/tests/test_integration.py +1479 -0
  316. mlsurv-0.1.0/tests/test_interactions.py +3450 -0
  317. mlsurv-0.1.0/tests/test_interactions_regression.py +250 -0
  318. mlsurv-0.1.0/tests/test_ipcw_support_flag.py +833 -0
  319. mlsurv-0.1.0/tests/test_ipcw_truncation_messaging.py +542 -0
  320. mlsurv-0.1.0/tests/test_iter_warn.py +482 -0
  321. mlsurv-0.1.0/tests/test_kwarg_forwarding.py +189 -0
  322. mlsurv-0.1.0/tests/test_learner_plot_wrappers.py +744 -0
  323. mlsurv-0.1.0/tests/test_learner_views.py +1701 -0
  324. mlsurv-0.1.0/tests/test_lifecycle_integration.py +202 -0
  325. mlsurv-0.1.0/tests/test_lifelines_warning_filter.py +88 -0
  326. mlsurv-0.1.0/tests/test_limitations.py +1429 -0
  327. mlsurv-0.1.0/tests/test_linearity_metrics.py +801 -0
  328. mlsurv-0.1.0/tests/test_list_model_selection.py +142 -0
  329. mlsurv-0.1.0/tests/test_logging_utils.py +379 -0
  330. mlsurv-0.1.0/tests/test_manuscript_renderer.py +796 -0
  331. mlsurv-0.1.0/tests/test_metric_param_unification.py +193 -0
  332. mlsurv-0.1.0/tests/test_metrics_roc_assembly.py +169 -0
  333. mlsurv-0.1.0/tests/test_missing_indicators.py +70 -0
  334. mlsurv-0.1.0/tests/test_missingness_leakage.py +263 -0
  335. mlsurv-0.1.0/tests/test_mixin_layout.py +103 -0
  336. mlsurv-0.1.0/tests/test_model_assumptions.py +37 -0
  337. mlsurv-0.1.0/tests/test_model_recommendations_property.py +154 -0
  338. mlsurv-0.1.0/tests/test_multi_model_low_coverage_coalesce.py +522 -0
  339. mlsurv-0.1.0/tests/test_multi_model_methods.py +563 -0
  340. mlsurv-0.1.0/tests/test_new_models.py +865 -0
  341. mlsurv-0.1.0/tests/test_njobs_audit.py +773 -0
  342. mlsurv-0.1.0/tests/test_paired_comparison.py +704 -0
  343. mlsurv-0.1.0/tests/test_paired_comparison_printing.py +717 -0
  344. mlsurv-0.1.0/tests/test_parallel.py +1452 -0
  345. mlsurv-0.1.0/tests/test_parameter_sweep.py +533 -0
  346. mlsurv-0.1.0/tests/test_patient_report.py +538 -0
  347. mlsurv-0.1.0/tests/test_patient_resolve.py +187 -0
  348. mlsurv-0.1.0/tests/test_patient_select.py +112 -0
  349. mlsurv-0.1.0/tests/test_penalized_cox_selectors.py +632 -0
  350. mlsurv-0.1.0/tests/test_per_model_preprocessing.py +368 -0
  351. mlsurv-0.1.0/tests/test_permutation_importance_method.py +218 -0
  352. mlsurv-0.1.0/tests/test_persist_stat_tests.py +519 -0
  353. mlsurv-0.1.0/tests/test_ph_linearity_result_properties.py +172 -0
  354. mlsurv-0.1.0/tests/test_ph_test_overflow_suppression.py +168 -0
  355. mlsurv-0.1.0/tests/test_phase1_imports.py +135 -0
  356. mlsurv-0.1.0/tests/test_phase1_utils.py +1687 -0
  357. mlsurv-0.1.0/tests/test_phase2_feature_selection.py +1055 -0
  358. mlsurv-0.1.0/tests/test_phase2_models.py +2590 -0
  359. mlsurv-0.1.0/tests/test_phase3_evaluation.py +3673 -0
  360. mlsurv-0.1.0/tests/test_phase3_learner.py +2789 -0
  361. mlsurv-0.1.0/tests/test_phase3_tuning.py +1174 -0
  362. mlsurv-0.1.0/tests/test_phase4_cli.py +7774 -0
  363. mlsurv-0.1.0/tests/test_phase4_tables.py +179 -0
  364. mlsurv-0.1.0/tests/test_phase4_viz.py +4952 -0
  365. mlsurv-0.1.0/tests/test_pimp.py +527 -0
  366. mlsurv-0.1.0/tests/test_pipeline_unwrap.py +107 -0
  367. mlsurv-0.1.0/tests/test_plot_impl_stacklevels.py +221 -0
  368. mlsurv-0.1.0/tests/test_plot_models_best_sentinel.py +440 -0
  369. mlsurv-0.1.0/tests/test_plot_roc_nan_refs_followup.py +110 -0
  370. mlsurv-0.1.0/tests/test_plot_validation_heatmap.py +180 -0
  371. mlsurv-0.1.0/tests/test_plotly_helpers.py +87 -0
  372. mlsurv-0.1.0/tests/test_post_train_result_props.py +244 -0
  373. mlsurv-0.1.0/tests/test_prediction.py +1606 -0
  374. mlsurv-0.1.0/tests/test_preprocessing_tuning.py +434 -0
  375. mlsurv-0.1.0/tests/test_preprocessing_utils.py +115 -0
  376. mlsurv-0.1.0/tests/test_printing.py +1772 -0
  377. mlsurv-0.1.0/tests/test_printing_cv_order.py +72 -0
  378. mlsurv-0.1.0/tests/test_r_consumer_contract.py +162 -0
  379. mlsurv-0.1.0/tests/test_reference_overlap_warning_dedup.py +223 -0
  380. mlsurv-0.1.0/tests/test_report_dev.py +124 -0
  381. mlsurv-0.1.0/tests/test_report_environment_section.py +493 -0
  382. mlsurv-0.1.0/tests/test_report_eval_times.py +396 -0
  383. mlsurv-0.1.0/tests/test_report_exception_guards.py +619 -0
  384. mlsurv-0.1.0/tests/test_report_interpretation.py +365 -0
  385. mlsurv-0.1.0/tests/test_report_linearity_section.py +243 -0
  386. mlsurv-0.1.0/tests/test_report_pvalue_format.py +132 -0
  387. mlsurv-0.1.0/tests/test_report_references_section.py +553 -0
  388. mlsurv-0.1.0/tests/test_report_section_error_handling.py +137 -0
  389. mlsurv-0.1.0/tests/test_report_text_helpers.py +45 -0
  390. mlsurv-0.1.0/tests/test_reports.py +7392 -0
  391. mlsurv-0.1.0/tests/test_reports_programmatic_access.py +603 -0
  392. mlsurv-0.1.0/tests/test_reproducibility.py +438 -0
  393. mlsurv-0.1.0/tests/test_resolve_model_results.py +258 -0
  394. mlsurv-0.1.0/tests/test_results_architecture.py +783 -0
  395. mlsurv-0.1.0/tests/test_roc_subsection.py +249 -0
  396. mlsurv-0.1.0/tests/test_run_model_params_n_trials_zero.py +187 -0
  397. mlsurv-0.1.0/tests/test_run_resume.py +166 -0
  398. mlsurv-0.1.0/tests/test_save_learner.py +504 -0
  399. mlsurv-0.1.0/tests/test_search_spaces.py +1055 -0
  400. mlsurv-0.1.0/tests/test_sections_state_access_discipline.py +254 -0
  401. mlsurv-0.1.0/tests/test_setup_linearity_diagnostic.py +348 -0
  402. mlsurv-0.1.0/tests/test_setup_ph_diagnostic.py +590 -0
  403. mlsurv-0.1.0/tests/test_setup_small_subpop_warning.py +460 -0
  404. mlsurv-0.1.0/tests/test_setup_timeseries_order_warning.py +210 -0
  405. mlsurv-0.1.0/tests/test_shap_background.py +223 -0
  406. mlsurv-0.1.0/tests/test_shap_bool_dummy_masker.py +141 -0
  407. mlsurv-0.1.0/tests/test_shap_demotion.py +194 -0
  408. mlsurv-0.1.0/tests/test_shap_feature_names.py +117 -0
  409. mlsurv-0.1.0/tests/test_shap_method.py +129 -0
  410. mlsurv-0.1.0/tests/test_shared_utils.py +269 -0
  411. mlsurv-0.1.0/tests/test_show_ci_tristate.py +399 -0
  412. mlsurv-0.1.0/tests/test_silent_auc_nan_fallback.py +786 -0
  413. mlsurv-0.1.0/tests/test_small_sample_tuning_warning.py +243 -0
  414. mlsurv-0.1.0/tests/test_subpopulation_analysis.py +2105 -0
  415. mlsurv-0.1.0/tests/test_subpopulation_labels.py +111 -0
  416. mlsurv-0.1.0/tests/test_summary_best_model_direction.py +63 -0
  417. mlsurv-0.1.0/tests/test_summary_extended_lines.py +353 -0
  418. mlsurv-0.1.0/tests/test_tables_extended.py +362 -0
  419. mlsurv-0.1.0/tests/test_train_calibrate.py +994 -0
  420. mlsurv-0.1.0/tests/test_train_metrics.py +162 -0
  421. mlsurv-0.1.0/tests/test_training_setup_hardening.py +796 -0
  422. mlsurv-0.1.0/tests/test_tuned_key_lifecycle.py +103 -0
  423. mlsurv-0.1.0/tests/test_tuner_classes.py +2121 -0
  424. mlsurv-0.1.0/tests/test_tuning_contract.py +713 -0
  425. mlsurv-0.1.0/tests/test_tuning_enhancements.py +772 -0
  426. mlsurv-0.1.0/tests/test_validate_delta.py +99 -0
  427. mlsurv-0.1.0/tests/test_validate_references.py +352 -0
  428. mlsurv-0.1.0/tests/test_vignette_03_sksurv_targets.py +80 -0
  429. mlsurv-0.1.0/tests/test_vignette_smoke.py +260 -0
  430. mlsurv-0.1.0/tests/test_vignettes.py +215 -0
  431. mlsurv-0.1.0/tests/test_viz_adaptive_sizing.py +335 -0
  432. mlsurv-0.1.0/tests/test_viz_band_labels.py +197 -0
  433. mlsurv-0.1.0/tests/test_viz_context.py +262 -0
  434. mlsurv-0.1.0/tests/test_viz_diagnostics.py +788 -0
  435. mlsurv-0.1.0/tests/test_viz_distributions.py +273 -0
  436. mlsurv-0.1.0/tests/test_viz_export.py +391 -0
  437. mlsurv-0.1.0/tests/test_viz_feature_groups.py +1243 -0
  438. mlsurv-0.1.0/tests/test_viz_importance.py +193 -0
  439. mlsurv-0.1.0/tests/test_viz_metrics_helpers.py +511 -0
  440. mlsurv-0.1.0/tests/test_viz_missing.py +207 -0
  441. mlsurv-0.1.0/tests/test_viz_palettes.py +496 -0
  442. mlsurv-0.1.0/tests/test_viz_resolver_tuned.py +118 -0
  443. mlsurv-0.1.0/tests/test_viz_return_data.py +1471 -0
  444. mlsurv-0.1.0/tests/test_viz_return_data_lowlevel.py +235 -0
  445. mlsurv-0.1.0/tests/test_viz_roc.py +895 -0
  446. mlsurv-0.1.0/tests/test_viz_shap.py +56 -0
  447. mlsurv-0.1.0/tests/test_viz_subpop_facet.py +306 -0
  448. mlsurv-0.1.0/tests/test_warn_eval_times_failure.py +135 -0
  449. mlsurv-0.1.0/tests/test_warning_emission_followups.py +389 -0
  450. mlsurv-0.1.0/tests/test_warning_quality.py +953 -0
  451. mlsurv-0.1.0/tests/test_xgb_early_stopping.py +216 -0
  452. mlsurv-0.1.0/tests/test_xgbaft.py +543 -0
@@ -0,0 +1,74 @@
1
+ # Changelog
2
+
3
+ All notable changes to mlsurv are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-06-25
9
+
10
+ Initial public release of mlsurv, a low-code machine learning package for
11
+ survival analysis. mlsurv unifies modeling, tuning, evaluation, validation,
12
+ and reporting into a single API.
13
+
14
+ ### Added
15
+
16
+ - **Low-code survival analysis workflow** — a typical analysis runs `setup()`
17
+ (configure preprocessing and cross-validation) → `run()` (train, tune,
18
+ evaluate, and bootstrap every model in one call, or call `train()`, `tune()`,
19
+ `evaluate()`, and `bootstrap()` individually) → `generate_report()`
20
+ (publication-ready HTML or markdown). Additional steps slot in as needed:
21
+ `predict()` for new patients, `validate()` on an external cohort,
22
+ `train(calibrate=...)` for post-hoc `S(t|x)` calibration, `explain()` for
23
+ SHAP, `benchmark()` against reference biomarkers, and `parameter_sweep()`.
24
+ - **Results access, export, and persistence** — every result is stored on the
25
+ learner and reachable through read-only accessors (`models`, `best_model`,
26
+ `evaluation_result`, `bootstrap_result`), so you never need to capture what
27
+ `run()` returns. `export_results()` writes all tables to an Excel workbook or
28
+ CSVs, and `save_learner()` / `load_learner()` round-trip the whole session with
29
+ results intact.
30
+ - **10 survival models** across four families with a unified interface:
31
+ CoxPH, CoxNet, and Weibull AFT (linear/parametric); Random Survival Forest,
32
+ Gradient Boosting Survival Analysis, XGBoost-Cox, and XGBoost-AFT
33
+ (tree ensembles); Fast Survival SVM (kernel); DeepSurv and DeepHit (neural,
34
+ optional via the `deep` extra).
35
+ - **Configurable preprocessing pipeline** with leak-free cross-validation:
36
+ imputation (median, mean, KNN, iterative), scaling (standard, robust, minmax,
37
+ PCA), and five feature selectors (`topk`, `vif`, `correlation`, `coxlasso`,
38
+ `coxnet`).
39
+ - **Automated setup checks**: events-per-variable warnings, leakage detection,
40
+ proportional-hazards and linearity testing, and model recommendations.
41
+ - **Hyperparameter tuning** via Optuna with EPV-aware search spaces, automatic
42
+ trial sizing, convergence detection, and study persistence.
43
+ - **Multi-metric evaluation**: Harrell, IPCW, and Antolini C-index; Brier score
44
+ and integrated Brier score; time-dependent AUC(t); calibration
45
+ slope/intercept; and the Greenwood-Nam-D'Agostino test. `add_eval_times()`
46
+ registers additive report horizons (e.g. 12- and 60-month) that flow into the
47
+ time-dependent metrics without replacing the default grid.
48
+ - **External validation and benchmarking** on independent cohorts, including
49
+ delta-C, NRI, and IDI incremental metrics against reference biomarkers.
50
+ - **Post-hoc `S(t|x)` calibration**: opt-in via `train(calibrate=...)`, with
51
+ leakage-free out-of-fold fitting and a choice of methods (isotonic, low
52
+ degrees of freedom, Breslow-slope refit). The calibrator is applied wherever
53
+ the model produces survival probabilities, including cohort and patient
54
+ reports and the `validate()` transferability panel.
55
+ - **Feature explanation**: permutation importance, SHAP values and
56
+ interactions, and single-patient explanations with a SHAP waterfall and
57
+ cohort context.
58
+ - **Statistical tests**: proportional-hazards (Schoenfeld), log-rank, RMST, and
59
+ permutation-importance significance (PIMP).
60
+ - **Automated reporting**: interactive single-file HTML reports and plain-text
61
+ markdown reports (figures as PNGs), with a TRIPOD+AI compliance checklist and
62
+ 13 automatically detected limitation flags.
63
+ - **Command-line interface** with 26 subcommands for scripting and HPC
64
+ pipelines, covering the full workflow (run, train, tune, evaluate, bootstrap,
65
+ validate, predict, calibrate, explain, benchmark, sweep, plot), statistical
66
+ tests (including feature interactions), patient reports, full result export,
67
+ Optuna study management, artifact inspection/upgrade, and model listing.
68
+ - **Parallel execution**: one-line `n_jobs=-1` setup with smart auto-disable
69
+ and oversubscription guards.
70
+ - **Reproducible by default**: a single `random_state` seeds scikit-learn,
71
+ XGBoost, and PyTorch; bit-exact runs require `n_jobs=1`.
72
+ - **Inline type annotations** shipped with a `py.typed` marker (PEP 561).
73
+
74
+ [0.1.0]: https://github.com/goeckslab/mlsurv/releases/tag/v0.1.0
mlsurv-0.1.0/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alyssa Pybus
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ include CHANGELOG.md
mlsurv-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.4
2
+ Name: mlsurv
3
+ Version: 0.1.0
4
+ Summary: Low-code machine learning package for survival analysis
5
+ Author-email: Alyssa Pybus <alyssa.pybus@moffitt.org>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/goeckslab/mlsurv
8
+ Project-URL: Bug Tracker, https://github.com/goeckslab/mlsurv/issues
9
+ Keywords: survival analysis,machine learning,cox regression,random survival forest
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
17
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: numpy>=1.21.0
22
+ Requires-Dist: pandas>=1.3.0
23
+ Requires-Dist: scikit-learn>=1.2.0
24
+ Requires-Dist: scikit-survival>=0.22.0
25
+ Requires-Dist: lifelines>=0.27.0
26
+ Requires-Dist: optuna>=3.3.0
27
+ Requires-Dist: plotly>=5.18.0
28
+ Requires-Dist: mistune>=3.0.0
29
+ Requires-Dist: kaleido>=0.2.1
30
+ Requires-Dist: tabulate>=0.9.0
31
+ Requires-Dist: xgboost>=1.6.0
32
+ Requires-Dist: openpyxl>=3.0.0
33
+ Requires-Dist: shap>=0.42.0
34
+ Requires-Dist: jupyter>=1.0.0
35
+ Requires-Dist: ipykernel>=6.0.0
36
+ Provides-Extra: deep
37
+ Requires-Dist: torch>=1.9.0; extra == "deep"
38
+ Requires-Dist: pycox>=0.2.0; extra == "deep"
39
+ Provides-Extra: postgres
40
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
41
+ Provides-Extra: completion
42
+ Requires-Dist: argcomplete>=2.0.0; extra == "completion"
43
+ Provides-Extra: dev
44
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
45
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
46
+ Requires-Dist: pytest-timeout>=2.1.0; extra == "dev"
47
+ Requires-Dist: argcomplete>=2.0.0; extra == "dev"
48
+ Dynamic: license-file
49
+
50
+ <p align="center">
51
+ <img src="https://raw.githubusercontent.com/goeckslab/mlsurv/main/docs/logo/mlsurv_icon.png" alt="mlsurv logo" width="120">
52
+ </p>
53
+
54
+ <h1 align="center">mlsurv</h1>
55
+
56
+ <p align="center">
57
+ <em>Low-code machine learning package for survival analysis</em>
58
+ </p>
59
+
60
+ ---
61
+
62
+ ## Intro to mlsurv
63
+
64
+ Survival analysis in clinical research typically requires stitching together various software tools for modeling, visualization, tuning, validation, and reporting. mlsurv unifies these processes into a single package: train, tune, and validate 10 survival models, generate publication-ready reports, and test on independent cohorts — all in under 10 lines of code.
65
+
66
+ <p align="center">
67
+ <img src="https://raw.githubusercontent.com/goeckslab/mlsurv/main/docs/overview.png" alt="mlsurv overview" width="600">
68
+ </p>
69
+
70
+ ## Quick Start
71
+
72
+ ```python
73
+ from mlsurv import SurvivalLearner
74
+ from mlsurv.utils import load_survival_data
75
+
76
+ # Load data (pandas DataFrame + structured array with 'event' and 'time' fields)
77
+ X, y = load_survival_data('data.csv', time_col='OS_MONTHS', event_col='OS_STATUS')
78
+
79
+ # Train, tune, evaluate, and bootstrap all models
80
+ learner = SurvivalLearner(X, y)
81
+ learner.setup(random_state=42)
82
+ learner.run()
83
+
84
+ # Generate a publication-ready interactive HTML report
85
+ learner.generate_report('report.html')
86
+ ```
87
+
88
+ See [Vignette 01](https://github.com/goeckslab/mlsurv/blob/main/examples/vignette_01_quickstart.ipynb) for a complete walkthrough.
89
+
90
+ ### Accessing results and saving your analysis
91
+
92
+ The learner stores every result internally, so you don't need to capture what
93
+ `run()` returns. Reach any result through these read-only accessors at any time,
94
+ including after a reload:
95
+
96
+ ```python
97
+ result = learner.models['coxph'] # ModelResult: .evaluation, .bootstrap, .model, .coefficients
98
+ best = learner.best_model # winning ModelResult
99
+ eval_all = learner.evaluation_result # combined EvaluationResult (None before evaluate())
100
+ boot_all = learner.bootstrap_result # combined BootstrapResult (None before bootstrap())
101
+ ```
102
+
103
+ Export the result tables, or save and reload the whole session:
104
+
105
+ ```python
106
+ # Export all result tables to a single Excel workbook (or CSVs with format='csv')
107
+ learner.export_results('results.xlsx')
108
+
109
+ # Save the whole session and reload it later; results survive the round-trip
110
+ learner.save_learner('analysis.learner')
111
+ from mlsurv import load_learner
112
+ learner = load_learner('analysis.learner')
113
+ learner.models['coxph'] # still here after reload
114
+ ```
115
+
116
+ ## Command-Line Interface
117
+
118
+ mlsurv also provides a CLI for scripting, HPC pipelines, and quick one-off analyses:
119
+
120
+ ```bash
121
+ # Full pipeline in one command
122
+ mlsurv run data.csv --time-col OS_MONTHS --event-col OS_STATUS --output report.html
123
+
124
+ # List available models
125
+ mlsurv models
126
+
127
+ # Train and tune a specific model
128
+ mlsurv tune data.csv --time-col OS_MONTHS --event-col OS_STATUS --model rsf --n-trials 50
129
+
130
+ # Validate on an external cohort
131
+ mlsurv validate data.csv --time-col OS_MONTHS --event-col OS_STATUS \
132
+ --model coxph --validation-data external.csv \
133
+ --val-time-col OS_MONTHS --val-event-col OS_STATUS
134
+ ```
135
+
136
+ Run `mlsurv --help` for the full list of 26 subcommands, or see the
137
+ [CLI Guide](https://github.com/goeckslab/mlsurv/blob/main/docs/CLI.md) for detailed documentation and workflows.
138
+
139
+ ## Data Format
140
+
141
+ mlsurv expects a feature matrix `X` (pandas DataFrame) and a structured survival array `y` with `event` (bool) and `time` (float) fields.
142
+
143
+ **From CSV** (recommended):
144
+
145
+ ```python
146
+ from mlsurv.utils import load_survival_data
147
+
148
+ X, y = load_survival_data('data.csv', time_col='OS_MONTHS', event_col='OS_STATUS')
149
+ ```
150
+
151
+ `load_survival_data` automatically drops the time/event columns from `X` and converts events to boolean and times to float, following scikit-survival conventions.
152
+
153
+ **From existing DataFrame**:
154
+
155
+ ```python
156
+ from mlsurv.utils import to_structured_array
157
+
158
+ y = to_structured_array(times=df['OS_MONTHS'], events=df['OS_STATUS'])
159
+ X = df.drop(columns=['OS_MONTHS', 'OS_STATUS'])
160
+ ```
161
+
162
+ **From date columns** (when your data has diagnosis/follow-up dates instead of pre-computed times):
163
+
164
+ ```python
165
+ from mlsurv.utils import compute_survival_time
166
+
167
+ X, y = compute_survival_time(
168
+ df, start_col='diagnosis_date', end_col='last_followup_date',
169
+ event_col='vital_status', time_unit='months',
170
+ event_values=['deceased'],
171
+ )
172
+ ```
173
+
174
+ Missing values are handled automatically via median imputation during preprocessing (configurable via `setup(imputer=...)`).
175
+
176
+ ## Installation
177
+
178
+ Install from PyPI:
179
+
180
+ ```bash
181
+ pip install mlsurv
182
+ ```
183
+
184
+ With deep learning support (PyTorch, pycox) for DeepSurv / DeepHit:
185
+
186
+ ```bash
187
+ pip install "mlsurv[deep]"
188
+ ```
189
+
190
+ **macOS note:** the XGBoost models (`xgbaft`, `xgbcox`) need the OpenMP runtime,
191
+ which macOS does not ship by default. If you see an error about `libomp.dylib`
192
+ failing to load, install it once with Homebrew:
193
+
194
+ ```bash
195
+ brew install libomp
196
+ ```
197
+
198
+ To install the latest unreleased version from GitHub:
199
+
200
+ ```bash
201
+ pip install git+https://github.com/goeckslab/mlsurv.git
202
+ ```
203
+
204
+ For development:
205
+
206
+ ```bash
207
+ git clone https://github.com/goeckslab/mlsurv.git
208
+ cd mlsurv
209
+ pip install -e ".[dev]"
210
+ ```
211
+
212
+ See [CONTRIBUTING.md](https://github.com/goeckslab/mlsurv/blob/main/CONTRIBUTING.md) for the
213
+ architecture overview, coding rules, and test conventions.
214
+
215
+ ## Features
216
+
217
+ - **Low-code interface**: `setup()` / `run()` / `predict()` / `generate_report()` for a full analysis in under 10 lines of code ([Architecture](https://github.com/goeckslab/mlsurv/blob/main/docs/architecture.md))
218
+ - **10 survival models** across 4 families (linear, ensemble, kernel, neural) with unified interface ([Models](https://github.com/goeckslab/mlsurv/blob/main/docs/architecture.md#model-inventory))
219
+ - **Configurable preprocessing**: Imputation, scaling, and 5 feature selectors with leak-free CV pipelines ([Pipeline](https://github.com/goeckslab/mlsurv/blob/main/docs/pipeline.md))
220
+ - **Automated checks**: EPV warnings, leakage detection, PH and linearity testing, model recommendations ([Pipeline](https://github.com/goeckslab/mlsurv/blob/main/docs/pipeline.md#automated-setup-checks))
221
+ - **Optuna tuning**: EPV-aware search spaces, auto-trial sizing, convergence detection, study persistence ([Evaluation](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md#hyperparameter-tuning))
222
+ - **Multi-metric evaluation**: Harrell/IPCW/Antolini C-index, Brier/IBS, AUC(t), calibration slope/intercept, GND test ([Metrics](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md#evaluation-metrics))
223
+ - **Multi-scale evaluation**: Subpopulation analysis, prospective patient prediction, and single-patient HTML reports with SHAP waterfall + cohort context ([Evaluation](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md)); feature importance, SHAP, interactions, and individual patient explanations ([Feature Analysis](https://github.com/goeckslab/mlsurv/blob/main/docs/feature-analysis.md))
224
+ - **External validation & benchmarking**: Independent cohort validation, delta-C/NRI/IDI incremental metrics ([Validation](https://github.com/goeckslab/mlsurv/blob/main/docs/validation.md))
225
+ - **S(t|x) calibration**: Opt-in per-model calibration via `train(calibrate=...)` (isotonic / lowdof / breslow_slope) fit on leakage-free OOF predictions and applied automatically across evaluate / predict / validate, with a calibration banner in reports ([Calibration](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md#stx-calibration))
226
+ - **Automated reporting**: 12-section interactive HTML report, 14 limitation flags, TRIPOD+AI compliance checklist ([Reporting](https://github.com/goeckslab/mlsurv/blob/main/docs/reporting.md))
227
+ - **Parallel computing**: One-line `n_jobs=-1` setup with smart auto-disable and no oversubscription
228
+ - **26 CLI subcommands** for scripting and HPC pipelines ([CLI Guide](https://github.com/goeckslab/mlsurv/blob/main/docs/CLI.md))
229
+ - **Reproducible by default**: Single `random_state` seeds all frameworks (scikit-learn, XGBoost, PyTorch). Bit-exact reproducibility requires `n_jobs=1`; see [Reproducibility](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md#reproducibility)
230
+
231
+ ## Documentation
232
+
233
+ | Guide | Description |
234
+ |-------|-------------|
235
+ | [Architecture & Models](https://github.com/goeckslab/mlsurv/blob/main/docs/architecture.md) | Four-stage workflow, 10 survival models, complexity tiers, unified interface |
236
+ | [Pipeline Configuration](https://github.com/goeckslab/mlsurv/blob/main/docs/pipeline.md) | Data loading, `setup()`, cross-validation, preprocessing, automated checks |
237
+ | [Model Development & Evaluation](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md) | Training, tuning, metrics, bootstrap CIs, model comparison, subpopulation analysis, patient prediction |
238
+ | [Feature Analysis](https://github.com/goeckslab/mlsurv/blob/main/docs/feature-analysis.md) | Feature importance, SHAP, interactions, individual patient explanations |
239
+ | [Validation & Benchmarking](https://github.com/goeckslab/mlsurv/blob/main/docs/validation.md) | External cohort validation, incremental benchmarking metrics |
240
+ | [Reporting & Compliance](https://github.com/goeckslab/mlsurv/blob/main/docs/reporting.md) | Limitation flags, HTML reports, TRIPOD+AI checklist, data export |
241
+ | [CLI Guide](https://github.com/goeckslab/mlsurv/blob/main/docs/CLI.md) | 26 command-line subcommands for scripting and HPC |
242
+ | [Tutorial Vignettes](https://github.com/goeckslab/mlsurv/tree/main/examples) | 7 Jupyter notebooks from quickstart to immunotherapy case study |
243
+
244
+ ## Supported Models
245
+
246
+ mlsurv includes 10 survival models across 4 categories:
247
+
248
+ **Linear/Parametric (3)**
249
+ | Model | Description |
250
+ |-------|-------------|
251
+ | CoxPH | Cox Proportional Hazards |
252
+ | CoxNet | Elastic Net penalized Cox |
253
+ | Weibull AFT | Parametric Weibull Accelerated Failure Time model |
254
+
255
+ **Tree-Based Ensemble (4)**
256
+ | Model | Description |
257
+ |-------|-------------|
258
+ | RSF | Random Survival Forest |
259
+ | GBSA | Gradient Boosting Survival Analysis |
260
+ | XGBoost-Cox | XGBoost with survival:cox objective |
261
+ | XGBoost AFT | XGBoost with Accelerated Failure Time objective |
262
+
263
+ **Support Vector Machine (1)**
264
+ | Model | Description |
265
+ |-------|-------------|
266
+ | FSSVM | Fast Survival SVM |
267
+
268
+ **Neural Networks (2)**
269
+ | Model | Description |
270
+ |-------|-------------|
271
+ | DeepSurv | Continuous-time Cox neural network |
272
+ | DeepHit | Discrete-time neural network (DeepHitSingle) |
273
+
274
+ > **Note**: All 10 models assume a single event type. See [Limitations](#limitations) for clinical implications.
275
+
276
+ ## Limitations
277
+
278
+ - Single-event right-censored outcomes only (no competing risks, no time-varying covariates)
279
+ - See [Reporting & Compliance](https://github.com/goeckslab/mlsurv/blob/main/docs/reporting.md#limitation-flags) for the full list of 14 automatically detected limitation flags
280
+
281
+ ## Citation
282
+
283
+ If you use mlsurv in published work, please cite:
284
+
285
+ > mlsurv: Low-code machine learning for survival analysis. Goecks Lab, Moffitt Cancer Center. https://github.com/goeckslab/mlsurv
286
+
287
+ ## Changelog
288
+
289
+ See [CHANGELOG.md](https://github.com/goeckslab/mlsurv/blob/main/CHANGELOG.md) for the release history.
290
+
291
+ ## License
292
+
293
+ MIT License - see [LICENSE](https://github.com/goeckslab/mlsurv/blob/main/LICENSE)
294
+
295
+ ## Acknowledgments
296
+
297
+ mlsurv was built in part with [Claude Code](https://claude.com/claude-code), Anthropic's agentic coding tool.
mlsurv-0.1.0/README.md ADDED
@@ -0,0 +1,248 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/goeckslab/mlsurv/main/docs/logo/mlsurv_icon.png" alt="mlsurv logo" width="120">
3
+ </p>
4
+
5
+ <h1 align="center">mlsurv</h1>
6
+
7
+ <p align="center">
8
+ <em>Low-code machine learning package for survival analysis</em>
9
+ </p>
10
+
11
+ ---
12
+
13
+ ## Intro to mlsurv
14
+
15
+ Survival analysis in clinical research typically requires stitching together various software tools for modeling, visualization, tuning, validation, and reporting. mlsurv unifies these processes into a single package: train, tune, and validate 10 survival models, generate publication-ready reports, and test on independent cohorts — all in under 10 lines of code.
16
+
17
+ <p align="center">
18
+ <img src="https://raw.githubusercontent.com/goeckslab/mlsurv/main/docs/overview.png" alt="mlsurv overview" width="600">
19
+ </p>
20
+
21
+ ## Quick Start
22
+
23
+ ```python
24
+ from mlsurv import SurvivalLearner
25
+ from mlsurv.utils import load_survival_data
26
+
27
+ # Load data (pandas DataFrame + structured array with 'event' and 'time' fields)
28
+ X, y = load_survival_data('data.csv', time_col='OS_MONTHS', event_col='OS_STATUS')
29
+
30
+ # Train, tune, evaluate, and bootstrap all models
31
+ learner = SurvivalLearner(X, y)
32
+ learner.setup(random_state=42)
33
+ learner.run()
34
+
35
+ # Generate a publication-ready interactive HTML report
36
+ learner.generate_report('report.html')
37
+ ```
38
+
39
+ See [Vignette 01](https://github.com/goeckslab/mlsurv/blob/main/examples/vignette_01_quickstart.ipynb) for a complete walkthrough.
40
+
41
+ ### Accessing results and saving your analysis
42
+
43
+ The learner stores every result internally, so you don't need to capture what
44
+ `run()` returns. Reach any result through these read-only accessors at any time,
45
+ including after a reload:
46
+
47
+ ```python
48
+ result = learner.models['coxph'] # ModelResult: .evaluation, .bootstrap, .model, .coefficients
49
+ best = learner.best_model # winning ModelResult
50
+ eval_all = learner.evaluation_result # combined EvaluationResult (None before evaluate())
51
+ boot_all = learner.bootstrap_result # combined BootstrapResult (None before bootstrap())
52
+ ```
53
+
54
+ Export the result tables, or save and reload the whole session:
55
+
56
+ ```python
57
+ # Export all result tables to a single Excel workbook (or CSVs with format='csv')
58
+ learner.export_results('results.xlsx')
59
+
60
+ # Save the whole session and reload it later; results survive the round-trip
61
+ learner.save_learner('analysis.learner')
62
+ from mlsurv import load_learner
63
+ learner = load_learner('analysis.learner')
64
+ learner.models['coxph'] # still here after reload
65
+ ```
66
+
67
+ ## Command-Line Interface
68
+
69
+ mlsurv also provides a CLI for scripting, HPC pipelines, and quick one-off analyses:
70
+
71
+ ```bash
72
+ # Full pipeline in one command
73
+ mlsurv run data.csv --time-col OS_MONTHS --event-col OS_STATUS --output report.html
74
+
75
+ # List available models
76
+ mlsurv models
77
+
78
+ # Train and tune a specific model
79
+ mlsurv tune data.csv --time-col OS_MONTHS --event-col OS_STATUS --model rsf --n-trials 50
80
+
81
+ # Validate on an external cohort
82
+ mlsurv validate data.csv --time-col OS_MONTHS --event-col OS_STATUS \
83
+ --model coxph --validation-data external.csv \
84
+ --val-time-col OS_MONTHS --val-event-col OS_STATUS
85
+ ```
86
+
87
+ Run `mlsurv --help` for the full list of 26 subcommands, or see the
88
+ [CLI Guide](https://github.com/goeckslab/mlsurv/blob/main/docs/CLI.md) for detailed documentation and workflows.
89
+
90
+ ## Data Format
91
+
92
+ mlsurv expects a feature matrix `X` (pandas DataFrame) and a structured survival array `y` with `event` (bool) and `time` (float) fields.
93
+
94
+ **From CSV** (recommended):
95
+
96
+ ```python
97
+ from mlsurv.utils import load_survival_data
98
+
99
+ X, y = load_survival_data('data.csv', time_col='OS_MONTHS', event_col='OS_STATUS')
100
+ ```
101
+
102
+ `load_survival_data` automatically drops the time/event columns from `X` and converts events to boolean and times to float, following scikit-survival conventions.
103
+
104
+ **From existing DataFrame**:
105
+
106
+ ```python
107
+ from mlsurv.utils import to_structured_array
108
+
109
+ y = to_structured_array(times=df['OS_MONTHS'], events=df['OS_STATUS'])
110
+ X = df.drop(columns=['OS_MONTHS', 'OS_STATUS'])
111
+ ```
112
+
113
+ **From date columns** (when your data has diagnosis/follow-up dates instead of pre-computed times):
114
+
115
+ ```python
116
+ from mlsurv.utils import compute_survival_time
117
+
118
+ X, y = compute_survival_time(
119
+ df, start_col='diagnosis_date', end_col='last_followup_date',
120
+ event_col='vital_status', time_unit='months',
121
+ event_values=['deceased'],
122
+ )
123
+ ```
124
+
125
+ Missing values are handled automatically via median imputation during preprocessing (configurable via `setup(imputer=...)`).
126
+
127
+ ## Installation
128
+
129
+ Install from PyPI:
130
+
131
+ ```bash
132
+ pip install mlsurv
133
+ ```
134
+
135
+ With deep learning support (PyTorch, pycox) for DeepSurv / DeepHit:
136
+
137
+ ```bash
138
+ pip install "mlsurv[deep]"
139
+ ```
140
+
141
+ **macOS note:** the XGBoost models (`xgbaft`, `xgbcox`) need the OpenMP runtime,
142
+ which macOS does not ship by default. If you see an error about `libomp.dylib`
143
+ failing to load, install it once with Homebrew:
144
+
145
+ ```bash
146
+ brew install libomp
147
+ ```
148
+
149
+ To install the latest unreleased version from GitHub:
150
+
151
+ ```bash
152
+ pip install git+https://github.com/goeckslab/mlsurv.git
153
+ ```
154
+
155
+ For development:
156
+
157
+ ```bash
158
+ git clone https://github.com/goeckslab/mlsurv.git
159
+ cd mlsurv
160
+ pip install -e ".[dev]"
161
+ ```
162
+
163
+ See [CONTRIBUTING.md](https://github.com/goeckslab/mlsurv/blob/main/CONTRIBUTING.md) for the
164
+ architecture overview, coding rules, and test conventions.
165
+
166
+ ## Features
167
+
168
+ - **Low-code interface**: `setup()` / `run()` / `predict()` / `generate_report()` for a full analysis in under 10 lines of code ([Architecture](https://github.com/goeckslab/mlsurv/blob/main/docs/architecture.md))
169
+ - **10 survival models** across 4 families (linear, ensemble, kernel, neural) with unified interface ([Models](https://github.com/goeckslab/mlsurv/blob/main/docs/architecture.md#model-inventory))
170
+ - **Configurable preprocessing**: Imputation, scaling, and 5 feature selectors with leak-free CV pipelines ([Pipeline](https://github.com/goeckslab/mlsurv/blob/main/docs/pipeline.md))
171
+ - **Automated checks**: EPV warnings, leakage detection, PH and linearity testing, model recommendations ([Pipeline](https://github.com/goeckslab/mlsurv/blob/main/docs/pipeline.md#automated-setup-checks))
172
+ - **Optuna tuning**: EPV-aware search spaces, auto-trial sizing, convergence detection, study persistence ([Evaluation](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md#hyperparameter-tuning))
173
+ - **Multi-metric evaluation**: Harrell/IPCW/Antolini C-index, Brier/IBS, AUC(t), calibration slope/intercept, GND test ([Metrics](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md#evaluation-metrics))
174
+ - **Multi-scale evaluation**: Subpopulation analysis, prospective patient prediction, and single-patient HTML reports with SHAP waterfall + cohort context ([Evaluation](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md)); feature importance, SHAP, interactions, and individual patient explanations ([Feature Analysis](https://github.com/goeckslab/mlsurv/blob/main/docs/feature-analysis.md))
175
+ - **External validation & benchmarking**: Independent cohort validation, delta-C/NRI/IDI incremental metrics ([Validation](https://github.com/goeckslab/mlsurv/blob/main/docs/validation.md))
176
+ - **S(t|x) calibration**: Opt-in per-model calibration via `train(calibrate=...)` (isotonic / lowdof / breslow_slope) fit on leakage-free OOF predictions and applied automatically across evaluate / predict / validate, with a calibration banner in reports ([Calibration](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md#stx-calibration))
177
+ - **Automated reporting**: 12-section interactive HTML report, 14 limitation flags, TRIPOD+AI compliance checklist ([Reporting](https://github.com/goeckslab/mlsurv/blob/main/docs/reporting.md))
178
+ - **Parallel computing**: One-line `n_jobs=-1` setup with smart auto-disable and no oversubscription
179
+ - **26 CLI subcommands** for scripting and HPC pipelines ([CLI Guide](https://github.com/goeckslab/mlsurv/blob/main/docs/CLI.md))
180
+ - **Reproducible by default**: Single `random_state` seeds all frameworks (scikit-learn, XGBoost, PyTorch). Bit-exact reproducibility requires `n_jobs=1`; see [Reproducibility](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md#reproducibility)
181
+
182
+ ## Documentation
183
+
184
+ | Guide | Description |
185
+ |-------|-------------|
186
+ | [Architecture & Models](https://github.com/goeckslab/mlsurv/blob/main/docs/architecture.md) | Four-stage workflow, 10 survival models, complexity tiers, unified interface |
187
+ | [Pipeline Configuration](https://github.com/goeckslab/mlsurv/blob/main/docs/pipeline.md) | Data loading, `setup()`, cross-validation, preprocessing, automated checks |
188
+ | [Model Development & Evaluation](https://github.com/goeckslab/mlsurv/blob/main/docs/evaluation.md) | Training, tuning, metrics, bootstrap CIs, model comparison, subpopulation analysis, patient prediction |
189
+ | [Feature Analysis](https://github.com/goeckslab/mlsurv/blob/main/docs/feature-analysis.md) | Feature importance, SHAP, interactions, individual patient explanations |
190
+ | [Validation & Benchmarking](https://github.com/goeckslab/mlsurv/blob/main/docs/validation.md) | External cohort validation, incremental benchmarking metrics |
191
+ | [Reporting & Compliance](https://github.com/goeckslab/mlsurv/blob/main/docs/reporting.md) | Limitation flags, HTML reports, TRIPOD+AI checklist, data export |
192
+ | [CLI Guide](https://github.com/goeckslab/mlsurv/blob/main/docs/CLI.md) | 26 command-line subcommands for scripting and HPC |
193
+ | [Tutorial Vignettes](https://github.com/goeckslab/mlsurv/tree/main/examples) | 7 Jupyter notebooks from quickstart to immunotherapy case study |
194
+
195
+ ## Supported Models
196
+
197
+ mlsurv includes 10 survival models across 4 categories:
198
+
199
+ **Linear/Parametric (3)**
200
+ | Model | Description |
201
+ |-------|-------------|
202
+ | CoxPH | Cox Proportional Hazards |
203
+ | CoxNet | Elastic Net penalized Cox |
204
+ | Weibull AFT | Parametric Weibull Accelerated Failure Time model |
205
+
206
+ **Tree-Based Ensemble (4)**
207
+ | Model | Description |
208
+ |-------|-------------|
209
+ | RSF | Random Survival Forest |
210
+ | GBSA | Gradient Boosting Survival Analysis |
211
+ | XGBoost-Cox | XGBoost with survival:cox objective |
212
+ | XGBoost AFT | XGBoost with Accelerated Failure Time objective |
213
+
214
+ **Support Vector Machine (1)**
215
+ | Model | Description |
216
+ |-------|-------------|
217
+ | FSSVM | Fast Survival SVM |
218
+
219
+ **Neural Networks (2)**
220
+ | Model | Description |
221
+ |-------|-------------|
222
+ | DeepSurv | Continuous-time Cox neural network |
223
+ | DeepHit | Discrete-time neural network (DeepHitSingle) |
224
+
225
+ > **Note**: All 10 models assume a single event type. See [Limitations](#limitations) for clinical implications.
226
+
227
+ ## Limitations
228
+
229
+ - Single-event right-censored outcomes only (no competing risks, no time-varying covariates)
230
+ - See [Reporting & Compliance](https://github.com/goeckslab/mlsurv/blob/main/docs/reporting.md#limitation-flags) for the full list of 14 automatically detected limitation flags
231
+
232
+ ## Citation
233
+
234
+ If you use mlsurv in published work, please cite:
235
+
236
+ > mlsurv: Low-code machine learning for survival analysis. Goecks Lab, Moffitt Cancer Center. https://github.com/goeckslab/mlsurv
237
+
238
+ ## Changelog
239
+
240
+ See [CHANGELOG.md](https://github.com/goeckslab/mlsurv/blob/main/CHANGELOG.md) for the release history.
241
+
242
+ ## License
243
+
244
+ MIT License - see [LICENSE](https://github.com/goeckslab/mlsurv/blob/main/LICENSE)
245
+
246
+ ## Acknowledgments
247
+
248
+ mlsurv was built in part with [Claude Code](https://claude.com/claude-code), Anthropic's agentic coding tool.