An accurate prediction of ship fuel consumption is critical for speed, trim, and voyage optimisation etc. While previous studies have focused on predicting ship fuel consumption with respect to a variety of factors, research on the impact of environmental factors on fuel consumption has been lacking. In addition, although recent research efforts have widely focused on machine learning methods to predict fuel consumption, studies on hyperparameter values that are suitable for these prediction models are limited. To compensate for this deficiency in existing literature, an adaptive hyperparameter tuning method is proposed, and the effects of maritime environmental factors on fuel consumption are taken into account. Through experimentation, the proposed adaptive hyperparameter tuning method was validated via artificial neural network (ANN), support vector regression (SVR), random forest (RF), and least absolute shrinkage and selection operator (Lasso). The hyperparameter tuning proportionally increased the amplitudes of the coefficients of determination (R2) of these algorithms. The increase of the amplitude demonstrated the following trend, in the order of the largest increase to the lowest increase: ANN, Lasso, SVM, and RF. The rates of increase were between 0.0773% and 2.1653%. Furthermore, after the environmental factors were considered, the prediction accuracies of the ANN and Lasso increased; however, the opposite was observed for the SVR and RF. As such, we confirmed that the use of Bayesian optimisation for hyperparameter tuning can effectively improve the fuel consumption prediction accuracy, and our proposed model can therefore serve as a significant reference for calculating fuel consumption.