# The Nonlinear and Threshold Effect of Built Environment on Ride-Hailing Travel Demand
## 4 Methodology  
### XGBoost  
XGBoost, proposed by [PERSON] and [PERSON] [41], and based on GBDT, shows good advantages in prediction performance and prevention of overfitting. Therefore, this study uses XGBoost to investigate the nonlinear relationship between built environment variables and ride-hailing travel demand. This method belongs to a forward iterative model. The iterative process will train multiple trees. Finally, the aggregated prediction from each tree within the sample serves as the predicted value for the entire sample in the model:  
\[\hat{y}_{i}^{(t)}=\sum_{i}^{k=1}f_{k}(x_{i})=\hat{y}_{i}^{(t-1)}+f_{t}(x_{i}) \tag{2}\]  
where \(\hat{y}_{i}^{(t)}\) is the predicted value of ride-hailing travel demand in the grid \(i\) after the iteration \(t\), \(f_{k}(x_{i})\) is the predicted value of the tree \(k\), \(\hat{y}_{i}^{(t-1)}\) is the predicted demand for ride-hailing in the grid after the \((t-1)\) iteration, and \(x_{i}\) is the built environment in the grid \(i\). \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Variable** & **Description** & **Mean** & **S.D.** & **Source** \\ \hline \multirow{2}{*}{Financial facility} & Number of financial facilities divided by & & & \\  & the grid area (count/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Accommodation service} & Number of accommodation services & & & \\  & divided by the grid area (count/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Science, education, and culture} & Number of science, education, and & & & \\  & culture facilities divided by the grid area (count/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Scenic spot} & Number of scenic spots divided by the & & & \\  & grid area (count/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Commercial residence} & Number of commercial residences & & & \\  & divided by the grid area (count/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Leisure service} & Number of leisure services divided by & & & \\  & the grid area (count/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Medical facility} & Number of medical facilities divided by & & & \\  & the grid area (count/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Design} & & & & \\ \hline \multirow{2}{*}{Road length} & The length of roads divided by the grid & & & \\  & area (km/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Non-motorized road length} & The length of non-motorized roads & & & \\  & divided by the grid area (km/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Number of road nodes} & Number of road nodes divided by the & & & \\  & grid area (count/km\({}^{2}\)) & & & \\ \hline \multirow{2}{*}{Diversity} & & & & \\ \hline \multirow{2}{*}{Land use mix} & The entropy value of thirteen categories & & & \\  & of POI & & & \\ \hline \multirow{2}{*}{Destination accessibility} & & & & \\ \hline \multirow{2}{*}{Distance to CBD} & Distance from the grid centroid to CBD & & & \\  & (km) & & & \\ \hline \multirow{2}{*}{Distance to transit} & & & & \\ \hline \multirow{2}{*}{Distance to bus stop} & Distance from the grid centroid to the & & & \\  & nearest bus stop (km) & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: _Cont._Overfitting is one of the defects that hinders the accuracy and performance of the model in machine learning [23], and XGBoost prevents model overfitting by adding regularization terms:  
\[L(\phi)=\sum_{i=1}^{n}l(y_{i},\hat{y}_{i})+\sum_{k=1}^{t}\Omega(f_{k}) \tag{3}\]  
\[\Omega(f_{k})=\gamma T_{k}+\frac{1}{2}\lambda\sum_{j=1}^{T}w_{j}^{2} \tag{4}\]  
where \(n\) represents the total number of grids within the study area, \(l(y_{i},\hat{y}_{i})\) represents the loss function calculated between the predicted value and the true value, \(\Omega(f_{k})\) is the regularization term, \(T_{k}\) is the number of leaf nodes of the tree \(k\), \(w_{j}^{2}\) is the weight assigned to the tree node, and \(\gamma\) and \(\lambda\) are penalty factors, respectively.