Algorithm 2:
The ZIPFA cross-validation algorithm in tth fold
| Matrix is to be decomposed to κ factors. |
| Initialize: |
| (1) Let be the same matrix as A but all 0’s and elements corresponding to are replaced by the column mean of rest values; |
| (2) Apply SVD to ln to obtain the components Uold and Vold; |
| (3) Calculate relative row sum N without elements corresponding to ; |
| (4) Eliminate the elements with index in A(v) (or A(u)) and note down their locations. Cross out elements in N(v) (or N(u)) on the corresponding location. |
| Update: |
| This part remains the same as regular ZIPFA algorithm described before. |
| CV likelihood: |
| (5) Obtain Λ(fit) = U(final)V(final)⊤ and calculate P(fit) = −τΛ(fit). |
| (6) Use the distribution assumption in Section 2.1 to calculate the likelihood of elements in A with index and sum them up. |