An accurate model to predict fuel consumption of ships is the basis for optimizing ship navigation.Taking a cruise ship in the Yangtze River as a case study, a large volume of data on ship operations is collected by an information acquisition system.Based on theoretical analysis, the main factors that influence fuel consumption of the ship are identified, which are wind speed, wind direction, water depth, water velocity, and ship speed.A method of setting parameters of random forest model is improved and a way to measure the significance of variables is proposed.Sample data is obtained by systematic samples after de-noise process.The data is then randomly divided into training samples and testing samples by a ratio of 0.7 to 0.3.A prediction model of fuel consumption is developed by using random forest (RF) algorithm to address the training samples.Compared with the measured data, the errors are within 6.8%, which is better than the model established by utilizing BP neural network or support vector machine (SVM) with same samples.Order of the importance of each variable is: ship speed > water velocity > water depth > wind speed > wind direction.Finally, the quantitative relationship between a single factor and fuel consumption is analyzed by using partial correlation analysis.