WAAM has been proven a promising alternative to fabricate medium and large scale metal parts with a high depositing rate and automation level. However, the production quality may deteriorate due to the poor deposited layer surface quality. In this paper, a laser sensor based surface roughness measuring method was developed for WAAM. To improve the surface integrity of deposited layers by WAAM, different machine learning models, including ANFIS, ELM and SVR, were developed to predict the surface roughness. Furthermore, the ANFIS model was optimized by GA and PSO algorithms. Full factorial experiments were conducted to obtain the training data, and the K-fold Cross-validation strategy was applied to train and validate machine learning models. The comparison results indicate that GA–ANFIS has superiority in predicting surface roughness. The RMSE, R2, MAE and MAPE for GA–ANFIS were 0.0694, 0.93516, 0.0574, 14.15% respectively. This study could also provide inspiration and guidance for surface roughness modelling in multipass arc welding and cladding.