As global warming intensifies, urban heat islands (UHIs) threaten human health. Green spaces are crucial for mitigating UHIs, yet their expansion is limited. Consequently, optimizing the layout of existing green spaces to maximize their cooling effects is vital. However, the answers of which green space morphology is most beneficial vary across different study areas. This study employs an improved Gaussian kernel geographically weighted random forest (GWRF) model to assess the nonlinear relationship between green spaces morphology and Land Surface Temperature (LST), comparing the performance of this model with three traditional models (OLS, GWR, and RF). The results reveal that green spaces with more complex boundaries, larger individual areas, and concentrated distributions exhibited superior cooling effects. However, the sensitivity to these factors varied across different city functional zones: transportation zones were most influenced by the total area of green spaces, industrial zones by the average size, and commercial zones by the total area and boundary complexity. The Gaussian kernel-enhanced GWRF model outperformed other models, as indicated by its higher R2 values in both summer and winter (R2GWRF=0.888, R2OLS=0.647, R2GWR=0.721, R2RF=0.675 in summer; R2GWRF=0.791, R2OLS=0.307, R2GWR=0.673, R2RF=0.454 in winter). This study introduces novel methodologies and perspectives for restructuring urban greenery to mitigate the UHI effect, highlighting the significant potential of GWRF in addressing spatially dependent.