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 numberThe pseudo-code

1Input: target user x, user similarity threshold γ
2Split 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
3If TrainSets = , go to step 9
4Else take any y TrainSets and calculate sim’ users (x, y)
5For , y ∈ TrainSets
6If sim’ users (x, y)≥γ
7Nearest NeighborSets = NearestNeighborSets {y}, TrainSets = TrainSets-y
8Else TrainSets = TrainSets-y, go to step 3
9Read TestSets
10According to the nearest neighbor set, generate the recommendation list RecommendationLists of x
11Algorithm ends