Walking is not only a primitive and convenient transport mode but also an important integrant of physical activity, which is beneficial for the promotion of public health, alleviation of traffic congestion, and mitigation of transportation-induced pollution. In modern China, cities are expanding rapidly, people are enjoying a dramatic improvement in living standards, and the pace of life is accelerating. As a result, urban people, including adolescents, tend to travel in motorized modes increasingly more and walk less. The prevalence of physical inactivity among adolescents has brought about a series of health issues, such as deterioration of physical fitness, obesity, and some non-communicable diseases (for example, diabetes and hypertension). Travel to school is among the most important routine travels for adolescents. Promoting adolescents' propensity of walking to school can effectively help them integrate physical activity into daily life and thus enhance their overall physical activity level. Hence, scholars from diverse disciplines (for example, geography, urban planning, and public health) have been drawn to examine the relationships between the built environment and walking to school. However, the current research is insufficient in the following two aspects. First, the existing research is mainly based on the Western context, whereas few studies have been conducted in China. Second, the majority of existing studies assumed a linear or generalized linear (for example, log-linear) relationship between the built environment and walking to school, and no studies, to the best of our knowledge, have examined the non-linear relationships between them. Therefore, this study, taking Xiamen, China as the case and employing its large-scale travel behavior survey dataset in 2015, explored the non-linear effects of the built environment on adolescents' propensity of walking to school. We applied a state-of-the-art machine learning method, namely extreme gradient boosting method (XGBoost), to fit the model, and interpreted the model with relative importance and partial dependence plots. The results show that: 1) Distance from home to school is the most important factor influencing walking to school, with the relative importance of 39.99%. 2) The built environment, which is characterized by the 5Ds (density, diversity, design, destination accessibility, and distance to transit) model, is an important contributor, and relative contributions of the built environment variables at home and school collectively contributed 36.28% of the model's explanatory power, only second to distance to school, much higher than that of sociodemographic variables (23.73%). Distance to city center and population density around both home and school contribute a great deal. 3) All the built environment variables at both ends of school trips and the key sociodemographic variables have non-linear effects on adolescents' propensity of walking to school, and there exist obvious threshold effects. This study can inform decision makers with nuanced policy insights for promoting adolescents' behavior of walking to school.