Reputation: 8437
I am using the mlr package to do machine learning in R. I am using a the cvcoxboost algorithmn on a dataset and would like to calculate the brier score of the output.
This should work, since listMeasures(cvcoxboost.tsk)
also lists the measurement ibrier
. The entire code looks like this:
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)
...and I receive the error No method for evaluating predicted probabilities from objects in class: CoxBoost
.
Upvotes: 0
Views: 741
Reputation: 698
ibrier only works for certain learners that are supported by the pec package like randomForestSRC or cox. This is currently not well documented enough, but you can look into the pec package to see which models are supported.
Upvotes: 2