跳到主内容
@wquguru
精选88r/MachineLearning Top(RSS)技巧与观点

基于NHANES数据的冠心病风险分类与数据泄露审计

Classifying coronary heart disease risk from NHANES survey data (2011-2018), with a full leakage audit and calibration check [P]

原文
发到 X
推荐理由

完整的数据泄露审计与校准实操指南,对做医疗AI的同学极具参考价值,建议直接参考其处理流程。

Github repo :

Github 仓库:

https://github.com/YouCele/nhanes-chd-classification

https://github.com/YouCele/nhanes-chd-classification

I built a project that predicts self-reported, physician-diagnosed coronary heart disease using four cycles of NHANES data (2011-2012 to 2017-2018), about 21,500 adults after cleaning. It compares logistic regression with random forest and gradient boosting, trained on demographics, blood pressure, body measurements and a lipid panel.

我构建了一个项目,利用四个周期的 NHANES 数据(2011-2012 至 2017-2018),在清洗后约 21,500 名成年人的数据上预测自我报告且经医生诊断的冠心病。该项目比较了逻辑回归、随机森林和梯度提升算法,训练特征包括人口统计学信息、血压、身体测量指标和血脂面板。

NHANES has a questionnaire section that asks directly about other cardiovascular diagnoses, like stroke, heart attack and angina, along with the CHD outcome itself. If I included those variables, PR-AUC jumped from 0.23 to 0.51. That's mostly the model learning that people who report one cardiovascular diagnosis tend to report others too, not something about real risk factors. So I removed that whole section and wrote up how big the leakage effect was, instead of just quietly dropping the columns.

NHANES 有一个问卷部分,直接询问其他心血管诊断(如中风、心脏病发作和心绞痛),以及冠心病结果本身。如果我包含这些变量,PR-AUC 会从 0.23 跃升至 0.51。这主要是因为模型学到了报告一种心血管诊断的人往往也会报告其他诊断这一现象,而非关于真实风险因素的信息。因此,我删除了该部分的全部内容,并详细说明了数据泄露效应的严重程度,而不是悄悄丢弃这些列。

The class weighted logistic regression, needed because CHD prevalence is only about 4%, gave badly miscalibrated raw probabilities. The mean predicted risk was close to 30% while the real rate was 4%. I fixed this with a sigmoid recalibration fit on the development set, before the test set was touched.

由于冠心病患病率仅为约 4%,我使用了类别加权逻辑回归,但其原始概率校准严重失准。平均预测风险接近 30%,而实际发生率为 4%。我在接触测试集之前,通过在开发集上进行 Sigmoid 重新校准拟合来修正这一问题。

I also picked and froze the decision threshold on the dev set before looking at the test set, so the reported test metrics aren't tuned after the fact.

我还在查看测试集之前在开发集上选定并固定了决策阈值,以确保报告的测试指标并非事后调整的结果。

Final results on the held out test set: ROC-AUC 0.875 and PR-AUC 0.239 for logistic regression, and random forest and gradient boosting came out about the same. Age alone gets 0.83 AUC. Blood pressure, cholesterol and body size explain most of what's left. PPV at the chosen threshold is 0.13, so most positive predictions are wrong, which is expected given how rare CHD is in this data, and I state this directly in the report instead of leaving it out.

在保留的测试集上的最终结果:逻辑回归的 ROC-AUC 为 0.875,PR-AUC 为 0.239;随机森林和梯度提升的表现大致相同。仅使用年龄即可达到 0.83 的 AUC。血压、胆固醇和体型解释了剩余的大部分差异。在所选阈值下的阳性预测值(PPV)为 0.13,这意味着大多数阳性预测是错误的。鉴于该数据中冠心病极为罕见,这是预期之中的情况,我在报告中明确指出了这一点,而没有将其省略。

Smoking status, diabetes and blood pressure medication use aren't in the current features. NHANES has all three, I just haven't added them yet.

吸烟状况、糖尿病和降压药使用情况不在当前的特征中。NHANES 包含这三项数据,我只是尚未添加它们。

Happy to hear feedback, especially on the calibration step or anything in how I handled the leakage that looks wrong

欢迎提供反馈,特别是关于校准步骤或我在处理数据泄露方面的任何看起来有误的地方。

submitted by /u/YouJonaa

由 /u/YouJonaa 提交

[link] [comments]

[链接] [评论]

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件