Deficiencies in convection trigger functions, used in deep convection parameterizations in General Circulation Models (GCMs), have critical impacts on climate simulations. A novel convection trigger function is developed using the machine learning (ML) classification model XGBoost. The large-scale environmental information associated with convective events is obtained from the long-term constrained variational analysis forcing data from the Atmospheric Radiation Measurement (ARM) program at its Southern Great Plains (SGP) and Manaus (MAO) sites representing, respectively, continental mid-latitude and tropical convection. The ML trigger is separately trained and evaluated per site, and jointly trained and evaluated at both sites as a unified trigger. The performance of the ML trigger is compared with four convective trigger functions commonly used in GCMs: dilute convective available potential energy (CAPE), undilute CAPE, dilute dynamic CAPE (dCAPE), and undilute dCAPE. The ML trigger substantially outperforms the four CAPE-based triggers in terms of the F1 score metric, widely used to estimate the performance of ML methods. The site-specific ML trigger functions can achieve, respectively, 91% and 93% F1 scores at SGP and MAO. The unified trigger also has a 91% F1 score, with virtually no degradation from the site-specific training, suggesting the potential of a global ML trigger function. The ML trigger alleviates a GCM deficiency regarding the overprediction of convection occurrence, offering a promising improvement to the simulation of the diurnal cycle of precipitation. Furthermore, to overcome the black box issue of the ML methods, insights derived from the ML model are discussed, which may be leveraged to improve traditional CAPE-based triggers.