Research Article
Prediction of Repeat Customers on E-Commerce Platform Based on Blockchain
Algorithm 1
The sub-time under sampling sample balancing algorithm.
Input: The original historical data about buyers (); the numbers of recording days (); | Output: The balanced historical data about buyers (). | 1: ; //Segment the Original Data according to the Number of Recording Days | 2: fordo//Traverse each buyer of the original data. | 3: = Random Choose()//Randomly select a buyer sample. | 4: if is a repeat buyer then. | 5: //Determine whether there are more than two one-time buyers in the nearest neighborhood of . | if repeat-buy = sum(KNN()) then. | 6: //Remove the One-Time Buyers from the Nearest Neighbors | delete (KNN() repeat-buy). | 7: else. | 8: save ()//Keep this buyer sample. | 9: else. | 10: if norepeat-buy = sum(KNN()) then. | 11: delete ()//Remove this buyer sample. | 12: else. | 13: save ()//Keep this buyer sample. |
|