How to improve the accuracy of compressional wave speed prediction has always been one of the basic research subjects in geoacoustics research. Due to the stability of granularity, whether in the laboratory or in the seabed environment, the relationship between granularity and compressional wave speed is an important means of wave speed inversion. In this article, we combined the Machine Learning algorithm with nine granularity parameters (mean grain size, median grain size, skewness, kurtosis, sorting coefficient, gravel, sand, silt, and clay content respectively.) to analysis of the effect of granularity on sound speed. As a result, the sound speed-granularity predictive model was established, and the accuracy of the sound speed obtained according to the predictive model is higher than that of the multi-parameters equations. Based on the predictive model, the feature selection was conducted and the results show that the most influential parameter of granularity is mean grain size and second is silt content. Furthermore, this model can also predict the sound speed with high precision in the absence of partial parameters, which can be a useful tool for ocean engineering and seismic inversion. Machine learning provides a new solution for more efficient sound speed prediction systems.