Diabetes mellitus (DM) is one of the deadliest diseases in the world, especially in developed nations. In recent years, it has become rampant in the developing nations such as Nigeria, posing more threats to individuals in the latter than those in the former. More than 415 million people were reported to suffer from DM worldwide as of 2015, with type 2 of the disease accounting for approximately 90% of the cases. The number of people with DM is expected to rise to 592 million by the year 2035. Therefore, DM is one of the growing public health concerns in Nigeria. In this study, the diagnostic dataset of DM type 2 was collected from the Murtala Mohammed Specialist Hospital, Kano, and used to develop predictive supervised machine learning models based on logistic regression, support vector machine, K-nearest neighbor, random forest, naive Bayes and gradient booting algorithms. The random forest predictive learning-based model appeared to be one of the best developed models with 88.76% in terms of accuracy; however, in terms of receiver operating characteristic curve, random forest and gradient booting predictive learning-based models were found to be the best predictive learning models with 86.28% predictive ability, respectively. Keywords Machine learning • Predictive model • Diabetes mellitus • Diabetes mellitus type 2 • Random forest This article is part of the topical collection "Advances in Computational Approaches for Artificial Intelligence, Image Processing, IoT and Cloud Applications" guest edited by Bhanu Prakash K N and M. Shivakumar".