# ML-Empowered Microservice Workload Prediction by Dual-Regularized Matrix Factorization
## 3 Methodology
### Microservice Dependency Capturing  
Modeling dependencies among microservices presents a significant challenge due to their high-dimensional complexity and dynamic evolution. Capturing critical interactions while avoiding redundant dependencies is crucial for solving workload prediction problems. To address this, we initially aimed to impose a rank minimization constraint on the microservice matrix \(W\), enabling the model to preserve the key dependencies between microservices by leveraging the low-rank structure inherent in the microservice feature matrix. The rank minimization problem [24] can be formalized as  
\[\min_{W}\,\text{rank}(W),\quad\text{s.t.}\,Y\approx WX, \tag{10}\]  
However, rank minimization is a non-convex problem [34], making its computational complexity prohibitively high for large-scale systems.  
To overcome this limitation, TDDRMF employs nuclear norm minimization [33] as a convex relaxation of rank minimization to achieve efficient optimization. The nuclear norm of \(W\) is defined as  
\[\|W\|_{*}=\sum_{i=1}^{\min(n,r)}\sigma_{i}, \tag{11}\]  
where \(\sigma_{i}\) are the singular values of \(W\). By minimizing the sum of singular values, the nuclear norm enforces low-rank constraints while simultaneously driving the model to capture the similarity structure within the microservice feature matrix, thereby enabling more accurate capturing of the primary dependencies between microservices.  
Nuclear norm regularization is seamlessly integrated into the overall optimization objective of TDDRMF and co-optimized with temporal dynamics modeling. Therefore, based on the objective function from [23], we redefine the meaning of the microservicematrix \(W\) and replace the original Frobenius norm with nuclear norm regularization. The complete objective function is expressed as  
\[\mathcal{L}=\frac{1}{2}\underset{W,X,A,B}{min}\|Y-WX\|_{F}^{2}+\lambda_{1}R_{ \mathrm{AR}}(X|A,B)+\lambda_{2}\|W\|_{*}, \tag{12}\]  
The integration of temporal regularization and nuclear norm regularization in TDDRMF demonstrates significant synergy in modeling the temporal dynamics of workloads and modeling microservice dependencies. Temporal regularization effectively extracts short-term trends and periodic patterns, while nuclear norm regularization enforces low-rank constraints on the microservice matrix \(W\), enabling the compact and efficient representation of microservice interactions. This joint optimization not only enhances the model's generalization ability by reducing the impact of noise and redundant dependencies but also improves computational efficiency, making the framework well suited for large-scale microservice systems.  
However, in long-term prediction tasks, the dynamic nature of workloads and the evolving interdependencies among microservices can pose additional challenges. If the parameters remain fixed, the model may struggle to adapt to significant changes over time. To address this, TDDRMF incorporates an error detection mechanism that dynamically triggers parameter updates. The following section elaborates on the design and implementation of this mechanism.