## 3 Proposed System
### Service Model Management Block  
#### 3.6.1 Model Selection Module (MSM)  
The model selection process begins with the extraction of statistical features from the incoming time series. For each sensor's time-series data, a fixed-length meta-feature vector is computed, capturing distributional and structural characteristics such as the mean, standard deviation, variance, skewness, kurtosis, entropy, and stationarity. These features are used as inputs for both the decision-tree-based classifier and the similarity-based reasoning module in the subsequent selection stages. To select the most suitable forecasting model under varying time-series characteristics and constrained computing environments, we propose a hybrid model selection strategy that integrates decision-tree-based classification with similarity-based reasoning. This strategy enables the system to make adaptive, accurate, and resource-aware model decisions in real time. The primary prediction is generated by a decision tree classifier trained on statistical meta-features extracted from each sensor's time series (e.g., mean, variance, skewness, entropy). The classifier outputs a candidate model \(m_{DT}\) along with its associated confidence score \(conf_{DT}\). Simultaneously, a similarity-based reasoning module retrieves historical data of similar time series using a K-Nearest Neighbors (KNN) approach. All 22 statistical meta-features listed in Table 3 are first standardized via z-score normalization. Each feature is centered to zero mean and scaled to unit variance. Then, the similarity is calculated with the following distance-weighted \(k\)NN rule:  
\[\mathrm{d}(x,y)=\sqrt{\sum_{j=1}^{22}\left(\widetilde{x_{j}}-\widetilde{y_{j }}\right)^{2}} \tag{6}\]  
\[s(m)=\sum_{i=1}^{k}\frac{1[m_{i}=m]}{1+d_{i}} \tag{7}\]  
where \(x\) refers to the meta-feature vector of the target time series, \(y\) stands for the previous meta-feature vector, and \(j\) indicates the meta-feature index. \(i\) is the index of the \(i\)-th neighbor among the \(k\) nearest neighbors of \(x\). \(d_{i}\) is the distance between \(x\) and the \(i\)-th neighbor, and m is a candidate forecasting model label. Based on the frequency and similarity-weighted performance of the models used for the nearest neighbors, a secondary prediction \(m_{KNN}\) is produced with confidence \(conf_{KNN}\). To combine both prediction signals, we define the following confidence-weighted hybrid score:  
\[\mathrm{score}(\mathrm{m})=w_{DT}\cdot conf_{DT}(\mathrm{m})+w_{KNN}\cdot conf _{KNN}(\mathrm{m}) \tag{8}\]  
where \(w_{DT}\) and \(w_{KNN}\) are empirically defined weights (e.g., 0.6 and 0.4, respectively). The model with the highest score is selected as the initial candidate \(m_{hybrid}\). Although this hybrid scoring strategy enables fast and accurate selection, it does not directly account for model complexity at this stage. Instead, complexity is considered in a separate substitution step that follows hybrid selection. Each forecasting model is associated with a normalized complexity score \(C(m)\in[0,1]\) based on empirical attributessuch as the parameter count and runtime performance. After selecting \(m_{hybrid}\), the system checks whether this model remains feasible with the currently available CPU resources. This substitution logic ensures that even in severely resource-constrained scenarios, the system selects a model that satisfies execution constraints while minimizing the loss in forecasting accuracy. Specifically, if the complexity of the initially selected model \(m_{hybrid}\) exceeds a threshold \(\tau_{C}\), and the currently available CPU level \(A_{CPU}\) falls below a predefined limit \(\tau_{cpu}\), the system initiates a fallback mechanism. The mechanism selects a replacement model \(m^{\prime}\) from the candidate pool \(\mathcal{M}\) that has a lower complexity and can be executed within reduced latency. Formally, the selection criterion is defined as follows:  
\[