tree2 = DecisionTreeRegressor(max_depth=2) tree2.fit(X, y - tree1_pred)
Fit second decision tree on residuals of first tree