Revealing the Impact of the Built Environment on the Temporal Heterogeneity of Urban Vitality Using Ensemble Machine Learning
Abstract
1. Introduction
2. Literature Review
2.1. Associations Between Built Environment and Urban Vitality
2.2. Study Scale of Built Environment and Urban Vitality
3. Materials and Methods
3.1. Study Area
3.2. Data Sources and Variable Description
3.2.1. Dependent Variables
3.2.2. Independent Variables
3.3. Ordinary Least Squares (OLS) Model
3.4. Ensemble Machine Learning
- This study uses 8 standard machine learning algorithms to model BE and UV data in four time periods. Moreover, the regression coefficient of determination (R2) was used as the evaluation index to comprehensively compare the prediction performances of each algorithm under different time periods (Table 2).
- 2.
- Four algorithms (GBDT, LightGBM, XGBoost, and Random Forest) with stable performance and high R2 in all time periods were comprehensively considered as the final base learners. It should be noted that although XGBoost was not one of the top four algorithms in the “weekday evening” time period, since it always performed excellently in other time periods, to ensure the consistency of the model structure between different time periods and reduce the external interference caused by algorithm differences, it was still included in the unified modeling system.
- 3.
- To further improve the performance of each base model, the Bayesian Optimization method was used to automatically tune its key hyperparameters to ensure that it participated in the ensemble modeling under the optimal parameter configuration.
- 4.
- In the Stacking strategy, Linear Regression was selected as the meta learner to remodel the prediction results of the four base learners. Logistic Regression can effectively learn the optimal weights of each base learner in the final prediction and implement a weighted combination of the results, thereby integrating each model’s advantages and improving the ensemble model’s robustness. The algorithm principle of ensemble machine learning is shown in Figure 3.
3.5. SHAP Algorithm
4. Results
4.1. The Spatial and Temporal Differentiation of Urban Vitality
4.2. Linear Regression Results of Influencing Factors of UV Based on OLS Model
4.3. Relative Importance of BE Variables
4.4. Nonlinear and Threshold Effects of Built Environment Variables
4.5. Interaction Effects of Key Built Environment Variables
4.5.1. Interaction Effects Between Function and Morphology Dimensions
4.5.2. Interaction Effects Between Morphology and Ecology Dimensions
4.5.3. Interaction Effects Between Ecology and Function Dimensions
4.6. Clustering Results and SHAP Local Explanations
5. Discussion
5.1. Summary of the Impact of the BE on the Temporal Heterogeneity of UV
5.2. Selection of the Optimal Machine Learning Model
5.3. Policy Implications for Urban Planning
5.4. Limitations
6. Conclusions
Supplementary Materials
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| BE | Built environment |
| UV | Urban vitality |
| CLC | Community life circle |
| SPOID | Service POI density |
| OPOID | Office POI density |
| PPOID | Public POI density |
| POIM | POI mixability |
| FAR | Floor area ratio |
| BD | Building density |
| ABH | Average building height |
| MBH | Maximum building height |
| ABA | Average building area |
| MBA | Maximum building area |
| RD | Road density |
| ID | Intersection density |
| BSD | Bus stop density |
| MSA | Metro station accessibility |
| FCV | Fractional vegetation cover |
| NDVI | Normalized Difference Vegetation Index |
| RESI | Remote sensing ecological index |
References
- He, S.; Zhang, Z.; Yu, S.; Xia, C.; Tung, C.-L. Investigating the effects of urban morphology on vitality of community life circles using machine learning and geospatial approaches. Appl. Geogr. 2024, 167, 103287. [Google Scholar] [CrossRef]
- Shi, H.; Xu, L.; Ma, D. Does spatial distribution heterogeneity exist in video games: Evidence from Genshin Impact’s map. Cities 2025, 159, 105798. [Google Scholar] [CrossRef]
- Zhang, Q.; Cheng, T.; Xu, P.; Jiang, X. Balancing Heritage Conservation and Urban Vitality Through a Multi-Tiered Governance Strategy: A Case Study of Nanjing’s Yihe Road Historic District, China. Land 2025, 14, 1894. [Google Scholar] [CrossRef]
- Akinci, Z.S.; Marquet, O.; Delclòs-Alió, X.; Miralles-Guasch, C. Urban vitality and seniors’ outdoor rest time in Barcelona. J. Transp. Geogr. 2022, 98, 103241. [Google Scholar] [CrossRef]
- Chen, L.; Zhao, L.; Xiao, Y.; Lu, Y. Investigating the spatiotemporal pattern between the built environment and urban vibrancy using big data in Shenzhen, China. Comput. Environ. Urban Syst. 2022, 95, 101827. [Google Scholar] [CrossRef]
- Dong, W.; Wang, N.; Dong, Y.; Cao, J. Examining the nonlinear and interactive effects of built environment characteristics on travel satisfaction. J. Transp. Geogr. 2025, 123, 104111. [Google Scholar] [CrossRef]
- Güller, C.; Varol, C. Unveiling the daily rhythm of urban space: Exploring the influence of built environment on spatiotemporal mobility patterns. Appl. Geogr. 2024, 170, 103366. [Google Scholar] [CrossRef]
- Chen, W.; Wu, A.N.; Biljecki, F. Classification of urban morphology with deep learning: Application on urban vitality. Comput. Environ. Urban Syst. 2021, 90, 101706. [Google Scholar] [CrossRef]
- Wang, Z.; Wang, X.; Liu, Y.; Zhu, L. Identification of 71 factors influencing urban vitality and examination of their spatial dependence: A comprehensive validation applying multiple machine-learning models. Sustain. Cities Soc. 2024, 108, 105491. [Google Scholar] [CrossRef]
- Li, X.; Li, Y.; Jia, T.; Zhou, L.; Hijazi, I.H. The six dimensions of built environment on urban vitality: Fusion evidence from multi-source data. Cities 2022, 121, 103482. [Google Scholar] [CrossRef]
- Ding, Z.; Wang, H. What are the key and catalytic external factors affecting the vitality of urban blue-green space? a case study of Nanjing Main Districts, China. Ecol. Indic. 2024, 158, 111478. [Google Scholar] [CrossRef]
- Wu, H.; Ming, Y.; Liu, Y. Investigating the influence of morphologic and functional polycentric structures on urban heat island: A case of Chongqing, China. Sustain. Cities Soc. 2024, 114, 105790. [Google Scholar] [CrossRef]
- Sun, Y.; Liu, X.; Wang, R.; Wang, Y.; Yan, X. Nonlinear effects of built environment on ride splitting ratio: Discrepancies across sharing motivations. J. Transp. Geogr. 2025, 126, 104255. [Google Scholar] [CrossRef]
- Tang, S.; Ta, N. How the built environment affects the spatiotemporal pattern of urban vitality: A comparison among different urban functional areas. Comput. Urban Sci. 2022, 2, 39. [Google Scholar] [CrossRef] [PubMed]
- Doan, Q.C.; Ma, J.; Chen, S.; Zhang, X. Nonlinear and threshold effects of the built environment, road vehicles and air pollution on urban vitality. Landsc. Urban Plan. 2025, 253, 105204. [Google Scholar] [CrossRef]
- Duan, Z.; Zhao, H.; Li, Z. Non-linear effects of built environment and socio-demographics on activity space. J. Transp. Geogr. 2023, 111, 103671. [Google Scholar] [CrossRef]
- Xiao, L.; Lo, S.; Liu, J.; Zhou, J.; Li, Q. Nonlinear and synergistic effects of TOD on urban vibrancy: Applying local explanations for gradient boosting decision tree. Sustain. Cities Soc. 2021, 72, 103063. [Google Scholar] [CrossRef]
- Jiang, Y.; Huang, Z.; Zhou, X.; Chen, X. Evaluating the impact of urban morphology on urban vitality: An exploratory study using big geo-data. Int. J. Digit. Earth 2024, 17, 2327571. [Google Scholar] [CrossRef]
- Wang, J.; Biljecki, F. Unsupervised machine learning in urban studies: A systematic review of applications. Cities 2022, 129, 103925. [Google Scholar] [CrossRef]
- Liu, Y.; Li, Y.; Yang, W.; Hu, J. Exploring nonlinear effects of built environment on jogging behavior using random forest. Appl. Geogr. 2023, 156, 102990. [Google Scholar] [CrossRef]
- Wang, Z.; Zhou, R.; Rui, J.; Yu, Y. Revealing the impact of urban spatial morphology on land surface temperature in plain and plateau cities using explainable machine learning. Sustain. Cities Soc. 2025, 118, 106046. [Google Scholar] [CrossRef]
- Lundberg, S.M.; Erion, G.; Chen, H.; De Grave, A.; Prutkin, J.M.; Nair, B.; Katz, R.; Himmelfarb, J.; Lee, S.I. From local explanations to global understanding with explainable AI for trees. Nat. Mach. Intell. 2020, 2, 56–67. [Google Scholar] [CrossRef]
- Wu, Z.; Qiao, R.; Zhao, S.; Liu, X.; Gao, S.; Liu, Z.; Ao, X.; Zhou, S.; Wang, Z.; Jiang, Q. Nonlinear forces in urban thermal environment using bayesian optimization-based ensemble learning. Sci. Total Environ. 2022, 838, 156348. [Google Scholar] [CrossRef]
- Yan, M.; Yang, J.; Ni, X.; Liu, K.; Wang, Y.; Xu, F. Urban waterlogging susceptibility assessment based on hybrid ensemble machine learning models: A case study in the metropolitan area in Beijing, China. J. Hydrol. 2024, 630, 130695. [Google Scholar] [CrossRef]
- Bansal, P.; Quan, S.J. Examining temporally varying nonlinear effects of urban form on urban heat island using explainable machine learning: A case of Seoul. Build. Environ. 2024, 247, 110957. [Google Scholar] [CrossRef]
- Tao, S.; Rowe, F.; Shan, H. Nonlinearities and threshold points in the effect of contextual features on the spatial and temporal variability of bus use in Beijing using explainable machine learning: Predictable or uncertain trips? J. Transp. Geogr. 2025, 123, 104126. [Google Scholar] [CrossRef]
- Li, Z.; Zhao, G. Revealing the spatio-temporal heterogeneity of the association between the built environment and urban vitality in Shenzhen. ISPRS Int. J. Geo-Inf. 2023, 12, 433. [Google Scholar] [CrossRef]
- Zhang, Z.; Liu, J.; Wang, C.; Zhao, Y.; Zhao, X.; Li, P.; Sha, D. A spatial projection pursuit model for identifying comprehensive urban vitality on blocks using multisource geospatial data. Sustain. Cities Soc. 2024, 100, 104998. [Google Scholar] [CrossRef]
- Zhang, Z.; Zhai, G.; Xie, K.; Xiao, F. Exploring the nonlinear effects of ridesharing on public transit usage: A case study of San Diego. J. Transp. Geogr. 2022, 104, 103449. [Google Scholar] [CrossRef]
- Ye, Y.; Li, D.; Liu, X. How block density and typology affect urban vitality: An exploratory analysis in Shenzhen, China. Urban Geogr. 2018, 39, 631–652. [Google Scholar] [CrossRef]
- Liu, S.; Ge, J.; Ye, X.; Wu, C.; Bai, M. Urban vitality assessment at the neighborhood scale with geo-data: A review toward implementation. J. Geogr. Sci. 2023, 33, 1482–1504. [Google Scholar] [CrossRef]
- Li, S.; Wu, C.; Lin, Y.; Li, Z.; Du, Q. Urban morphology promotes urban vibrancy from the spatiotemporal and synergetic perspectives: A case study using multisource data in Shenzhen, China. Sustainability 2020, 12, 4829. [Google Scholar] [CrossRef]
- Mouratidis, K.; Poortinga, W. Built environment, urban vitality and social cohesion: Do vibrant neighborhoods foster strong communities. Landsc. Urban Plan. 2020, 204, 103951. [Google Scholar] [CrossRef]
- Zeng, C.; Song, Y.; He, Q.; Shen, F. Spatially explicit assessment on urban vitality: Case studies in Chicago and Wuhan. Sustain. Cities Soc. 2018, 40, 296–306. [Google Scholar] [CrossRef]
- Hu, X.; Zhu, W.; Shen, X.; Bai, R.; Shi, Y.; Li, C.; Zhao, L. Exploring the predictive ability of the CA–Markov model for urban functional area in Nanjing old city. Sci. Rep. 2024, 14, 18453. [Google Scholar] [CrossRef] [PubMed]
- Yang, J.; Cao, J.; Zhou, Y. Elaborating non-linear associations and synergies of subway access and land uses with urban vitality in Shenzhen. Transp. Res. Part A Policy Pract. 2021, 144, 74–88. [Google Scholar] [CrossRef]
- Dutta, I.; Basu, T.; Das, A. Spatial analysis of COVID-19 incidence and its determinants using spatial modeling: A study on India. Environ. Chall. 2021, 4, 100096. [Google Scholar] [CrossRef] [PubMed]
- Dong, X.; Yu, Z.; Cao, W.; Shi, Y.; Ma, Q. A survey on ensemble learning. Front. Comput. Sci. 2020, 14, 241–258. [Google Scholar] [CrossRef]
- Lundberg, S.M.; Lee, S.I. A unified approach to interpreting model predictions. In Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017. [Google Scholar] [CrossRef]
- Sundararajan, M.; Najmi, A. The many Shapley values for model explanation. In Proceedings of the International Conference on Machine Learning, Vienna, Austria, 12–18 July 2020; pp. 9269–9278. [Google Scholar] [CrossRef]
- Yang, W.; Fei, J.; Li, Y.; Chen, H.; Liu, Y. Unraveling nonlinear and interaction effects of multilevel built environment features on outdoor jogging with explainable machine learning. Cities 2024, 147, 104813. [Google Scholar] [CrossRef]
- Lyu, G.; Angkawisittpan, N.; Fu, X.; Sonasang, S. Investigating the relationship between built environment and urban vitality using big data. Sci. Rep. 2025, 15, 579. [Google Scholar] [CrossRef]
- Li, Y.; Yao, E.; Liu, S.; Yang, Y. Spatiotemporal influence of built environment on intercity commuting trips considering nonlinear effects. J. Transp. Geogr. 2024, 114, 103744. [Google Scholar] [CrossRef]
- Kim, S.; Lee, S. Nonlinear relationships and interaction effects of an urban environment on crime incidence: Application of urban big data and an interpretable machine learning method. Sustain. Cities Soc. 2023, 91, 104419. [Google Scholar] [CrossRef]
- An, R.; Tong, Z.; Tan, B. Revealing the relationship between 2D/3D built environment and jobs-housing separation coupling nonlinearity and spatial nonstationarity. J. Transp. Geogr. 2025, 123, 104112. [Google Scholar] [CrossRef]
- Dong, Q.; Cai, J.; Chen, S.; He, P.; Chen, X. Spatiotemporal analysis of urban green spatial vitality and the corresponding influencing factors: A case study of Chengdu, China. Land 2022, 11, 1820. [Google Scholar] [CrossRef]
- Jiang, Y.; Han, Y.; Liu, M.; Ye, Y. Street vitality and built environment features: A data-informed approach from fourteen Chinese cities. Sustain. Cities Soc. 2022, 79, 103724. [Google Scholar] [CrossRef]
- Yang, C.; Guan, X.; Xu, Q.; Xing, W.; Chen, X.; Chen, J.; Jia, P. How can SHAP (SHapley Additive exPlanations) interpretations improve deep learning based urban cellular automata model. Comput. Environ. Urban Syst. 2024, 111, 102133. [Google Scholar] [CrossRef]
- Murtagh, F.; Contreras, P. Algorithms for hierarchical clustering: An overview. Wiley Interdiscip. Rev. Data Min. Knowl. Discov. 2012, 2, 86–97. [Google Scholar] [CrossRef]
- Long, Y.; Jiao, S.; Yu, Y.; Xiao, K. An analysis of spatial vitality distribution and formation mechanisms in historical urban areas based on multi-source big data: A case study of Changsha. Front. Archit. Res. 2025, in press. [Google Scholar] [CrossRef]
- Ling, Z.; Zheng, X.; Chen, Y.; Qian, Q.; Zheng, Z.; Meng, X.; Kuang, J.; Chen, J.; Yang, N.; Shi, X. The nonlinear relationship and synergistic effects between built environment and urban vitality at the neighborhood scale: A case study of guangzhou’s central urban area. Remote Sens. 2024, 16, 2826. [Google Scholar] [CrossRef]
- Angel, A.; Cohen, A.; Nelson, T.; Plaut, P. Evaluating the relationship between walking and street characteristics based on big data and machine learning analysis. Cities 2024, 151, 105111. [Google Scholar] [CrossRef]
- Lin, J.; Zhuang, Y.; Zhao, Y.; Li, H.; He, X.; Lu, S. Measuring the non-linear relationship between three-dimensional built environment and urban vitality based on a random forest model. Int. J. Environ. Res. Public Health 2022, 20, 734. [Google Scholar] [CrossRef]
- Moreno, C.; Allam, Z.; Chabaud, D.; Gall, C.; Pratlong, F. Introducing the “15-minute city”: Sustainability, resilience and place identity in future post-pandemic cities. Smart Cities 2021, 4, 93–111. [Google Scholar] [CrossRef]











