## 3 Materials and Methods
### Feature Extraction  
ML models choose several data inputs to a target variable which are known as features. The aim of this feature extraction process is for the model to map a pattern between new target variables and the inputs. Extracted features ensure the accurate prediction of the target variable. The removal of redundant features refers to feature selection. Reductions in computational cost and time are another motive of feature selection. We have selected the seven most significant features for our work. Median \(|M_{d}|\): It helps in identifying abnormal deviations in joint positions that indicate compensatory movements. This feature also represents the particular joint positions during rehabilitation. The median refers to the separator point of the data if we order the data points in ascending order and we split the cross-section into upper- and lower- half portions. In case of an odd number of data counts, the middle value will be the median value. The location of the median can be expressed as \(m\). \[|M_{d}|=\left(\frac{N+1}{2}\right)^{th} \tag{1}\]  
Otherwise, the average value of the two middle point values is the median for an even number of data counts. The location of the median is the average of \(\left(\frac{N}{2}\right)^{th}\) and \(\left(\frac{N}{2}+1\right)^{th}\). Variation: The variation changes can identify when patients do not follow the prescribed exercises. High variation represents inconsistent movements. Moreover, variation represents the changes that occur in the model while using different parts of the training dataset. It demonstrates the possibility of adjustment of the ML function on a given data point. Variation mainly manages comparatively large models with lots of features. The bias of the models has an inversely proportional relation with the variation. Interquartile Range (IQR): This feature differentiates between smooth and erratic or compensatory actions. The IQR refers to the difference between the 3 rd and the 1 st quartile of a certain distribution. As this range indicates half of the points of that dataset, the IQR  
Figure 2: The 25 joints of a subject captured by Kinect. represents the shape of the distribution. The IQR can identify the outliers of the system if it is less than the 25 th percentile or greater than the 75 th percentile. Root Mean Square (RMS): This feature indicates the excessive movements of the actions that deviate from the normal exercises. RMS deviation or RMS error determines the prediction quality and it uses Euclidean distance to do so. The residual represents the difference between prediction and truth values. Calculating the residual for each data point requires calculating the norm and then the mean of residuals. So, RMS error is the square root of the mean and its scale invariant. \[\text{RMS}=\sqrt{\frac{\sum_{k=1}^{n}\ \left|\ \left|\ Y(k)-Z(k)\right|\right|^{2}}{n}} \tag{2}\]  
Here, \(n\) is the number of data points, \(Y(k)\) is the Kth measurement, and \(Z(k)\) is the corresponding prediction. Mean \(\left|M\right|\): The mean feature identifies deviations that suggest compensatory strategies employed by the patients to complete the exercises. The mean is considered the middle value as the total deviation is zero from this value and it is appropriate for all of the data. \[\left|M\right|=\frac{\text{\emph{sum}}\ \text{\emph{of}}\ \text{\emph{all}}\ \text{\emph{the}}\ \text{\emph{signal}}\ \text{\emph{values}}}{\text{\emph{the}}\ \text{\emph{total}}\ \text{\emph{number}}\ \text{\emph{of}}\ \text{\emph{signal}}\ \text{\emph{values}}} \tag{3}\]  
Standard Deviation \(\left|\sigma\right|\): This feature aids in detecting unusual or extreme movements that deviate from normal rehabilitation exercises. It aids in distinguishing between patients who follow the exercise protocol consistently and those who exhibit compensatory movements. The standard deviation means calculating the variability of a sample or the spreading of values in any dataset measured according to the standard deviation.