Research Article
Analysis of Precision Service of Agricultural Product e-Commerce Based on Multimodal Collaborative Filtering Algorithm
Table 2
Pseudo-code of improved collaborative filtering recommendation algorithm.
| | Serial number | The pseudo-code |
| | 1 | Input: target user x, user similarity threshold γ | | 2 | Split the data set, 75% of the data set is used as the training set TrainSets, and the rest is used as the test set TestSets | | 3 | If TrainSets = , go to step 9 | | 4 | Else take any y TrainSets and calculate sim’ users (x, y) | | 5 | For , y ∈ TrainSets | | 6 | If sim’ users (x, y)≥γ | | 7 | Nearest NeighborSets = NearestNeighborSets {y}, TrainSets = TrainSets-y | | 8 | Else TrainSets = TrainSets-y, go to step 3 | | 9 | Read TestSets | | 10 | According to the nearest neighbor set, generate the recommendation list RecommendationLists of x | | 11 | Algorithm ends |
|
|