Accurate diabetes prediction has emerged as a crucial problem in the field of healthcare. It is important to detect individuals at risk of having diabetes, which can allow for prompt intervention and tailored treatment strategies. Nowadays, machine learning models are usually employed for diabetes prediction. Lots of work has been developed various machine learning models for diabetes prediction. The random forest, as a popular ensemble learning algorithm, has illustrated its superiority for diabetes prediction. To this end, this paper demonstrates a study that employs the random forest algorithm for diabetes prediction. A random forest model is trained on a publicly available diabetes dataset and compared to its performance with logistic regression. The missing data imputation techniques are further leveraged to improve data integrity. Regarding model performance, it can be found that the random forest model significantly outperforms the logistic regression model. This highlights the superiority of tree-based models, such as random forest, for predicting diabetes compared to logistic regression.