# PANDAS: Paediatric Attention-Deficit/Hyperactivity Disorder Application Software
## 3 Methods
### Feature Extraction  
Feature extraction is an important step in building a classifier, as it allows for raw data to be interpreted into meaningful information that can help the classifier distinguish one observation from another. Prior to calculating features to extract, outlier detection was performed. The method used took the interquartile range (IQR) into account where  
\[IRQ=Q_{3}-Q_{1} \tag{1}\]  
and \(Q_{3}\) and \(Q_{1}\) represent the middle values of the first and third half of the dataset respectively. A data-point \(x_{i}\) was seen as an outlier if it satisfied one of the following two conditions:  
\[x_{i}>Q_{3}+1.5\times IRQ \tag{2}\]  
\[x_{i}<Q_{1}-1.5\times IRQ \tag{3}\]  
If one of the conditions was met, then \(x_{i}\) was replaced by the equation proposed by [17]:  
\[x_{i}:=\frac{x_{i-1}-x_{i+1}}{2} \tag{4}\]  
Two feature sets were extracted from the datasets. The first one was referred to as the game feature set and the second one was the accelerometer feature set. The game feature set consisted of the following 16 features: number of left button presses, number of right button presses, number of jumps, number of throws, number of obstacles destroyed, number of obstacles hit, number of gems collected, game duration, game enjoyment (boolean: 1 = enjoyed, 2 = did not enjoy), throw efficiency, total button presses, directional button presses, frequency of button presses, age, race and gender. The accelerometer feature set consisted of the following 18 statistical features: mean, standard deviation, minimum, maximum, range, median, sum, variance, skewness, kurtosis, root mean square (RMS), percentiles (10 th, 25 th, 50 th, 75 th and 90 th), interquartile range (IRQ) and crest factor. This resulted in a total of 72 features (\(18\times 4\)), where each of these features was calculated for the x, y, z axes and for the modulus which was calculated in the following way:  
\[a_{total}=\sqrt{a_{x}^{2}+a_{y}^{2}+a_{z}^{2}} \tag{5}\]  
The following 10 morphological features were extracted: exact Euclidean distance, autocorrelation coefficient, positive area, negative area, total area, absolute total area, total absolute area, number of zero crossings, latency time and peak-to- peak time-window. This resulted in a total of 39 features (\(10\times 4-1\)), where each of these features was calculated for the x, y, z axes and for the modulus, except for the exact Euclidean distance which was only calculated for the three possible axis pairings. Table 4 shows the breakdown of the feature set. The user specific features (race, age and gender) were important features in terms of correlating gender and age to the outcome of a diagnosis. Race was not necessarily significant for this sample size, but it was included more out of a speculative point of view. It was later seen that no conclusions could be made from this feature affecting the diagnosis. The game-play features were of significance because they gave insight into how subjectsplayed the game (i.e., gaming behaviour). Statistical and morphological features were extracted from the multivariate accelerometer time series, as it has been proven to provide good results for this type of data.  
Once the features were extracted, feature normalization was then performed so that the mean of each feature in the set was equal to zero. This helped improve the efficiency of the classifier. Given a feature \(f_{i}\), normalization performs the following:  
\[f_{i}:\frac{f_{i}-\mu_{i}}{s_{i}} \tag{6}\]  
where \(\mu_{i}\) is the average of all the observations for that feature and \(s_{i}\) is the range of the observations of that feature.