Xgboost for survival

I am trying to do a simple survival analysis where I have a set of predictors, and upper bound, and lower bound like in the documentation https://xgboost.readthedocs.io/en/latest/tutorials/aft_survival_analysis.html#how-to-use. My issues are:

  1. When i try to run the documentation code without any modifications, i get [0] train-aft-nloglik:nan and nans for all the 5 iterations. I don’t think that’s right.
  2. There is no documentation on how to predict. For calculating an AUC. In regular xgboost I would use predict_proba.

Thanks in advance!

  1. Make sure you are using the latest version of XGBoost. When I tried running the example with the latest XGBoost (1.3.0), I got:
[0]	train-aft-nloglik:2.30142
[1]	train-aft-nloglik:2.24184
[2]	train-aft-nloglik:2.18633
[3]	train-aft-nloglik:2.13462
[4]	train-aft-nloglik:2.08645
  1. You should call the predict() function:
bst = xgb.train(params, dtrain, num_boost_round=5,
                evals=[(dtrain, 'train')])
print(bst.predict(dtrain))  # predict on the training data matrix

I also suggest that you look at the visual demo for the AFT survival: https://github.com/dmlc/xgboost/blob/master/demo/aft_survival/aft_survival_viz_demo.py

Thank you very much. Do you have any suggestion on getting the prediction probabilities (predict_proba in regular xgboost) that I can use to calculate the AUC?

Survival analysis is not classification, so predict_proba() is not available. Similarly, you cannot compute the AUC.