'Accelerated Failure Time' label issues

Hi everyone,

I’ve been trying to run this tutorial for Accelerated Failure Time in survival analysis.

When I run the following example:

import numpy as np
import xgboost as xgb

# 4-by-2 Data matrix
X = np.array([[1, -1], [-1, 1], [0, 1], [1, 0]])
dtrain = xgb.DMatrix(X)

# Associate ranged labels with the data matrix.
# This example shows each kind of censored labels.
#                         uncensored    right     left  interval
y_lower_bound = np.array([      2.0,     3.0, -np.inf,     4.0])
y_upper_bound = np.array([      2.0, +np.inf,     4.0,     5.0])

dtrain.set_float_info('label_lower_bound', y_lower_bound)
dtrain.set_float_info('label_upper_bound', y_upper_bound)

I get the error “Unknown metainfo: label_lower_bound”. I’m aware that the AFL model is a new addition to XGBoost, I just want to know if the current version supports upper and lower labels in a DMatrix yet (since it’s used in the tutorial provided by XGBoost).

Any clarity will be much appreciated.


AFT is brand new feature and is not part of 1.0. It will be part of 1.1 release.

Thanks for the fast response. Guess I’ll have to wait for 1.1 then.

You can install nightly builds to access latest features.

Thanks, that sorted me out!