Golf swing segmentation with inertial measurement units (IMUs) is an essential process for swing analysis using wearables. However, no attempt has been made to apply machine learning models to estimate and divide golf swing phases. In this study, we proposed and verified two methods using machine learning models to segment the full golf swing into five major phases, including before and after the swing, from every single IMU attached to a body part. Proposed bidirectional long short-term memory-based and convolutional neural network-based methods rely on characteristics that automatically learn time-series features, including sequential body motion during a golf swing. Nine professional and eleven skilled male golfers participated in the experiment to collect swing data for training and verifying the methods. We verified the proposed methods using leave-one-out cross-validation. The results revealed average segmentation errors of 5-92 ms from each IMU attached to the head, wrist, and waist, accurate compared to the heuristic method in this study. In addition, both proposed methods could segment all the swing phases using only the acceleration data, bringing advantage in terms of power consumption. This implies that swing-segmentation methods using machine learning could be applied to various motion-analysis environments by dividing motion phases with less restriction on IMU placement.