Research Article
A Collaborative Filtering Method for Operation Maintenance Behavior in Power Monitoring Systems
Algorithm 2
Workflow of computing user and resource models by alternating least squares method.
Input: Behavior frequency matrix PM×N of resource access by users | Output: User matrix XM×X and resource matrix YN×k | 1 Construct the loss function Loss | 2 Randomly initialize user model X and resource model Y | 3while (Loss does not converge) | 4 for i from 1 to M | 5 for j from 1 to N | 6 if (pi,jis recorded in the training set) | 7 e = XiYj - pi,j /Predictive value of model- Corresponding value of training set/ | 8 end if | 9xi,j = xi,j-2 alpha(eyi,j+lambadaxi,j)/alpha represents the learning rate/ | 10yi,j = yi,j-2 alpha(exi,j+lambadayi,j) /delta represents the regular terms/ | 11end for | 12end for | 13 Output Xi and Yjas user matrix XM×k and resource matrix YN×k |
|