**5. Decision rules for health benefit due to intermittent fasting**

#### **5.1 Prediction whether HOMA-IR decreases**

When measuring performance of machine learning classifiers, accuracy is not enough. For comparing results from different classifiers, we need an additional measure. The additional measure is based on the definition of four groups resulted when solving a classification. For example, in our case when the case is that there is a reduction in HOMA-IR then the TRUE-POSITIVE (TP) group is when the prediction is correct, while the FALSE-POSITIVE (FP) group is when the prediction is not correct. The two additional groups found when the case is that there is no HOMA-IR reduction then TRUE-NEGATIVE (TN) will be when the prediction is false in other words the prediction is correct; however, when the prediction is not correct we say it is the FALSE-NEGATIVE (FN). The additional measure to compare between different classifiers is Area Under Curve (AUC) measure. AUC presents the relation between the TP rate and the FP rate and it is a very useful in the comparison between classifiers. The value of AUC ranges between 0 to 1. AUC equals 1 means a perfect classifier TP = 1 and FP = 0, while random classifier is when AUC is equal approximately to 0.5.

The AUC of the six different classifiers – J48, LMT, Random Forest, Random Tree, Logistic Regression and Naïve Bayes using the two test methods mentioned in the previous paragraph – are shown in **Table 3**. The AUC of the 10-Fold test is shown in the first row of **Table 3** while the Leave-One-Out test is found in the second row. For both tests the AUC differences between the classifiers are very small (0.67 to 0.75 in the 10-fold and 0.65–0.8 in the leave-one-out); we therefore conclude that all six classifiers perform similarly. The advantage of Random Forest is to prevent overfitting by creating random subsets of the features and building smaller trees and then combining the subtrees, however J48 is shown to yield the most accurate prediction within the decision tree algorithms [50]. In addition, J48 explains itself and easy to follow. In the J48 decision tree, the internal nodes are the different features (age, gender, weight, etc.), the branches between the nodes represent the possible values that these features may have (age: lower than 18 or equal higher than 18, gender: male/female, etc.). The terminal nodes tell us the final value of the prediction(TRUE or FALSE assigned for HOMA-IR difference). As shown in **Table 3** using J48 classifier and the 10-fold cross validation test the model AUC is 0.7. Furthermore, the Leave-One-Out test achieves AUC of 0.8. Therefore, the J48 model successfully predicts whether an intervention would help an individual improve his T2D risk parameters by reducing HOMA-IR.

The visualization of the J48 decision tree is found in **Figures 1**–**4**. Interestingly the attribute gender is the first node in the tree, as shown in **Figures 1** and **2**. Having the gender as the first splitting attribute indicates that this attribute is the most informative one for the decision. Moreover, for males the duration of the intervention is the most important attribute to decide the effectiveness of the intervention (**Figure 1**); while for females the basal fasting insulin level is reported as the most important feature (**Figure 2**). Green in **Figures 1**–**4** represents TRUE which indicates success in reducing HOMA-IR while red represents FALSE which indicates no reduction.

Analyzing the sub-decision tree of the males' side shown **Figure 1**, brings to the conclusion that men are indifferent to the type of the intervention rather they affected by the duration of the intervention. Success of intervention defined by reducing HOMA-IR, can be achieved by short duration of fasting (less or equal to 2.5 weeks) and lower BMI (less or equal to 25.8) or long duration of intervention and age 41 years and younger. Reasonably, attributes like lower BMI and younger age make it easier to reduce HOMA-IR.


#### **Table 3.**

*AUC for different classifiers.*

**397**

**Figure 3.**

*Sub-decision tree – Female left side.*

**Figure 2.**

*Sub-decision tree – Female side.*

*Selecting Intermittent Fasting Type to Improve Health in Type 2 Diabetes: A Machine Learning…*

Unlike the male side of the decision tree, in the female side the type of intervention is part of the tree and is represented by the nodes of the tree. As shown in **Figure 2** the intervention are nodes of the tree which are colored yellow while the nodes that represent attributes are colored blue. Moreover, the view of the tree on the female side consist of many different and connected parts compared with the male side of the tree. The fact that there are more women in the dataset than men can be the reason for this complexity view. The different interventions are part of the decision nodes as shown in **Figure 2**. The different interventions are arranged hierarchically

*DOI: http://dx.doi.org/10.5772/intechopen.95336*

**Figure 1.** *Sub-decision tree – Male side.*

*Selecting Intermittent Fasting Type to Improve Health in Type 2 Diabetes: A Machine Learning… DOI: http://dx.doi.org/10.5772/intechopen.95336*

