# XGBoost tutorial - problem with understanding transformation

I'm following tutorial in xgboost docs: https://xgboost.readthedocs.io/en/latest/model.html

I'm stuck on this step:

I don't understand how the first term (loss) was transformed, they seem to not be equal (sympy says so too). I'm thinking there may be some magic with constant term involved?

## 1 Answer

Recall that you're minimizing $obj^{(t)}$ with respect to the function $f_t$. The $\sum(y_i - \hat{y_i}^{(t - 1)})^2$ term, which appears to be missing from the second line, went into the constant, because its derivative with respect to $f_t$ is always going to be zero.