No recent study has explicitly focused on predicting the well-being of pregnant women. This study used data from an extensive online survey in Japan to examine the predictors of the subjective well-being of pregnant women. We developed and validated a light Gradient Boosting Machine (lightGBM) model using data from 400 pregnant women in 2020 to identify three factors that predict subjective well-being. The results confirmed that the model could predict subjective well-being in pregnant women with 84% accuracy. New variables that contributed significantly to this prediction were "partner help", "hopelessness," and "health status". A new lightGBM model was built with these three factors, trained and validated using data from 400 pregnant women in 2020, and predicted using data from 1791 pregnant women in 2021, with an accuracy of 88%. These factors were also significant risk factors for subjective well-being in the regression analysis adjusted for maternal age, region, parity, education level, and the presence of mental illness. Mediation analysis, with “hopelessness” as the mediator, showed that both “partner help” and “health status” directly and indirectly affected the outcome.