*Type 2 Diabetes - From Pathophysiology to Cyber Systems*

improve his T2D risk parameters by reducing HOMA-IR.

conclude that all six classifiers perform similarly. The advantage of Random Forest is to prevent overfitting by creating random subsets of the features and building smaller trees and then combining the subtrees, however J48 is shown to yield the most accurate prediction within the decision tree algorithms [50]. In addition, J48 explains itself and easy to follow. In the J48 decision tree, the internal nodes are the different features (age, gender, weight, etc.), the branches between the nodes represent the possible values that these features may have (age: lower than 18 or equal higher than 18, gender: male/female, etc.). The terminal nodes tell us the final value of the prediction(TRUE or FALSE assigned for HOMA-IR difference). As shown in **Table 3** using J48 classifier and the 10-fold cross validation test the model AUC is 0.7. Furthermore, the Leave-One-Out test achieves AUC of 0.8. Therefore, the J48 model successfully predicts whether an intervention would help an individual

The visualization of the J48 decision tree is found in **Figures 1**–**4**. Interestingly

Analyzing the sub-decision tree of the males' side shown **Figure 1**, brings to the conclusion that men are indifferent to the type of the intervention rather they affected by the duration of the intervention. Success of intervention defined by reducing HOMA-IR, can be achieved by short duration of fasting (less or equal to 2.5 weeks) and lower BMI (less or equal to 25.8) or long duration of intervention and age 41 years and younger. Reasonably, attributes like lower BMI and younger

**J48 LMT Random Forest Random** 

10-Fold 0.7 0.75 0.75 0.67 0.79 0.73 Leave-One- Out 0.8 0.74 0.74 0.66 0.79 0.72

**Tree**

**Logistic Naive** 

**Bayes**

the attribute gender is the first node in the tree, as shown in **Figures 1** and **2**. Having the gender as the first splitting attribute indicates that this attribute is the most informative one for the decision. Moreover, for males the duration of the intervention is the most important attribute to decide the effectiveness of the intervention (**Figure 1**); while for females the basal fasting insulin level is reported as the most important feature (**Figure 2**). Green in **Figures 1**–**4** represents TRUE which indicates success in reducing HOMA-IR while red represents FALSE which

**396**

**Figure 1.**

**Table 3.**

*AUC for different classifiers.*

*Sub-decision tree – Male side.*

indicates no reduction.

age make it easier to reduce HOMA-IR.

#### **Figure 3.** *Sub-decision tree – Female left side.*

Unlike the male side of the decision tree, in the female side the type of intervention is part of the tree and is represented by the nodes of the tree. As shown in **Figure 2** the intervention are nodes of the tree which are colored yellow while the nodes that represent attributes are colored blue. Moreover, the view of the tree on the female side consist of many different and connected parts compared with the male side of the tree. The fact that there are more women in the dataset than men can be the reason for this complexity view. The different interventions are part of the decision nodes as shown in **Figure 2**. The different interventions are arranged hierarchically

starting with DMF followed by IECR or beginning with IECR followed by the Hi Mono diet. The success of the different interventions in improving HOMA-IR is shown in **Figure 3**. The hierarchical structure of the interventions is organized by their success, beginning with DMF, IECR and then IECR+PF. An interesting evidence which should be further investigated is found in **Figure 4**. That evidence is the node where lower BMI leads to an unsuccessful intervention.

#### **5.2 Testing separately the reduction of fasting glucose or fasting insulin**

To find out whether only fasting glucose reduction or fasting insulin reduction taken separately instead of HOMA-IR can be used to predict the usefulness of an intervention two additional train and test process were done. **Table 4** summarizes the results of the predictions based once only on fasting glucose reduction and once only on fasting insulin reduction.

As shown in **Table 4** the prediction of improvement in T2D based on HOMA-IR is more effective than the prediction based on fasting glucose or the fasting insulin separately. As shown in Eq. 1, the HOMA-IR calculation is based on both fasting glucose and fasting insulin.

#### **5.3 Comparing results with random classification**

An interesting question would be would these results based on HOMA-IR obtain on random? To answer this question, I reordered the values in the HOMA-IR column in an arbitrary way. The ratio between the TRUE values and the FALSE values was identical to the original column. The AUC results of training and testing

**399**

**Table 5**.

**6. Conclusions**

*Selecting Intermittent Fasting Type to Improve Health in Type 2 Diabetes: A Machine Learning…*

Leave- One-Out test 0.8 0.6 0.6

