# Prediction of Diabetes Using Statistical and Machine Learning Modelling Techniques
## 3 Methodologies
### Performance Evaluation Measures  
1. Mean Squared Error  
MSE is the most popular and simple interpreted metric for many types of regression models. It measures how close a regression line is to a set of data points. This can be calculated by taking the distances (errors) from the points to the regression line and then calculating their square values [28]. It is substantially used to square them to eliminate any negative indications, and it also helps to allow more weight for considerable differences. It is known as the Mean Squared Error where this stands for the way of calculating the average of a set of errors. The lower the value of MSE, the closer the fit of the regression line to the data, resulting in better forecasting. MSE is expressed by the following equation:  
\[MSE=\frac{\sum_{i=1}^{n}\left(Y_{i}-\hat{Y}_{i}\right)^{2}}{n} \tag{10}\]  
where \(n\) is the number of data points; \(Y_{i}\) is the actual values; and \(\hat{Y}_{i}\) is the predicted values.
2. Root Mean Squared Error  
RMSE is another popular and excellent error metric for numerical predictions. It measures the accuracy of models by taking the square root of MSE between the actual and predicted output [29]. It is sensitive to outliers as it is scale-dependent, and it is also affected by larger errors. Lower RMSE values indicate better model performance. RMSE is presented in the following equation:  
\[RMSE=\sqrt{\frac{\sum_{i=1}^{n}\left(Y_{i}-\hat{Y}_{i}\right)^{2}}{n}} \tag{11}\]  
where \(n\) is the number of data points, \(Y_{i}\) is the actual values, and \(\hat{Y}_{i}\) is the predicted values.
3. Mean Absolute Percentage Error  
MAPE is another common evaluation metric because it is simple to calculate and easy to understand. It can be defined as the mean or average of the absolute percentage errors of predictions [30]. It can be calculated by taking the summed average of the absolute percentage errors (the actual values minus the predicted values divided by the actual) and then divided by the number of samples. This measure can be a very good indication of the quality of the evaluation method, and it is easy to understand for a wide range of users because it calculates the error in terms of percentages [31]. In addition, because it uses absolute value, any problem with positive and negative errors will be prevented. The MAPE calculation is given by the following equation:  
\[MAPE=\frac{\sum_{i=1}^{n}\frac{\left|Y_{i}-\hat{Y}_{i}\right|}{\hat{Y}_{i}} \times 100}{n} \tag{12}\]  
where \(n\) is the number of data points; \(Y_{i}\) is the actual values; and \(\hat{Y}_{i}\) is the predicted values.
4. Coefficient of Determination  
The coefficient of determination (R\({}^{2}\)) is a statistical metric that measures how well the data fits the regression model by indicating the deviation of the predicted values from the regression line. The R\({}^{2}\) value is normally between 0 and 1. A value close to 1 indicates that the model perfectly fits the data, while a low value or close to 0 implies a poor fit of the model. It is scale-independent, and it is sensitive towards the variance in observations [32]. The coefficient of determination (R\({}^{2}\)) is provided by the following equation:  
\[R^{2}=1-\frac{\sum_{i=1}^{n}(y_{i}-\hat{y})^{2}}{\sum_{i=1}^{n}(y_{i}-\overline {y})^{2}} \tag{13}\]  
where \(n\) is the number of data points; \(y_{i}\) is the actual values; \(\hat{y}\) is the predicted values; and \(\overline{y}\) is the mean (average) of the actual values.