# Modeling E-Behaviour, Personality and Academic Performance with Machine Learning
## 2 Methodology
### Algorithms for E-Behaviour, Personality and Performance Analysis  
#### 2.11.1 Decision Tree Classifier  
The Decision Tree Classifier (DTC) is a supervised learning algorithm that iteratively assesses conditions on the values of features in a dataset to perform classification. DTC breaks down a decision-making process into a collection of simpler decisions, providing classifications that are easier to interpret than other statistical and machine learning models [43]. DTC Architecture  
DTC was assembled from a root node, edges, internal nodes and leaf nodes. At the root node, DTC conducted a test on each observation's value. Based on its value, the root node assigned a resolution represented by an edge, which the observation then traversed. At the end of the traversed edge was an internal node. An example of a node's test was 'Gender? ', and an example of an edge was 'Female'. This decision process continued through the rest of the internal nodes until the tree reached a leaf node, where a classification was determined. See [PERSON] [44] for details on the DTC architecture. Gini Impurity Index--Decision Factors  
During prediction, an observation was predicted as part of a class after being checked through a series of conditions. An optimal decision tree resulted in an _optimal split_. An optimal split was achieved when each leaf node had the fewest possible train-set mis-classifications (lowest impurity), and the tree had not been overfitted. Entropy and Gini Impurity Index are two commonly used metrics for impurity. The Gini Impurity Index (Gini) measures the relative frequency that a randomly chosen element from that set would be mislabelled. A Gini score greater than zero describes a node that contains samples belonging to different classes. [PERSON] and [PERSON] [45] suggest that the difference between Entropy and Gini is trivial. This research used Gini, which was interpretable. Gini Calculation  
The Gini value decreased as a traversal was determined down the tree towards its leaf nodes. The decrease happened as each internal node's condition aimed to separate the classes according to a criterion that resulted in more homogeneous separations and higher accuracy in the training data. However, as with other predictive models, a high training-set accuracy was generated at the risk of overfitting. A larger tree (with more edges and branches) was more likely to overfit than a smaller tree and could result in a Gini of 0 at the tree's leaf nodes. A Gini of 0 represented the minimum probability of misclassification over the training set, but could result in weak generalisability over the test set. Therefore, smaller trees were preferred to larger trees [44]. \begin{table}
\begin{tabular}{l l l l} \hline \hline
**Feature** & **Shape** & **Type** & **Example Value** \\ \hline \(\{L(s)_{t}\}\) & \((1\times 17)\) & A Sequence of & \([3,7,\dots,0]\) \\ Login Sequence & & Whole Numbers & \\ \(\{E(s)_{t}\}\) & \((1\times 17)\) & A Sequence of & \([8,8,\dots,8]\) \\ Extraversion (Extraversion level Sequence) Sequence & & Whole Numbers & \\ \(\{\mathcal{C}(s)_{t}\}\) & \((1\times 17)\) & A Sequence of & \([1.1,1.1,\dots,1.1]\) \\ Conscientiousness (Conscientiousness level Sequence) Sequence & & Real Numbers & \\ \hline
**Input** & \((3\times 17)\) & An _Array of Sequences_ & \([[3,7,\dots,0]\) \\ \([\{L(s)_{t}\},\{E(s)_{t}\},\{\mathcal{C}(s)_{t}\}]\) & & of Real Numbers & \([8,8,\dots,8]\) \\ \hline
**Output** & & \((1\times 1)\) & Binary & Ignored \\ Safety Score = & & & \\ \(\{Flagged,\  
The Gini impurity index was calculated using the formula:  
\[Gini=1-\sum_{i}p_{i}^{2} \tag{3}\]  
where \(p_{i}\) is the probability of class \(i\). [PERSON] et al. [46] model DTCs on survey questions and answers that cover health, social activity and relationships of students to predict their academic performance. [PERSON] and [PERSON] [47] and [PERSON] et al.