| Category | Metrics | Formula | Description |
|---|---|---|---|
| Function | Service POI density (SPOID) | Where is the total number of service POI in unit, and is the area of each unit. | |
| Office POI density (OPOID) | Where is the total number of production POI in unit, and is the area of each unit. | ||
| Public POI density (PPOID) | , Where is the total number of public POI in unit, and is the area of each unit. | ||
| POI mixability (POIM) | Where is the percentage of POI types in a unit. | ||
| Morphology | Floor area ratio (FAR) | Where is the total area of building in a unit, and is the area of each unit. | |
| Building density (BD) | Where is the base area of building, is the number of buildings in a unit, and is the area of each unit. | ||
| Average building height (ABH) | Where is the building height, is the number of buildings in a unit. | ||
| Maximum building height (MBH) | Where is the height of the tallest building in a unit. | ||
| Average building area (ABA) | Where is the Maximum building area in a unit, and is the number of buildings in a unit. | ||
| Maximum building area (MBA) | Where is the Maximum building area in a unit. | ||
| Transportation | Road density (RD) | Where is the total length of the roads in a unit, and is the area of each unit. | |
| Intersection density (ID) | Where is the total number of road intersections in a unit, and is the area of each unit. | ||
| Bus stop density (BSD) | Where is the total number of bus stops in a unit, and is the area of each unit. | ||
| Metro station accessibility (MSA) | Where is the distance of the centre of gravity of the unit from the nearest metro station. | ||
| Ecology | Fractional vegetation cover (FCV) | Where represents the area of vegetation coverage and is the area of each unit. | |
| Normalized Difference Vegetation Index (NDVI) | Where is the reflection value in the near-infrared band and is the reflection value in the red band. | ||
| Remote sensing ecological index (RESI) | Where is the normalized difference vegetation index, is the relative humidity, is the Land surface temperature, and is the normalized difference built-up and soil index. |
| Model | R2 (Coefficient of Determination) | |||
|---|---|---|---|---|
| Weekday Daytime | Weekday Nighttime | Weekend Daytime | Weekend Nighttime | |
| GBDT | 0.8423 | 0.6749 | 0.7649 | 0.6242 |
| LightGBM | 0.8220 | 0.7390 | 0.7945 | 0.6459 |
| XGBoost | 0.7976 | 0.6219 | 0.7438 | 0.6776 |
| Random Forest | 0.7862 | 0.7779 | 0.7955 | 0.7167 |
| K-Nearest Neighbors | 0.7343 | 0.5640 | 0.5808 | 0.5293 |
| Decision Tree | 0.6350 | 0.5662 | 0.4842 | 0.1706 |
| Ridge Regression | 0.2077 | 0.6597 | 0.2516 | 0.5970 |
| Linear Regression | 0.1791 | 0.6775 | 0.2649 | 0.6199 |
| Stacking (Select GBDT, LightGBM, XGBoost and Random Forest) | 0.8039 | 0.7567 | 0.7816 | 0.6730 |
| Metrics | Coefficient | Std | Tolerance | VIF |
|---|---|---|---|---|
| SPOID | 5.266 | 0.034 | 0.190 | 5.266 |
| OPOID | 4.712 | 0.116 | 0.212 | 4.712 |
| PPOID | 3.316 | 0.001 | 0.319 | 3.136 |
| POIM | 2.493 | 0.002 | 0.401 | 2.492 |
| FAR | 0.538 | 0.008 | 0.109 | 8.055 |
| BD | −0.032 | 0.012 | 0.160 | 6.241 |
| ABH | 3.076 | 0.001 | 0.325 | 3.076 |
| MBH | 2.111 | 0.001 | 0.474 | 2.111 |
| ABA | 1.660 | 0.001 | 0.602 | 1.660 |
| MBA | 1.464 | 0.001 | 0.683 | 1.464 |
| RD | 1.335 | 0.039 | 0.749 | 1.335 |
| ID | 1.428 | 0.043 | 0.093 | 10.728 |
| BSD | 2.789 | 0.003 | 0.359 | 2.789 |
| MSA | 1.237 | 0.001 | 0.808 | 1.237 |
| FCV | 10.728 | 0.009 | 0.136 | 9.347 |
| NDVI | 10.356 | 0.011 | 0.086 | 11.583 |
| RESI | 11.583 | 0.013 | 0.253 | 8.427 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Chen, X.; Yang, J.; Mai, J.; Cui, A.; Gu, X. Revealing the Impact of the Built Environment on the Temporal Heterogeneity of Urban Vitality Using Ensemble Machine Learning. Land 2025, 14, 2182. https://doi.org/10.3390/land14112182
Chen X, Yang J, Mai J, Cui A, Gu X. Revealing the Impact of the Built Environment on the Temporal Heterogeneity of Urban Vitality Using Ensemble Machine Learning. Land. 2025; 14(11):2182. https://doi.org/10.3390/land14112182
Chicago/Turabian StyleChen, Xuyang, Junyan Yang, Jingjing Mai, Ao Cui, and Xinyue Gu. 2025. "Revealing the Impact of the Built Environment on the Temporal Heterogeneity of Urban Vitality Using Ensemble Machine Learning" Land 14, no. 11: 2182. https://doi.org/10.3390/land14112182
APA StyleChen, X., Yang, J., Mai, J., Cui, A., & Gu, X. (2025). Revealing the Impact of the Built Environment on the Temporal Heterogeneity of Urban Vitality Using Ensemble Machine Learning. Land, 14(11), 2182. https://doi.org/10.3390/land14112182

