<blockquote>
<p>How could I achieve so through XGBoost ?</p>
</blockquote>
<p>If you are ok with a departure from proportional hazards assumption, try the Accelerated Failure Time (AFT) model (see <a href="https://xgboost.readthedocs.io/en/latest/tutorials/aft_survival_analysis.html" rel="nofollow noreferrer">documentation</a>, and <a href="https://arxiv.org/abs/2006.04920" rel="nofollow noreferrer">paper</a>). Instead of modeling <code>HR,</code> AFT models try predicting log of survival time directly.</p>
<p>If you want to stick to proportional hazards, looks like there is a way to estimate $h_0(t)$, at least in R - so you may have to replicate it in python (see <a href="https://datascience.stackexchange.com/questions/65266/how-do-i-predict-survival-curves-using-xgboost">this</a> stack overflow answer).</p>
Cox PH model with XGBoost, how to get survival time?
<pre><code>clf = XGBRegressor(objective='survival:cox', min_child_weight=4, gamma=0.50,
                   subsample=0.6, eta=1, max_depth=10, booster='gblinear', reg_lambda = 2)
</code></pre>

<p>When I use this objective, I only get the hazard ratio (HR) ( i.e., as HR = exp(marginal_prediction) in the proportional hazard function h(t) = h0(t) * HR). I would like to get the whole survival time prediction. How could I achieve so through XGBoost ?</p>

<p>Thank you for your help</p>