Based on data on the shear wave speed and physical properties of the shallow sediment samples collected in the northwest South China Sea, the hyperparameter selection and contribution of the characteristic factors of the machine learning model for predicting the shear wave speed of seafloor sediments were studied using the eXtreme Gradient Boosting (XGBoost) algorithm. An XGBoost model for predicting the shear wave speed of seafloor sediments was established based on four physical parameters of the sediments: porosity (n), water content (w), density (ρ), and average grain size (MZ). The result reveals that: (1) The shear wave speed has a good correlation with n, w, ρ, and MZ, and their Pearson correlation coefficients are all above 0.75, indicating that they can be used as the suitable characteristic parameters for predicting the shear wave speed based on the XGBoost model; (2) When the number of weak learners (n_estimators) is 115 and the maximum depth of the tree (max_depth) is 6, the XGBoost model has a very high goodness of fit (R2) of the validation data of 0.914, the very low mean absolute error (MAE) and mean absolute percentage error (MAPE) of the predicted shear wave speed are 3.366 m/s and 9.90%, respectively; (3) Compared with grain-shearing (GS) model and single- and dual-parameter regression equation prediction models, the XGBoost model for the shear wave speed of seafloor sediments has higher fitting goodness and lower prediction error.