当前位置: 首页 > news >正文

【Survival Analysis】【机器学习】【1】

前言:

       今年在做的一个博士课题项目,主要是利用病人的数据,训练出一个AI模型,做因果分析,

以及个性化治疗。自己一直是做通讯+AI方向的,这个系列主要参考卡梅隆大学的教程,以及临床医生的角度 了解一下医学领域的相关背景,

       参考 卡梅隆大学的 George 的【  Predicting Time-to-Event Outcomes - A Tour of Survival Analysis from Classical to Modern】


目录:

  1. Survail Aanalysis 简介
  2. 生存分析基本问题框架
  3. 传统回归模型解决此类问题

一  Survial Analysis 简介

       预测事件发生时间,主要包括下面几类:

1: 死亡时间(本篇只讨论这个)
2: 疾病复发时间
3: 出院时间
4: 病情再次复发时间
5: 用户退订服务时间

Predicting time-to-event outcomes:

• Time until death Phrase terminology using this example

• Time until disease relapse

• Time until hospital discharge

• Time until a convicted criminal reoffends

• Time until a user unsubscribes from a service

本教程主要讨论下面几个事:

  1. 生存分析基本问题框架

  2. 经典估计方法与预测误差评估

  3. 机器学习界神经网络新进展

  4. 开放挑战与未来方向


 二  生存分析基本问题框架

     2.1 数据集说明

          

feaures中文翻译
Gluten allergy麸质过敏
Immuno suppressant免疫抑制剂
Low resting heart rate静息心率过低
Irregular heart beat心律不齐
High BMI高身体质量指数

   ​​​​​​在预测病人生存期时候,通长会遇到病人还是活着的情况,这个时候6天要用大于等于6来替代

2.2  持续时间预测专用回归模型:

      它的数据集标签跟一般的机器学习模型不一样,有两个:

      标签1: 生存时间y

      标签2: 死亡状态状态\delta

2.3  例子

     活着的例子

     

     死亡的例子

2.4  生存曲线

         生存曲线(Survival Curves)是生存分析(Survival Analysis)中的核心可视化工具,用于描述特定群体随时间推移的生存(或事件未发生)概率。以下是结构化解读:

基本定义

  • 数学表达: S(t) = P(T > t)
    表示个体存活时间T超过时间点t的概率,其中t≥0

  • 典型类型:

    • Kaplan-Meier曲线 (非参数估计,临床研究最常用)

    • Nelson-Aalen曲线 (累积风险函数估计)

    • 参数模型曲线 (如指数分布/威布尔分布拟合)

2.4  生存曲线解读

正向事件 vs 负向事件

场景示例时间延长含义应用领域典型场景
Time until death
(死亡时间)
"优"(生存期越长越好)癌症治疗评估、慢性病预后分析
Hospital length of stay
(住院时长)
"劣"(时间越长越差)医疗资源优化、医院运营效率评估

 在给定的特征向量, 我们希望了解生存函数  p(t|x)

       

2.5 理论基础 (Remarks on Theory)

           总体而言,我们无法对所有时间点都任意精确地估计条件生存函数S(t | x)(即使在训练数据中,也存在最大观测时间!)。

      典型的假设是:专注于在某个时间范围内估计S(t | x)
     • 删失机制和删失率至关重要!当删失率较高时(例如40%以上),生存估计器的效果会显著下降 →预测硬盘故障时间、音乐人签约唱片公司时间等任务会变得非常困难


三  传统Linear regression 问题

     预测回归模型,我们常用的是Linear Regression ,但是这里面存在一个问题。

当人是活着的,其生存时间是大于记录的时间。这个跟其它任务是不一样的。

     针对该任务的特殊性,在模型的方向,自己也想到了一个创新的点,目前代码刚刚写完,预计本周会把结果做出来。

 这边要感谢印度的 Mrutyunjaya Hiremath,做了回复

  • Master of Technology
  • Researcher at REVA University

   You’re bringing up a very important issue. Predicting how long a patient will survive differs greatly from typical machine learning tasks like image recognition or binary classification. You’re right that using linear or logistic regression isn’t enough—these models don’t work well when survival time and censored data (patients still alive) are involved.

