Precision in measurement of glucose level in artificial pancreas is a challenging task and mandatory requirement for the proper functioning of artificial pancreas. A suitable machine learning technique for the measurement of glucose level in artificial pancreas may play crucial role in the management of diabetes. Therefore in the present work, a comparison has been made among few machine learning (ML) techniques for measurement of glucose levels in artificial pancreas because the machine learning is an astounding technology of artificial intelligence, and widely applicable in various fields such as medical science, robotics, environmental science, etc. The models namely decision tree (DT), random forest (RF), support vector machine (SVM), and K-nearest neighbours (KNN), based on supervised learning, are proposed for the dataset of Pima Indian to predict and classify the diabetes mellitus. Ensuring the predictions and accuracy up to the level of DMT2, the comparative behavior of all four models has been discussed. The machine learning models developed here stratifies and predicts whether an individual is diabetic or not based on the features available in the data set. Dataset passes through pre-processing and machine learning algorithms are fitted to train the dataset, and then the performance of the test results has been discussed. Error matrix (EM) has been generated to measure the accuracy score of the models. The accuracies in prediction and classification of DMT2 models are 71%, 77%, 78%, and 80% for DT, SVM, RF and KNN algorithms respectively. The KNN model has shown a more precise result in comparison to other models. The proposed methods have shown astounding behaviour in terms of accuracy in the prediction of diabetes mellitus as compared to previously developed methods.