## 5 Experimental Setup
### Under Sampling for Imbalanced Data  
Typically, an ML model that learns imbalanced data has problems in that the estimation accuracy for each class is biased. Many methods for sampling and evaluating imbalanced data have been proposed [46]. In the experiments, the imbalanced dataset was balanced by undersampling to simplify the evaluation of the classification models.  
Undersampling is the process of sampling data from all classes according to the class with the smallest data size. In other words, if datasets whose elements are pairs \((f,y)\) of inputs \(f\) and outputs \(y\) are denoted by \(\mathcal{D}\), the data size of any month that should be sampled is as follows:  
\[S_{m}=|C|(\min_{c\in\mathbb{C}}|\{(f,y)\mid y=c,\forall(f,y)\in\mathcal{D}\}|),\forall m\in M, \tag{3}\]  
where \(C\) and \(M\) are the sets of classes and months, respectively.  
Figure 5: Data distribution by class and month. The raw location data are imbalanced. Undersampling is conducted based on the black line, i.e., \(S^{\prime}\).  
Figure 6: Data distribution for the missing value rate \(\theta_{k},\forall k\in K\) by month. Although there are differences in the data quantity, the distributions’ shapes for each missing value rate between months are almost the same.  
Here, we must consider the differences in the data size by month, as shown in Figure 5. Because the data sizes \(S_{m}\) obtained using Equation (3) are not necessarily equal for all \(m\in M\), the sizes are imbalanced among months. The larger the data size is compared with the feature dimension, the better the robustness and accuracy of an ML model in general [47; 48]. Each target period's reliability gap in terms of classification accuracy may be significant if the data sizes differ. For this reason, the datasets for each month are undersampled to the class with the minimum data size to facilitate comparisons among the classification models for each month. That is, letting \(\mathcal{D}_{m},|\mathcal{D}_{m}|=S_{m},m\in M\) be a dataset for month \(m\), the data sizes for the months are calculated as follows:  
\[S=|C|(\min_{m\in M}\min_{c\in\mathbb{C}}|\{(f,y)\mid y=c,\forall(\mathbf{f},y)\in \mathcal{D}_{m}\}|).\]  
Note that in this study, \(M=\{1,2,\dots,6\}\) and \(C=\{\text{'0 to 19', '20 s', '30 s', '40 s', '50 s', '60 s and over'}\}\).  
To construct and evaluate the ML models, we divided the dataset into training and test datasets. Because dividing a dataset into 70% training and 30% test datasets was shown to be desirable in many instances, the same was adopted for the training datasets in this study. In contrast, many test datasets can increase the validation accuracy of an ML model; thus, all extra datasets after training datasets were extracted and used as test datasets. Therefore, the number of training datasets was constant for any month, but the test datasets differed by month. If the training and test data sizes are denoted by \(S^{\text{train}}\) and \(S^{\text{test}}_{m}\), respectively, then their sizes are defined as follows:  
\[S^{\text{train}} =\lfloor 0.7S\rfloor,\] \[S^{\text{test}}_{m} =S_{m}-S^{\text{train}},\forall m\in M.\]  
The training and test data are sampled such that there are no duplications from the dataset of size \(S_{m}\). Because randomness is present when the training and test data are extracted from the source dataset, we conduct undersampling for 20 random seeds in the range of 0-19. In this way, 20 datasets for each month are prepared.  
The specific sizes \(S\) and \(S_{m}\), which are the basis for the training and test data for each month, respectively, are shown in Figure 5.