Better Models for Your Task

Since this is a survival prediction problem, here are some models that are more suitable and still offer good interpretability:

  1. Cox Proportional Hazards (CoxPH)
  • A widely used model in medicine.
  • It gives clear results like hazard ratios, which doctors can understand.
  • Available in Python (lifelines) and R (survival).
  1. Random Survival Forests (RSF)
    • A tree-based model that handles complex data and works well with censored information.
    • You can still interpret which features are most important.
  2. DeepSurv
    • A deep learning version of CoxPH that can capture more complex patterns.
    • It is still interpretable using tools like SHAP.
    • Paper link :

      Article Deep Survival: A Deep Cox Proportional Hazards Network

    • Code link : https://github.com/jaredleekatzman/DeepSurv
  3. Multi-task Logistic Regression (MTLR)
    • Models survival over different time points.
    • More flexible than Cox in some situations.

Better Metrics to Evaluate the Model

Standard metrics like AUC, R², or MSE are not the best fit for survival tasks. Instead, try these:

  • C-index (Concordance Index): Checks how well the model ranks patients by survival time.
  • Time-dependent AUC: AUC score that changes with time.
  • Brier Score and Integrated Brier Score: Measure the accuracy of the model’s probability predictions over time.

These are made specifically for survival models and take censored data into account.

Try Some Early Plots

Before training models, you could try plotting Kaplan-Meier survival curves for groups like GCB vs. ABC or high vs. low KPS score. This can help show which features matter early on.

Useful Tools

  • Python: scikit-survival, lifelines
  • R: survival, survminer, randomForestSRC
  • Deep Learning: DeepSurv GitHub link: https://github.com/jaredleekatzman/DeepSurv

Final Thoughts

In clinical settings, having a model that doctors can trust and understand is just as important as accuracy. You’ve raised a great question that applies to many medical AI projects.

教程: https://sites.google.com/view/survival-analysis-tutorial

代码: https://github.com/georgehc/dksa


相关文章:

  • Android 11.0 framework系统首次开机添加锁屏壁纸的功能
  • Go语言报错总结(文章持续更新)
  • 洛谷蓝桥杯刷题
  • CRC校验码的检错性能(三)——基于对偶码重量分布计算漏检概率
  • STM32江科大----IIC
  • 004 Vue Cli脚手架(vue2)
  • 在CentOS上安装Docker需要注意的事项
  • 基于Arduino的ESP8266连接OneNET云平台(MQTT协议 物模型)(一)ESP8266固件烧录
  • Solidity基础入门—web3
  • GitHub 趋势日报 (2025年04月06日)
  • MATLAB中movmin函数用法
  • Python爬虫第5节-urllib的异常处理、链接解析及 Robots 协议分析
  • 深度探索:策略学习与神经网络在强化学习中的应用
  • WHAT - JavaScript 中 Object.defineProperty() 和 Proxy 对比
  • 使用LangChain Agents构建Gradio及Gradio Tools(4)——Gradio Tools:gradio_tools库
  • 小刚说C语言刷题——第17讲 循环之for语句
  • ARM处理器内核全解析:从Cortex到Neoverse的架构与区别
  • 优选算法第七讲:分治
  • 关于如何在 Ansible 中安全使用 `rm -rf` 或类似操作的完整指南
  • C++第14届蓝桥杯b组学习笔记
  • 自己做网站有名/我想自己建立一个网站
  • 外贸网站源码怎么建/武汉网络推广网络营销
  • 做网站架构需要什么工具/四平网络推广
  • 微信优惠群怎么做网站/seo文章生成器
  • 注册公司北京/深圳优化网站
  • 全球网站域名/外包公司到底值不值得去