个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Machine Learning for Competing Risks in mlr3
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
mlr3cmprsk extends the mlr3 ecosystem for
machine learning with competing risks right-censored survival
outcomes. It provides task, learner, prediction, and measure
abstractions that support model training, resampling, benchmarking, and
evaluation within the mlr3 framework.
Compare a Fine-Gray model with the Aalen-Johansen baseline using 3-fold
CV on the built-in pbc task.查看完整 README ↗Package website: mlr3cmprsk
mlr3cmprsk extends the mlr3 ecosystem for
machine learning with competing risks right-censored survival
outcomes. It provides task, learner, prediction, and measure
abstractions that support model training, resampling, benchmarking, and
evaluation within the mlr3 framework.
Install the development version from GitHub:
# install.packages("pak")
pak::pak("mlr-org/mlr3cmprsk")
Compare a Fine-Gray model with the Aalen-Johansen baseline using 3-fold
CV on the built-in pbc task.
library(mlr3cmprsk)
set.seed(42L)
task = tsk("pbc")
task$select(c("age", "chol", "albumin", "bili"))
# Stratify by event status so all splits keep all available causes
task$set_col_roles(cols = "status", add_to = "stratum")
learners = lrns(c("cmprsk.fg", "cmprsk.aalen"))
bm_grid = benchmark_grid(task, learners, rsmp("cv", folds = 3L))
bm = benchmark(bm_grid)
measures = list(
# AUC(t = 100)
msr("cmprsk.auc", time = 100, id = "auc_t100"),
# BS(t = 100)
msr("cmprsk.brier", time = 100, id = "bs_t100"),
# IBS: 100 equally spaced times from 0 to each test fold's 90th follow-up percentile
msr("cmprsk.ibs", id = "ibs")
)
# By default, each measure averages the cause-specific scores, with weights
# equal to the observed event frequencies in each test fold
bm$score(measures)[, .(task_id, learner_id, iteration, auc_t100, bs_t100, ibs)]
## task_id learner_id iteration auc_t100 bs_t100 ibs
## 1: pbc cmprsk.fg 1 0.7813865 0.1564736 0.1088478
## 2: pbc cmprsk.fg 2 0.7663073 0.1750273 0.1155973
## 3: pbc cmprsk.fg 3 0.8390308 0.1371346 0.1028685
## 4: pbc cmprsk.aalen 1 0.5000000 0.2182071 0.1487853
## 5: pbc cmprsk.aalen 2 0.5000000 0.2200391 0.1585370
## 6: pbc cmprsk.aalen 3 0.5000000 0.2181846 0.1609251
All currently available measures use cumulative incidence function
(CIF) predictions and are calculated with riskRegression::Score();
the Integrated Brier Score (IBS) is the default measure for competing
risks tasks.
| ID | Measure | Category | Prediction Type |
|---|---|---|---|
cmprsk.ibs | Integrated Brier score | Scoring Rule | cif |
cmprsk.brier | Brier score at a specified time | Scoring Rule | cif |
cmprsk.auc | Time-dependent AUC at a specified time | Discrimination | cif |
The package includes two learners, both of which return CIF predictions for every cause.
| ID | Learner | Underlying Package |
|---|---|---|
cmprsk.aalen | Aalen-Johansen estimator | survival::survfit() |
cmprsk.fg | Fine-Gray subdistribution hazards model | cmprsk::crr() |
For additional models, see the available
list
in mlr3extralearners, including CoxBoost (cmprsk.coxboost) and
random forests (cmprsk.rfsrc).
We welcome contributions and pull requests to add new competing risks
learners in mlr3extralearners.
If you use mlr3cmprsk in your work, please cite it using the following
BibTeX entry:
@Manual{mlr3cmprsk,
title = {mlr3cmprsk: Competing Risks Machine Learning for 'mlr3'},
author = {John Zobolas and Andreas Bender},
year = {2026},
note = {R package version 0.0.7, https://github.com/mlr-org/mlr3cmprsk},
url = {https://mlr3cmprsk.mlr-org.com},
}
This project follows a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.