**Excluded Feature 10-Fold Cross Validation test Leave-One-Out test**

None 0.7 0.8 Age 0.68 0.7 Gender 0.68 0.62 Weight 0.64 0.73 Ethnic 0.68 0.74 Basal BMI 0.69 0.77 Fasting Glucose – basal 0.65 0.73 Fasting Insulin – basal 0.62 0.6

**FASTING Glucose reduction**

0.7 0.6 0.55

**FASTING Insulin reduction**

**HOMA-IR reduction**

with random data were much lower compared with the original data. The 10-Fold cross validation test yields 0.56 AUC compared with 0.7 in the original data. The Leave-One-Out test difference in AUC between the random and the original data was even more significant – 0.61 AUC in the random data compared with 0.8 in the original data. Those results answer the question asked above and suggest that the

Another interesting question is whether all the features mentioned in 4.2.4 are needed for the prediction. To test this a feature selection test was performed on the data. In each test a different feature was excluded. The AUC results are shown in

The feature in every row of **Table 5** except of the first row, is excluded and AUC is calculated without this feature. None of the features is redundant since as shown

To achieve steady-state fasting levels for many metabolic substrates which are found in blood draws taken from patients, the patients are required to fast 8–12 hours. This evidence can show us that even a single fasting interval in humans (e.g., overnight) can reduce basal concentrations of metabolic biomarkers related with T2D, such as insulin and glucose. Intermittent fasting regimens may be a promising approach to losing weight and improving metabolic health. Moreover, these eating regimens may offer promising nonpharmacological approaches to

in **Table 5** the highest AUC is shown when all features are trained.

improving health in general and specifically improve T2D condition.

model predictions cannot be obtain in random.

*Features selection – AUC results of J48 Decision tree.*

**5.4 Testing features redundancy**

*DOI: http://dx.doi.org/10.5772/intechopen.95336*

*Summary of AUC results for improving T2D risk parameters.*

10-Fold Cross Validation

test

**Table 4.**

**Table 5.**

*Selecting Intermittent Fasting Type to Improve Health in Type 2 Diabetes: A Machine Learning… DOI: http://dx.doi.org/10.5772/intechopen.95336*


**Table 4.**

*Type 2 Diabetes - From Pathophysiology to Cyber Systems*

starting with DMF followed by IECR or beginning with IECR followed by the Hi Mono diet. The success of the different interventions in improving HOMA-IR is shown in **Figure 3**. The hierarchical structure of the interventions is organized by their success, beginning with DMF, IECR and then IECR+PF. An interesting evidence which should be further investigated is found in **Figure 4**. That evidence is the

**5.2 Testing separately the reduction of fasting glucose or fasting insulin**

To find out whether only fasting glucose reduction or fasting insulin reduction taken separately instead of HOMA-IR can be used to predict the usefulness of an intervention two additional train and test process were done. **Table 4** summarizes the results of the predictions based once only on fasting glucose reduction and once

As shown in **Table 4** the prediction of improvement in T2D based on HOMA-IR is more effective than the prediction based on fasting glucose or the fasting insulin separately. As shown in Eq. 1, the HOMA-IR calculation is based on both fasting

An interesting question would be would these results based on HOMA-IR obtain on random? To answer this question, I reordered the values in the HOMA-IR column in an arbitrary way. The ratio between the TRUE values and the FALSE values was identical to the original column. The AUC results of training and testing

node where lower BMI leads to an unsuccessful intervention.

**5.3 Comparing results with random classification**

only on fasting insulin reduction.

glucose and fasting insulin.

**398**

**Figure 4.**

*Sub-decision tree – Female right side.*

*Summary of AUC results for improving T2D risk parameters.*


**Table 5.**

*Features selection – AUC results of J48 Decision tree.*

with random data were much lower compared with the original data. The 10-Fold cross validation test yields 0.56 AUC compared with 0.7 in the original data. The Leave-One-Out test difference in AUC between the random and the original data was even more significant – 0.61 AUC in the random data compared with 0.8 in the original data. Those results answer the question asked above and suggest that the model predictions cannot be obtain in random.

#### **5.4 Testing features redundancy**

Another interesting question is whether all the features mentioned in 4.2.4 are needed for the prediction. To test this a feature selection test was performed on the data. In each test a different feature was excluded. The AUC results are shown in **Table 5**.

The feature in every row of **Table 5** except of the first row, is excluded and AUC is calculated without this feature. None of the features is redundant since as shown in **Table 5** the highest AUC is shown when all features are trained.
