Understanding the relationship between the built environment and e-scooter sharing (ESS) usage is important because it could help planners determine the high-demand area and design an effective investment plan to promote the use of micromobility. Previous studies usually assume that the relationship is linear, which may lead to inaccurate ridership prediction and ineffective policy. Thus, this study explores the nonlinear and threshold effects of the built environment on ESS ridership in Los Angeles using the gradient boosting decision tree. Fourteen built environment and ten demographic variables are selected as independent variables. We find that the built environment accounts for 91.66% of the total relative importance. The ten most important variables are intersection density, road density, public transit station density, restaurant density, employment density, distance to the center, population density, proportion of park area, parking density, and bike lane density. The nonlinear and threshold effects of the built environment on ESS ridership are determined. By using two spatial analysis units (census tract and census block group) and four temporal analysis units (spring, summer, autumn, and winter), the modifiable areal unit problem and the modifiable temporal unit problem are revealed.