loft-br / xgboost-survival-embeddings

Improving XGBoost survival analysis with embeddings and debiased estimators
https://loft-br.github.io/xgboost-survival-embeddings/
Apache License 2.0
313 stars 51 forks source link

plot_ci function is not defined #23

Closed drjgauthier closed 3 years ago

drjgauthier commented 3 years ago

Great package! I'm having difficulties generating survival plots though.

# fitting xgbse model
xgbse_model = XGBSEKaplanNeighbors(n_neighbors=50)
xgbse_model.fit(xgbdata, y)

# predicting
event_probs = xgbse_model.predict(xgbdata)
event_probs.head()

#Survival curves
mean, upper_ci, lower_ci = xgbse_model.predict(xgbdata, return_ci=True)

# plotting CIs
plot_ci(mean, upper_ci, lower_ci)

I get the following error message:

plot_ci(mean, upper_ci, lower_ci) Traceback (most recent call last): File "", line 1, in NameError: name 'plot_ci' is not defined

Everything else is working fine. Is the function part of a different module/package?

drjgauthier commented 3 years ago

Just found it in the documentation... https://loft-br.github.io/xgboost-survival-embeddings/examples/confidence_interval.html My bad! WIll close the issue.