我正在使用mlr包在 R 中进行机器学习。我在数据集上使用cvcoxboost算法,并希望计算输出的 brier 分数。
这应该有效,因为listMeasures(cvcoxboost.tsk)
还列出了 measure ibrier
。整个代码如下所示:
cvcoxboost.lrn = makeLearner("surv.cv.CoxBoost")
cvcoxboost.tsk = makeSurvTask(data = data, target = c("time", "event"))
cvcoxboost.mod = train(cvcoxboost.lrn, cvcoxboost.tsk, subset = data.train)
cvcoxboost.tsk.pred = predict(cvcoxboost.mod, task = cvcoxboost.tsk, subset = data.test)
listMeasures(cvcoxboost.tsk) # "iauc.uno" "featperc" "ibrier" "timeboth" "timetrain" "timepredict" "cindex.uno" "cindex"
performance(cvcoxboost.tsk.pred, measures = mlr::cindex)
performance(cvcoxboost.tsk.pred, measures = cindex.uno, model = cvcoxboost.mod, task = cvcoxboost.tsk)
performance(cvcoxboost.tsk.pred, measures = mlr::ibrier, model = cvcoxboost.mod, task = cvcoxboost.tsk)
...我收到错误No method for evaluating predicted probabilities from objects in class: CoxBoost
。