## 3 Mobility Support Scheme Based on Decision Tree-Based Pattern Classification and Regression
### Decision Tree-Based Mobility Pattern Classification  
In this section, we provide a detailed explanation of the decision tree-based mobility pattern classification process, which classifies mobility trajectories into patterns (linear, non-linear, random) using mobility trajectory data. This process represents the first step of the mobility support scheme and is a key process related to the selection of subsequent prediction models.  
To prepare data for training the decision tree, the location data of each mobile device is collected at regular time intervals in the form of (_t,x,y_). Multiple trajectories are gathered, and each is labeled as linear, non-linear, or random to construct the training datasets. The Figure 2 shows an example of coordinates according to the mobile device.  
After collecting and labeling the mobility trajectories (linear, non-linear, or random), we exploit two primary features from each trajectory to learn the decision tree: the coefficient of determination (\(R^{2}\)) and the standard deviation of direction changes (\(dangle\_std\)). The \(R^{2}\) value is obtained by fitting a simple linear regression model with respect to time, thereby indicating how closely the trajectory aligns with a straight line. The \(dangle\_std\) is derived by computing the angle \(\theta=arctan2(\Delta y,\Delta x)\) for consecutive positions and measuring the variability (\(\Delta\theta\)) across the entire path. As a result, trajectories with high \(R^{2}\) and low \(dangle\_std\) are likely to be classified as linear, whereas irregular direction changes and low linearity would be identified as non-linear or random.  
Figure 3 shows the example of a learned decision tree, where the root node first checks whether \(R^{2}\leq 0.575\). If \(R^{2}\) exceeds this threshold, the trajectory would be classified as \"Linear\", meaning that the trajectory is suitable for the linear regression model. In contrast, if \(R^{2}\) remains below 0.575, the model proceeds to evaluate \(dangle\_std\). Lower \(dangle\_std\) values, such as those under 2.596, indicate0\"Non-linear\", meaning that the trajectory is suitable for the polynomial regression model. However, when \(dangle\_std\) surpasses a certain threshold, the trajectory would be classified as \"Random\". It indicates highly variable direction changes. In this way, each node of the decision tree refines how the trajectory is classified by considering \(R^{2}\) against \(dangle\_std\). As a result, samples with high \(R^{2}\) and low \(dangle\_std\) are directed to the \"Linear\" category, moderately curved paths are classified into the \"Non-linear\" category, and erratic mobility is categorized into the \"Random\" category.  
Figure 2: An example of the training set for learning locations by unit time of mobile device.  
Each threshold used in the decision tree play a crucial role in accurately classifying the mobility patterns. \(R^{2}\), which serves as a key metric for evaluating the linearity of movement paths, was selected by the decision tree during the learning process to achieve optimal classification accuracy. Similarly, _dangle_std_, which measures the variability of angular changes, was set to effectively differentiate between non-linear and random paths. Since these thresholds were determined during the learning process, they avoid overfitting to specific datasets and could be reliably applied to various scenarios in industrial environments.