Climate change has been a pressing global issue and people are experiencing more frequent and severer extreme weather events. In South Korea, extreme heat has been drawing much attention in recent years due to its significant impact on public health and energy and water consumptions. Extreme heat is particularly exacerbated by the urban heat island (UHI) effect in cities. Many studies have examined the relationship between urban form factors and surface UHI empirically. But few of them have studied how UHI changes in response to an extreme heat event, termed heat resilience in recent studies. Additionally, most of current studies used traditional regression models assuming linear relationships, which may not be the case for UHI effects. To address this gap, this study aims to identify nonlinear relationships between urban form factors and land surface temperature (LST) and heat resilience, using machine learning methods. The study adopted the gradient boosting decision tree (GBDT) models to predict LST and heat resilience and compared the findings with those using spatial regression models. The results suggest that the GBDT model has a higher prediction power than traditional regression, and the GBDT models show that the urban form factors have nonlinear relationships with LST and heat resilience under extreme heat. The findings of the study provide valuable guidance for urban planning practice aimed at prioritizing planning elements in urban form toward heat-resilient cities.