With the aim of predicting the environmental vibrations induced by an elevated high-speed railway, a machine learning method was developed by combining a random forest algorithm and Bayesian optimization, using a dataset from on-site experiments. When it comes to achieving a rapid and effective prediction of environmental vibrations, there is little research on comparisons between and verifications of different algorithms, and none on the parameter tuning and optimization of machine learning algorithms. In this paper, a field experiment is firstly carried out to measure the ground vibrations caused by high-speed trains running on a bridge, and then the environmental vibration characteristics are analyzed in view of ground accelerations and weighted vibration levels. Subsequently, three machine learning algorithms using linear regression, support vector machine, and random forest are developed using an experimental database, and their prediction performance is discussed. Finally, two optimization models for the hyperparameter set of the random forest algorithm are further compared. The results show that the integrated random forest algorithm has a higher accuracy in predicting environmental vibrations than linear regression and the support vector machine; the Bayesian optimization has an excellent performance and a high efficiency in achieving efficient and in-depth optimization of parameters and can be combined with the RF machine learning algorithm to effectively predict the environmental vibrations induced by the high-speed railway.