Commodity Recommendation Method and System Based on Mining of High-Utility Repeated Negative Sequence Patterns
The method improves e-commerce platforms' product recommendations by mining high utility negative sequential patterns with finer granularity transformations and influence rates, resulting in more accurate and user-aligned product suggestions.
Patent Information
- Application Number
- CN202510599696.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-05-12
AI Technical Summary
When the existing product recommendation system performs efficient repetitive negative sequence pattern mining based on purchase historical data, there is a problem of insufficient pattern mining, making it difficult to accurately recommend products that meet customer needs.
Using a method based on high-efficiency repetitive negative sequence mode mining, the data cleaning and classification processing of user shopping history data is used to calculate the utility value of the repetitive negative sequence candidate mode using the element influence rate, allowing negative conversion operations on product elements to be carried out on a finer grain, generating more repetitive negative sequence candidate modes, and displaying products through the algorithm layer and application layer adjustment platform interface.
It improves the accuracy of product recommendations, can more comprehensively evaluate the utility value of repeat negative sequence patterns, generate recommended products that are more in line with customer needs, and significantly increases the number and mining efficiency of high-efficiency repeat negative sequence patterns.
Smart Images

Figure CN120146968B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data mining, and particularly relates to a commodity recommendation method and system based on mining of high-utility repeated negative sequence patterns. Background Art
[0002] With the rapid development of e-commerce, the number of commodities on online shopping platforms has grown exponentially. When faced with a vast number of commodities, consumers often have difficulty quickly finding the commodities that meet their needs and preferences. To solve this problem, commodity recommendation systems have emerged. Traditional commodity recommendation systems mainly make recommendations based on positive feedback data such as users' purchase history data and browsing behaviors. However, when existing commodity recommendation systems perform mining of high-utility repeated negative sequence patterns based on purchase history data, there is usually insufficient mining of high-utility repeated negative sequence patterns. For this reason, the present application proposes a commodity recommendation method and system based on mining of high-utility repeated negative sequence patterns that can fully perform mining of high-utility repeated negative sequence patterns. Summary of the Invention
[0003] Aiming at the defects and deficiencies in the above-mentioned prior art, the present application proposes a commodity recommendation method and system based on mining of high-utility repeated negative sequence patterns.
[0004] To achieve the above object of the present invention, the following technical solutions are adopted:
[0005] A commodity recommendation method based on mining of high-utility repeated negative sequence patterns, comprising the following steps:
[0006] S1. Collect users' shopping history data, and perform data cleaning to obtain the shopping data after data cleaning; then, classify the shopping data after data cleaning to obtain shopping sequences; then, count the shopping sequences and their corresponding user IDs into the user shopping sequence data table in chronological order;
[0007] S2. Perform mining of high-utility repeated positive sequence patterns on the shopping sequences in the user shopping sequence data table, perform negative transformation processing on the high-utility repeated positive sequence patterns to obtain repeated negative sequence candidate patterns, calculate the utility values of the repeated negative sequence candidate patterns based on the element influence rate, and use the repeated negative sequence candidate patterns with utility values greater than or equal to the preset minimum utility threshold ξ as high-utility repeated negative sequence patterns;
[0008] In step S2, the negative transformation process includes the following steps: perform a negative transformation operation on any k commodity elements in the high-utility repeated positive sequence pattern with a length of m to obtain a repeated negative sequence candidate pattern, where m ranges from 2 to n, and n is equal to the number of commodity elements in the shopping sequence. Here, k is the smallest integer not less than m / 2, so as to transform some non-consecutive commodity elements in the high-utility repeated positive sequence pattern and generate a new repeated negative sequence candidate pattern. To prevent the generation of meaningless repeated negative sequence candidate patterns, the constraint conditions for the negative transformation process are as follows: (1) It is not allowed to continuously appear an item set that only contains one negative commodity element; and when the length of the items in the item set is greater than 1, the negative commodity elements in the items are not all negative; (2) It is allowed to appear an item set that only contains one negative commodity element, and not all the items in the item set are negative.
[0009] S3. Adjust the commodities displayed on the platform interface based on the high-utility repeated negative sequence patterns, their utility values, and the corresponding user IDs; at the same time, save the adjustment records, generate a log file, and archive and save it.
[0010] Preferably, in step S1, the classified processing of the shopping data after data cleaning includes the following steps:
[0011] 1). Create a set for each user in the shopping data after data cleaning, and set a unique user ID for each user.
[0012] 2). In the user set, count the types of commodities ITEM purchased by the user and the purchase quantity of each type of commodity ITEM.
[0013] 3). Statistically record all types of commodities ITEM and their utility values in the shopping data after data cleaning into the element data table.
[0014] Preferably, step S2 specifically includes the following steps:
[0015] S2-1. Mine the high-utility repeated positive sequence patterns from the shopping sequences in the user shopping sequence data table.
[0016] S2-2. Perform a negative transformation process on all the high-utility repeated positive sequence patterns stored in the high-utility repeated positive sequence pattern list to obtain repeated negative sequence candidate patterns; after the negative transformation process, assign the utility value of the original high-utility repeated positive sequence pattern to the corresponding repeated negative sequence candidate pattern to make it the initial utility value of the repeated negative sequence candidate pattern.
[0017] S2-3. By traversing all candidate patterns of repeated negative sequences, calculate the utility values of each candidate pattern of repeated negative sequences based on the influence rate of commodity elements and store them, so as to predict the purchase potential of these candidate patterns of repeated negative sequences for users. Then, compare the utility value of each candidate pattern of repeated negative sequences with the preset minimum utility threshold ξ. When the utility value of the candidate pattern of repeated negative sequences is greater than or equal to the minimum utility threshold ξ, the candidate pattern of repeated negative sequences is identified as a high-utility repeated negative sequence pattern; otherwise, it is not.
[0018] Preferably, step S2-1 specifically includes the following steps:
[0019] S2-1-1. Perform encoding operations on the element data table and the shopping sequence to obtain the encoded element data table and the encoded shopping sequence;
[0020] S2-1-2. Mine candidate patterns of repeated positive sequences with a length of 1 from all encoded shopping sequences, and mine candidate patterns of repeated positive sequences with a length of 1 for each type of commodity element in each shopping sequence;
[0021] S2-1-3. Calculate the utility value of the candidate pattern of repeated positive sequences with a length of 1, and compare it with the preset minimum utility threshold ξ. When the utility value of the candidate pattern of repeated positive sequences with a length of 1 is greater than or equal to the minimum utility threshold ξ, then the candidate pattern of repeated positive sequences with a length of 1 is a high-utility repeated positive sequence pattern with a length of 1; then, record the above candidate patterns of repeated positive sequences with a length of 1 in the candidate pattern list of repeated positive sequences, and record the above high-utility repeated positive sequence patterns in the high-utility repeated positive sequence pattern list;
[0022] S2-1-4. Connect the candidate patterns of repeated positive sequences with different lengths of 1 for the same user at the same time, and recursively loop to construct candidate patterns of repeated positive sequences with lengths from 2 to n, where n is equal to the number of commodity elements in the shopping sequence;
[0023] S2-1-5. Use a non-overlapping method to constrain all candidate patterns of repeated positive sequences with a length greater than or equal to 2 stored in the candidate pattern list of repeated positive sequences to obtain non-overlapping positive sequence candidate patterns, calculate the utility values of the non-overlapping positive sequence candidate patterns, and then compare the utility values of the non-overlapping positive sequence candidate patterns with the preset minimum utility threshold ξ. When the utility value of the non-overlapping positive sequence candidate pattern is greater than or equal to the minimum utility threshold ξ, then the non-overlapping positive sequence candidate pattern is a high-utility repeated positive sequence pattern with a length greater than or equal to 2; otherwise, it is not; subsequently, record the above high-utility repeated positive sequence patterns in the high-utility repeated positive sequence pattern list.
[0024] Preferably, in step S2-1-5, the repeated positive sequence candidate patterns with a length greater than or equal to 2 are constrained in a non-overlapping manner, including the following steps:
[0025] (1) Mine all repeated positive sequence candidate patterns with a length greater than or equal to 2 from the user shopping sequence data table, obtain the matching position patterns corresponding to the above repeated positive sequence candidate patterns, and calculate the utility values of all repeated positive sequence candidate patterns with a length greater than or equal to 2. Store all repeated positive sequence candidate patterns with a length greater than or equal to 2, their corresponding matching position patterns, and utility values in a hash table;
[0026] (2) Arrange the matching position patterns in the hash table in the order of the purchase sequence of commodity elements;
[0027] (3) Traverse all the matching position patterns in the hash table in the order of the purchase sequence of commodity elements, and delete the subsequent matching position patterns and their corresponding matching position patterns and utility values whose positions of the same commodity element are the same as those in the previous matching position patterns; the above settings can prevent the commodity elements in the repeated positive sequence candidate patterns from being reused at the same position in other repeated positive sequence candidate patterns, but can be reused at different positions.
[0028] A commodity recommendation system based on the mining of high-utility repeated negative sequence patterns includes a data storage layer, an algorithm layer, and an application layer. Among them,
[0029] The data storage layer is used to collect user shopping history data, perform data cleaning on the collected user shopping history data to obtain the shopping data after data cleaning; then, perform classification processing on the shopping data after data cleaning to obtain shopping sequences; then, count the shopping sequences and their corresponding user IDs into the user shopping sequence data table in chronological order. The data storage layer transmits the user shopping sequence data table and its corresponding element data table to the algorithm layer;
[0030] The algorithm layer is used to mine high-utility repeated positive sequence patterns from the shopping sequences in the user shopping sequence data table output by the data storage layer, mine repeated negative sequence candidate patterns based on the mined high-utility repeated positive sequence patterns, and filter out the repeated negative sequence candidate patterns with utility values greater than or equal to the preset minimum utility threshold ξ as high-utility repeated negative sequence patterns; the algorithm layer transmits the high-utility repeated negative sequence patterns to the application layer;
[0031] The application layer is used to receive the high-utility repeated negative sequence patterns from the algorithm layer as recommendation information and adjust the commodities displayed on the platform interface according to the user ID; at the same time, save the adjustment records, generate a log file and transmit it to the data storage layer for archival storage.
[0032] Compared with the prior art, the beneficial technical effects of the present application are as follows:
[0033] The present application no longer restricts that the negative transformation operation must occur within the itemset range, but allows the transformation operation to be performed on each commodity element at a finer granularity, thereby generating more candidate patterns of repeated negative sequences; moreover, when the existing HUNSPM algorithm calculates the utility value of the candidate pattern of the repeated negative sequence, the utility value of the negative commodity element is set to 0, and only the utility value based on the positive commodity element is considered to obtain the utility value of the candidate pattern of the negative sequence; while when the present application calculates the utility value of the candidate pattern of the repeated negative sequence based on the commodity element influence rate, the present application not only utilizes the utility value of the non-overlapping positive sequence candidate pattern u re (P,DB) , but also utilizes IDSE(P i , S i ) considering the commodity element influence rate corresponding to the negative commodity element obtained by the negative transformation process. Therefore, the present application can more comprehensively evaluate the utility value of the high-utility repeated negative sequence pattern, can more accurately obtain the influence of the negative commodity element on the utility value of the high-utility repeated negative sequence pattern, and further enables the acquisition of more accurate high-utility repeated negative sequence patterns, so that the recommended commodities can better meet the needs of customers. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a flowchart for obtaining a user shopping sequence data table based on user shopping history data;
[0035] Figure 2 are the test results of testing the DS1 dataset by the method described in the present application and the HUNSPM method under the conditions that the minimum utility thresholds are 0.01, 0.015, and 0.02;
[0036] Figure 3 are the test results of testing the DS2 dataset by the method described in the present application and the HUNSPM method under the conditions that the minimum utility thresholds are 0.01, 0.015, and 0.02;
[0037] Figure 4 are the test results of testing the DS1 dataset by the method described in the present application and the HUNSPM method under the conditions that the minimum utility thresholds are 0.02, 0.022, and 0.024;
[0038] Figure 5 are the test results of testing the DS3 dataset by the method described in the present application and the HUNSPM method under the conditions that the minimum utility thresholds are 0.02, 0.022, and 0.024;
[0039] Figure 6Test results of the method described in this application and the HUNSPM method for testing the DS4 dataset under the conditions that the minimum utility thresholds are 0.005, 0.006, and 0.007;
[0040] Figure 7 Test results of the method described in this application and the HUNSPM method for testing the DS5 dataset under the conditions that the minimum utility thresholds are 0.005, 0.006, and 0.007;
[0041] Figure 8 Test results of the method described in this application and the HUNSPM method for testing the DS1 dataset under the conditions that the minimum utility thresholds are 0.004, 0.005, and 0.006;
[0042] Figure 9 Test results of the method described in this application and the HUNSPM method for testing the DS6 dataset under the conditions that the minimum utility thresholds are 0.004, 0.005, and 0.006;
[0043] Figure 10 Test results of the method described in this application and the HUNSPM method for testing the DS7 dataset under the conditions that the minimum utility thresholds are 0.004, 0.005, and 0.006. Detailed implementation
[0044] A commodity recommendation system based on high-utility repeated negative sequence pattern mining, including a data storage layer, an algorithm layer, and an application layer. The method for the commodity recommendation system based on high-utility repeated negative sequence pattern mining to recommend commodities includes the following steps:
[0045] S1. Use the data storage layer to collect user shopping history data, and perform data cleaning on the collected user shopping history data to obtain the shopping data after data cleaning; then, perform classification processing on the shopping data after data cleaning to obtain shopping sequences; then, count the shopping sequences and their corresponding user IDs into the user shopping sequence data table in chronological order, as Figure 1 shown; the data storage layer transmits the user shopping sequence data table and its corresponding element data table to the algorithm layer; the user shopping data collected in this application is already arranged in chronological order.
[0046] In this application, data cleaning refers to cleaning the data in the user's shopping history data that is irrelevant to the recommended products, and obtaining the shopping data after data cleaning. For example, in the user's shopping history data, there is the purchase time of the user. Since whether to recommend the product is irrelevant to the user's shopping time and only related to the utility value of the consumption of the product, the user's purchase time is the data irrelevant to the recommended product, and the essence of data cleaning is to delete the data irrelevant to the recommended product;
[0047] The classified processing of the shopping data after data cleaning includes the following steps:
[0048] 1). Create a set for each user in the shopping data after data cleaning, and set a unique user ID for each user;
[0049] 2). In the user set, count the types of items of the products purchased by the user and the purchase quantity of each type of item;
[0050] 3). Count all types of items and their utility values (i.e., values) in the shopping data after data cleaning into the element data table. In the first embodiment of the present application, the types of items in the element data table are mobile phones, earphones, and computers respectively, and the utility values are 3,000 yuan, 200 yuan, and 8,000 yuan respectively. These utilities are used to calculate the weight of the actual value of the product in the user's purchase behavior. In this application, the basis for classified processing is the type of product element (the type of product element refers to the types of products such as mobile phones, earphones, and computers). The above classification helps to further analyze the utility of the product and also helps to integrate the purchase records;
[0051] Then, in the shopping data after data cleaning, all types of items and their corresponding purchase quantities of the same user at the same time constitute a shopping sequence. For example, if user 1 purchases 2 mobile phones and 1 earphone at time 1, then the user shopping data of user 1 at time 1 is converted by the data storage layer into <[(mobile phone, 2)(earphone, 1)]>, where <[(mobile phone, 2)(earphone, 1)]> is the shopping sequence of user 1 at time 1, as Figure 1 shown;
[0052] Then, the shopping sequence and its corresponding user ID are counted into the user shopping sequence data table in chronological order, as Figure 1 shown; From Figure 1It can be seen that there are four shopping sequences in the user shopping sequence data table. The shopping sequence of User 1 has two, representing the purchase situations in two time periods. Specifically, "2 mobile phones" and "1 earphone" were purchased in Time Period 1; in Time Period 3, "2 computers" and "1 mobile phone" were purchased first, and then 2 earphones were purchased separately; the shopping sequence of User 2 has one, representing the purchase of "2 computers" and "1 earphone" at Time 2; the shopping sequence of User 3 has one, representing the purchase of "2 computers" and "1 mobile phone" first at Time 4, then the purchase of "2 computers" and "1 mobile phone" again, and finally the purchase of "2 mobile phones"; moreover, the order of purchase times represented by the four shopping sequences is: Time Period 1, Time Period 2, Time Period 3, and Time 4. The four shopping sequences and their user IDs constitute the user shopping sequence data table.
[0053] S2. Use the algorithm layer to perform high-utility repeated positive sequence pattern mining on the shopping sequences in the user shopping sequence data table output by the data storage layer, perform negative transformation processing on the high-utility repeated positive sequence patterns to obtain repeated negative sequence candidate patterns, calculate the utility values of the repeated negative sequence candidate patterns based on the element influence rate, and filter out the repeated negative sequence candidate patterns with utility values greater than or equal to the preset minimum utility threshold ξ as high-utility repeated negative sequence patterns; transfer the high-utility repeated negative sequence patterns to the application layer; specifically include the following steps:
[0054] S2-1. Use the algorithm layer to perform high-utility repeated positive sequence pattern mining on the shopping sequences in the user shopping sequence data table output by the data storage layer, specifically including the following steps:
[0055] S2-1-1. Use the algorithm layer to perform encoding operations on the element data table and the shopping sequences output by the data storage layer to obtain the encoded element data table and the encoded shopping sequences, as shown in Table 1 and Table 2 respectively; among them, performing encoding operations on the shopping sequences output by the data storage layer can effectively prevent the leakage of user privacy; that is to say, Figure 1 in which, the types of commodities that appear are "mobile phones", "earphones", and "computers". The three types of commodities "mobile phones", "earphones", and "computers" are respectively encoded as a, b, and c. After Figure 1 encoding the element data table and the user shopping sequence data table in Figure 1 the element data table and the user shopping sequence data table in
[0056] Table 1 is the encoded element data table
[0057] Commodity a b c Utility (yuan) 3000 200 8000
[0058] Table 2 is the encoded shopping sequence
[0059] User ID Sequence data User 1 <[(a,2)(b,1)]> User 2 <[(c,2)],[(b,1)]> User 1 <[(c,2)(a,1)],[(b,2)]> User 3 <[(c,2)(a,1)],[(c,2)(a,1)],[(a,2)]>
[0060] S2-1-2. Mine the repeated positive sequence candidate patterns of length 1 for all the encoded shopping sequences, and mine the repeated positive sequence candidate patterns of length 1 for each type of commodity element in each shopping sequence. Taking the encoded shopping sequence of user 3 in Table 2 as an example, in step S2-1-2, the repeated positive sequence candidate patterns of length 1 for each type of commodity element mined from the encoded shopping sequence of user 3 are respectively <c>, ;
[0061] S2-1-3. Calculate the utility value of the repeated positive sequence candidate pattern with a length of 1, and compare it with the preset minimum utility threshold ξ. When the utility value of the repeated positive sequence candidate pattern with a length of 1 is greater than or equal to the minimum utility threshold ξ, then the repeated positive sequence candidate pattern with a length of 1 is a high-utility repeated positive sequence pattern with a length of 1. Then, record the above-mentioned repeated positive sequence candidate pattern with a length of 1 in the repeated positive sequence candidate pattern list, and record the above-mentioned high-utility repeated positive sequence pattern in the high-utility repeated positive sequence pattern list;
[0062] In this application, in step S2-1-3, the utility value of the repeated positive sequence candidate pattern with a length of 1 is calculated as shown in Equation (1):
[0063] (1)
[0064] In Equation (1), represents the k-th commodity element in a certain commodity element type in the encoded shopping sequence and its utility value, represents the encoded shopping sequence and the number of the k-th commodity element in a certain commodity element type in it, represents all the encoded shopping sequences in the user shopping sequence data table;
[0065] In Formula (1), is calculated as shown in Equation (2):
[0066] (2)
[0067] In Equation (2), represents the unit value of the k-th commodity element in a certain commodity element type recorded in the element data table and represents the encoded shopping sequence and the number of the k-th commodity element in a certain commodity element type in it;
[0068] For example, in Table 2, the encoded shopping sequence of User 3 It is: <[(c,2)(a,1)],[(c,2)(a,1)],[(a,2)]>. Since the shopping sequence of user 3 indicates that within time 4, "2 computers" and "1 mobile phone" were purchased first, then "2 computers" and "1 mobile phone" were purchased again, and finally "2 mobile phones" were purchased. When encoding, commodity elements such as "computer" are encoded as c, and commodity elements such as "mobile phone" are encoded as a. In order to distinguish the purchase order of different commodity elements in the commodity element type of "mobile phone", in this application, according to the purchase order of commodity elements, different commodity elements in the commodity element type of "mobile phone" are respectively labeled as a1, a2, and a3. a1, a2, and a3 represent the first commodity element (i.e., the mobile phone purchased first), the second commodity element (i.e., the mobile phone purchased later), and the third commodity element (i.e., the mobile phone purchased last) in the commodity element type "mobile phone" a, and the commodity elements of "computer" are respectively labeled as c1 and c2. That is to say, after dividing according to the purchase order, the shopping sequence <[(c,2)(a,1)],[(c,2)(a,1)],[(a,2)]> of user 3 can be recorded as <[(c1,2)(a1,1)],[(c2,2)(a2,1)],[(a3,2)]>; when calculating the utility value of each commodity element using formula (2), when = c1, represents the unit value of the first commodity element in the commodity element type c, represents the encoded shopping sequence the quantity of the first commodity element in the commodity element type c in
[0069] In this application, formula (2) can calculate the utility values of all commodity elements of any type of commodity element in the encoded shopping sequence. During the process of calculating the utility values of all commodity elements of any type of commodity element in the encoded shopping sequence, this application also counts the length Length of the encoded shopping sequence where the above commodity element is located and the occurrence times Occu of the above commodity element in the encoded shopping sequence where it is located; this application stores all commodity elements, the corresponding utility values of the commodity elements, the length Length of the encoded shopping sequence where the commodity element is located, and the occurrence times Occu of the commodity element in the encoded shopping sequence where it is located in the sequence element influence rate table.
[0070] S2-1-4. Connect the repeated positive sequence candidate patterns of the same user with different lengths of 1 at the same time, and perform recursive loops to respectively construct repeated positive sequence candidate patterns with lengths from 2 to n, where n is equal to the number of commodity elements in the shopping sequence;
[0071] For example, by performing pattern connection on the candidate patterns of repeated positive sequences of length 1 obtained from the shopping sequence of user 3 in Table 2 and recursively looping, candidate patterns of repeated positive sequences of lengths 2 to 5 can be constructed respectively; record the candidate patterns of repeated positive sequences of lengths 2 to 5 in the candidate pattern list of repeated positive sequences;
[0072] In this application, after partitioning according to the order of purchase of commodity elements, the shopping sequence <[(c,2)(a,1)],[(c,2)(a,1)],[(a,2)]> of user 3 can be denoted as <[(c1,2)(a1,1)],[(c2,2)(a2,1)],[(a3,2)]>; that is to say, the shopping sequence <[(c1,2)(a1,1)],[(c2,2)(a2,1)],[(a3,2)]> of user 3 indicates that there are 5 commodity elements, namely c1, a1, c2, a2, and a3. The candidate patterns of repeated positive sequences of length 1 for each commodity element (the commodity elements include c1, a1, c2, a2, and a3) mined in step S2-4 are respectively <c> 、< / c> , where in the repeating positive sequence candidate pattern <c>Match commodity elements c1, c2; repeat positive sequence candidate pattern< / c> Match commodity elements a1, a2, and a3 in it;
[0073] In order to accelerate the efficiency of pattern connection for different repeated positive sequence candidate patterns of length 1 of the same user without affecting the number of pattern connections, this application uses two upper bounds of utility for pattern connection to delete all invalid repeated positive sequence candidate patterns. Among them, an invalid repeated positive sequence candidate pattern refers to a repeated positive sequence candidate pattern whose utility value is less than the minimum utility threshold ξ. Among them, the above two upper bounds of utility are the weighted utility upper bound and the remaining utility upper bound respectively. The above two upper bounds of utility and the method of using the above two upper bounds of utility for pattern connection are respectively consistent with the content of Section 4.3 and Section 4.4 of the paper "USpan: An Efficient Algorithm for Mining High Utility Sequential Patterns".
[0074] S2-1-5. Constrain all repeated positive sequence candidate patterns with a length greater than or equal to 2 stored in the repeated positive sequence candidate pattern list in a non-overlapping manner to obtain non-overlapping positive sequence candidate patterns, calculate the utility values of the non-overlapping positive sequence candidate patterns, and then compare the utility values of the non-overlapping positive sequence candidate patterns with the preset minimum utility threshold ξ. When the utility value of the non-overlapping positive sequence candidate pattern is greater than or equal to the minimum utility threshold ξ, then the non-overlapping positive sequence candidate pattern is a high-utility repeated positive sequence pattern with a length greater than or equal to 2, otherwise it is not. Subsequently, record the above high-utility repeated positive sequence patterns into the high-utility repeated positive sequence pattern list.
[0075] Among them, constraining the repeated positive sequence candidate patterns with a length greater than or equal to 2 in a non-overlapping manner includes the following steps:
[0076] (1). Mine all repeated positive sequence candidate patterns with a length greater than or equal to 2 from the user shopping sequence data table, obtain the matching position patterns corresponding to the above repeated positive sequence candidate patterns, and calculate the utility values of all repeated positive sequence candidate patterns with a length greater than or equal to 2. Store all repeated positive sequence candidate patterns with a length greater than or equal to 2, their corresponding matching position patterns, and utility values into a hash table;
[0077] (2). Arrange the matching position patterns in the hash table in the order of the purchase sequence of commodity elements;
[0078] (3) Traverse all the matching position patterns in the hash table in the order of purchase of commodity elements, and delete the subsequent matching position patterns and their corresponding matching position patterns and utility values whose positions of the same commodity element are the same as those in the previous matching position patterns; the above setting can prevent the commodity elements in the repeated positive sequence candidate patterns from being reused at the same position in other repeated positive sequence candidate patterns, but can be reused at different positions.
[0079] In this application, the utility value of the non-overlapping positive sequence candidate pattern The calculation method is as shown in Equation (3),
[0080] (3)
[0081] In Equation (3), represents all the encoded shopping sequences in the user shopping sequence data table, represents the utility value of the non-overlapping positive sequence candidate pattern in the encoded shopping sequence ;
[0082] In Formula (3), The calculation method of is as shown in Equation (4):
[0083] (4)
[0084] In Equation (4), P represents the non-overlapping positive sequence candidate pattern, represents the number of non-overlapping positive sequence candidate patterns that appear in the encoded shopping sequence ; represents the number of the non-overlapping positive sequence candidate pattern in the user shopping sequence data table, represents the nth encoded shopping sequence, represents the utility value of the non-overlapping positive sequence candidate pattern in the encoded shopping sequence , where represents that each non-overlapping positive sequence candidate pattern is non-overlapping.
[0085] In this application, from the user shopping sequence data table shown in Table 2, the candidate patterns of repeated positive sequences with a length of 2 that can be mined from the user shopping sequence are <(a,b)>, <c,b>, <(c,a)>, <c,b>, <c,a>, <c,c>, <a,a>. When mining the candidate pattern of the repeated positive sequence <c,a>, three matching position patterns are obtained successively, namely <1,2>, <1,3>, <2,3>. In the later obtained matching position pattern <1,3>, the number 1 appears in the first position, and the position where 1 appears in the later obtained matching position pattern <1,3> is the same as the position where 1 appears in the previously obtained matching position pattern <1,2>. Then, the later obtained matching position pattern <1,3> is deleted; in this application, the matching position pattern is composed of the positions where the commodity elements c and a appear in the candidate pattern of the repeated positive sequence. For example, the matching position pattern <1,2> means that there is c in the first item set and a in the second item set; the matching position pattern <1,3> means that there is c in the first item set and a in the third item set; the matching position pattern <2,3> means that there is c in the second item set and a in the third item set; in this application, all candidate patterns of repeated positive sequences with a length greater than or equal to 2 are constrained in a non-overlapping manner, aiming to prevent the same commodity element from being reused at the same position in the matching position pattern.
[0086] S2-2. Perform negative transformation processing on all high-utility repeated positive sequence patterns stored in the high-utility repeated positive sequence pattern list to obtain candidate patterns of repeated negative sequences; among them, all high-utility repeated positive sequence patterns include the high-utility repeated positive sequence patterns obtained in S2-1-3 and the high-utility repeated positive sequence patterns obtained in S2-1-5; after completing the state conversion of commodity elements (i.e., negative transformation processing), assign the utility value of the original high-utility repeated positive sequence pattern to the corresponding candidate pattern of the repeated negative sequence to make it the initial utility value of the candidate pattern of the repeated negative sequence.
[0087] Among them, performing negative transformation processing on all high-utility repeated positive sequence patterns specifically includes the following steps:
[0088] Perform a negative transformation operation on any k commodity elements in the high-utility repeated positive sequence pattern with length m to obtain repeated negative sequence candidate patterns. m ranges from 2 to n, where n is equal to the number of commodity elements in the shopping sequence. Here, k is the smallest integer not less than m / 2, so as to transform some non-consecutive commodity elements in the high-utility repeated positive sequence pattern to generate new repeated negative sequence candidate patterns. To prevent the generation of meaningless repeated negative sequence candidate patterns, this application innovatively sets two constraints for the negative transformation process: (1) It is not allowed to continuously appear item sets that only contain one negative commodity element; and when the length of the items in the item set is greater than 1, the negative commodity elements in the items are not all negative; (2) It is allowed to appear item sets that only contain one negative commodity element, and not all the items in the item set are negative.
[0089] In the prior art, when performing negative transformation on high-utility repeated positive sequence patterns to obtain negative sequence patterns, the mining method usually requires that the minimum unit of each transformation is an item set; in this application, for each item in the item set, that is, for each commodity element in each repeated negative sequence candidate pattern, an independent transformation operation is performed. This means that this application no longer restricts that the negative transformation operation must occur within the item set range, but allows the transformation operation to be performed on each commodity element at a finer granularity, so as to generate more repeated negative sequence candidate patterns. Compared with the existing HUNSPM algorithm for obtaining repeated negative sequence candidate patterns, the constraint conditions adopted in this application to obtain repeated negative sequence candidate patterns are more relaxed and more in line with practical applications. For example, in the scenario of commodity recommendation, if the original high-utility repeated positive sequence pattern is that a user repeatedly purchases "computer" and "mobile phone" at multiple purchase times, then after the transformation process described in this application, this application generates a repeated negative sequence candidate pattern indicating that the user has not purchased "computer" and "mobile phone" in multiple cycles. In this way, this application can capture the potential preferences of users for unpurchased commodities, so as to better recommend commodities that meet their needs.
[0090] S2-3. By traversing all repeated negative sequence candidate patterns, calculate the utility value of each repeated negative sequence candidate pattern according to the commodity element influence rate and store it, so as to predict the purchase potential of these repeated negative sequence candidate patterns for users; then, compare the utility value of each repeated negative sequence candidate pattern with the preset minimum utility threshold ξ. When the utility value of the repeated negative sequence candidate pattern is greater than or equal to the minimum utility threshold ξ, this repeated negative sequence candidate pattern is recognized as a high-utility repeated negative sequence pattern, otherwise it is not; then, the algorithm layer outputs all the screened high-utility repeated negative sequence patterns to the application layer to provide data support for the application layer to perform commodity recommendation.
[0091] In this application, first calculate the th commodity element in the encoded shopping sequence Influence rate of commodity elements , and its calculation method is shown in formula (5):
[0092] (5)
[0093] In formula (5), represents the th commodity element in the repeated negative sequence candidate pattern, represents the utility value of the th commodity element in the repeated negative sequence candidate pattern recorded in the sequence element influence rate table in the encoded shopping sequence , represents all commodity elements in their respective encoded shopping sequences , represents the total utility value of all commodity elements appearing in all the encoded shopping sequences DB in the user shopping sequence data table.
[0094] Calculating the utility value of the repeated negative sequence candidate pattern based on the influence rate of commodity elements The calculation formula is shown in formula (6):
[0095] (6)
[0096] In formula (6), represents the utility value of the non-overlapping positive sequence candidate pattern, represents the th commodity element in the repeated negative sequence candidate pattern in the encoded shopping sequence of the influence rate of commodity elements, represents the number of occurrences of a single negative element in the sequence element influence rate table in the encoded shopping sequence ; represents the length size of the encoded shopping sequence corresponding to in the sequence element influence rate table.
[0097] When calculating the utility value of the repeated negative sequence candidate pattern by the existing HUNSPM algorithm, the utility value of the negative commodity element is set to 0, and only the utility value based on the positive commodity element is considered to obtain the utility value of the negative sequence candidate pattern; when calculating the utility value of the repeated negative sequence candidate pattern based on the influence rate of commodity elements using formula (6) in this application, this application not only uses the utility value of the non-overlapping positive sequence candidate pattern , but also uses IDSE(P i ,S i )Taking into account the impact rate of the commodity element corresponding to the negative conversion process for the negative commodity element, therefore, the present application can more comprehensively evaluate the utility value of the high-utility repeated negative sequence pattern, can more accurately obtain the impact of the negative commodity element on the utility value of the high-utility repeated negative sequence pattern, and further enables a more accurate high-utility repeated negative sequence pattern to be obtained, so that the recommended commodities can better meet the needs of customers.
[0098] S3. The application layer receives and adjusts the commodities displayed on the platform interface according to the high-utility repeated negative sequence pattern output by the algorithm layer, its utility value, and the corresponding user ID; meanwhile, the adjustment record is saved, a log file is generated and transmitted to the data storage layer for archival storage. In the present application, the application layer automatically adjusts the priority of the recommended commodities on the platform interface according to the high-utility repeated negative sequence pattern (the high-utility repeated negative sequence pattern in the present application can reflect the user's preference for purchasing commodities), its utility value, and the corresponding user ID, so that the recommendation result is more in line with the actual needs of the user. After adjusting the priority of the commodity recommendation, the application layer displays the recommended commodities through the platform interface. The display content of these commodity recommendations includes detailed information such as commodity name, picture, unit price, specification, etc., to ensure that users can clearly understand the key information of each recommended commodity. After seeing the recommended commodities, the user will make a choice according to their own preferences. If the user is interested in the recommended commodity and decides to purchase it, the application layer will record the click and purchase behavior of the commodity and update the user's shopping history data. The recommendation result and the updated user shopping history data will be transmitted back to the data storage layer through the application layer for proper storage.
[0099] Test:
[0100] The present application uses the IBM data generator to generate a test set for testing. The acquisition website of the IBM data generator is: https: / / www.philippe-fournier-viger.com / spmf / index.php?link=datasets.php ; the present application tests the mining efficiency of the method described in the present application by adjusting parameters to control the data scale of the test set, the complexity of the shopping sequence, and the pattern distribution. Among them, the adjusted parameters refer to C: the number of customers; T: the average number of transactions per customer; S: the average number of commodities per transaction; I: the length of the maximum pattern (i.e., the size of the maximum pattern that can be obtained through pattern connection); DB: the number of sequence patterns; N: the number of different commodities;
[0101] Seven data sets were generated by the IBM generator in this application for seven comparative tests of the recommendation system algorithm of this application. Among them, the seven data sets are DS1 data set, DS2 data set, DS3 data set, DS4 data set, DS5 data set, DS6 data set and DS7 data set. The acquisition methods of the above seven data sets are as follows: The DS1 data set was obtained under the conditions that the parameters were set as C = 6, T = 2, S = 4, I = 2, DB = 10K (10K = 10000) and N = 50; The DS2 data set was obtained under the conditions that the parameters were set as C = 8, T = 2, S = 4, I = 2, DB = 10K and N = 50; The DS3 data set was obtained under the conditions that the parameters were set as C = 6, T = 4, S = 4, I = 2, DB = 10K and N = 50; The DS4 data set was obtained under the conditions that the parameters were set as C = 6, T = 2, S = 3, I = 2, DB = 10K and N = 50; The DS5 data set was obtained under the conditions that the parameters were set as C = 6, T = 2, S = 5, I = 2, DB = 10K and N = 50; The DS6 data set was obtained under the conditions that the parameters were set as C = 6, T = 2, S = 4, I = 4, DB = 10K and N = 50; The DS7 data set was obtained under the conditions that the parameters were set as C = 6, T = 2, S = 4, I = 2, DB = 10K and N = 100.
[0102] This application selects the HUNSPM method (from HUNSPM: An efficient algorithm for mining high utility negative sequential patterns) to conduct a test comparison with the method proposed in this application. Specifically, in order to compare the mining effects of the method described in this application and the HUNSPM method on data sets with different numbers of customers, this application specifically tests the above two methods on the DS1 and DS2 data sets with different numbers of customers under the same minimum utility threshold condition. The test results are as Figure 2 and Figure 3 as shown,
[0103] To compare the data mining effects of the method described in this application and the HUNSPM method on datasets with different average transaction quantities per customer, this application specifically tests the above two methods on the DS1 and DS3 datasets with different average transaction quantities per customer under the condition of the same minimum utility threshold, and the test results are as Figure 4 and Figure 5 shown;
[0104] To compare the data mining effects of the method described in this application and the HUNSPM method on datasets with different average number of items per transaction, this application specifically tests the above two methods on the DS4 and DS5 datasets with different average number of items per transaction under the condition of the same minimum utility threshold, and the test results are as Figure 6 and Figure 7 shown;
[0105] To compare the data mining effects of the method described in this application and the HUNSPM method on datasets with different lengths of the maximum pattern, this application specifically tests the above two methods on the DS1 and DS6 datasets with different lengths of the maximum pattern under the condition of the same minimum utility threshold, and the test results are as Figure 8 and Figure 9 shown;
[0106] To compare the data mining effects of the method described in this application and the HUNSPM method on datasets with different numbers of different items, this application specifically tests the above two methods on the DS1 and DS7 datasets with different numbers of different patterns under the condition of the same minimum utility threshold, and the test results are as Figure 8 and Figure 10 shown;
[0107] Figures 2 to 10 Among them, n1 represents the number of high-utility repeated negative sequence patterns mined by this application, and n1 is an important evaluation index for measuring the pros and cons of the recommendation system mining method; n2 represents the number of negative sequence patterns mined by using the HUNSPM method (the HUNSPM algorithm cannot mine high-utility repeated negative sequence patterns and can only mine negative sequence patterns without repeated attributes); n3 represents the number of repeated negative sequence candidate patterns obtained by the method described in this application; n4 represents the number of all patterns generated by using the HUNSPM method; t1 represents the time required for this application to mine all high-utility repeated negative sequence patterns; t2 represents the time required for the HUNSPM method to mine all negative sequence patterns;
[0108] From Figures 2 to 10 It can be seen that the number of negative sequence patterns mined by the method of the present invention is significantly more than that mined by the existing HUNSPM method, and the method of the present invention shows significant advantages on datasets DS1 to DS7.
[0109] From Figure 2 and Figure 3 it can be seen that:
[0110] (1) The method of the present application mined 2,285 high-utility repeated negative sequence patterns from the DS1 dataset under the condition that the minimum utility threshold was 0.01, while the HUNSPM method only mined 1,040 negative sequence patterns under the same condition. That is to say, the number of high-utility repeated negative sequence patterns mined by the method of the present application from the DS1 dataset under the condition that the minimum utility threshold was 0.01 was 2.20 times the number of negative sequence patterns mined by the HUNSPM method.
[0111] The method of the present application mined 7,167 high-utility repeated negative sequence patterns from the DS2 dataset under the condition that the minimum utility threshold was 0.01, while the HUNSPM method only mined 3,032 negative sequence patterns under the same condition. That is to say, the number of high-utility repeated negative sequence patterns mined by the method of the present application from the DS2 dataset under the condition that the minimum utility threshold was 0.01 was 2.36 times the number of negative sequence patterns mined by the HUNSPM method. Moreover, by comparing the above data, it can also be known that under the condition that the minimum utility threshold was 0.01, the number of high-utility repeated negative sequence patterns obtained when the method of the present application tested the DS2 dataset was 3.14 times the number of high-utility repeated negative sequence patterns obtained when the method of the present application tested the DS1 dataset, and under the condition that the minimum utility threshold was 0.01, the number of negative sequence patterns obtained when the HUNSPM method tested the DS2 dataset was 2.82 times the number of negative sequence patterns obtained when the HUNSPM method tested the DS1 dataset. This shows that when the method of the present application mines high-utility repeated negative sequence patterns for a dataset with a larger number of customers, it can mine more high-utility repeated negative sequence patterns.
[0112] (2) Under the condition that the minimum utility threshold of the method described in this application is 0.01, 346,344 repeated negative sequence candidate patterns are mined from the DS2 dataset, while the HUNSPM method only mines 3,032 negative sequence patterns under the same conditions. That is to say, the number of repeated negative sequence candidate patterns mined from the DS2 dataset by the method described in this application under the condition that the minimum utility threshold is 0.01 is 114.2 times the number of negative sequence patterns mined by the HUNSPM method. This shows that when the method described in this application mines repeated negative sequence candidate patterns from a dataset with a larger number of customers, it can mine more repeated negative sequence candidate patterns.
[0113] From Figure 4 and Figure 5 it can be seen that:
[0114] (1) Under the condition that the minimum utility threshold of the method described in this application is 0.02, 226 high-utility repeated negative sequence patterns are mined from the DS1 dataset, while the HUNSPM method only mines 94 negative sequence patterns under the same conditions. That is to say, the number of high-utility repeated negative sequence patterns mined from the DS1 dataset by the method described in this application under the condition that the minimum utility threshold is 0.02 is 2.40 times the number of negative sequence patterns mined by the HUNSPM method.
[0115] The method described in this application mines 3,642 high-utility repeated negative sequence patterns from the DS3 dataset under the condition that the minimum utility threshold is 0.02, while the HUNSPM method only mines 922 negative sequence patterns under the same conditions. That is to say, the number of high-utility repeated negative sequence patterns mined from the DS3 dataset by the method described in this application under the condition that the minimum utility threshold is 0.01 is 3.95 times the number of negative sequence patterns mined by the HUNSPM method. Moreover, by comparing the above data, it can also be known that under the condition that the minimum utility threshold is 0.02, the number of high-utility repeated negative sequence patterns obtained when the method described in this application tests the DS3 dataset is 16.1 times the number of high-utility repeated negative sequence patterns obtained when the method described in this application tests the DS1 dataset. Under the condition that the minimum utility threshold is 0.01, the number of negative sequence patterns obtained when the HUNSPM method tests the DS2 dataset is 9.80 times the number of negative sequence patterns obtained when the HUNSPM method tests the DS1 dataset. This shows that when the method described in this application mines high-utility repeated negative sequence patterns from a dataset with a larger average number of transactions per customer, it can mine more high-utility repeated negative sequence patterns.
[0116] (2) Under the condition that the minimum utility threshold of the method described in this application is 0.02, 1,351,601 repeated negative sequence candidate patterns are mined from the DS3 dataset, while the HUNSPM method only mines 928 negative sequence candidate patterns under the same conditions. That is to say, the number of repeated negative sequence candidate patterns mined from the DS2 dataset by the method described in this application under the condition that the minimum utility threshold is 0.02 is 1456.4 times the number of negative sequence candidate patterns mined by the HUNSPM method. This shows that when the method described in this application mines repeated negative sequence candidate patterns from a dataset with a larger average number of transactions per customer, it can mine more repeated negative sequence candidate patterns.
[0117] From Figure 6 and Figure 7 It can be seen that:
[0118] (1) Under the condition that the minimum utility threshold of the method described in this application is 0.005, 18,500 high-utility repeated negative sequence patterns are mined from the DS4 dataset, while the HUNSPM method only mines 8144 negative sequence patterns under the same conditions. That is to say, the number of high-utility repeated negative sequence patterns mined from the DS4 dataset by the method described in this application under the condition that the minimum utility threshold is 0.005 is 2.27 times the number of negative sequence patterns mined by the HUNSPM method.
[0119] Under the condition that the minimum utility threshold of the method described in this application is 0.005, 17,105 high-utility repeated negative sequence patterns are mined from the DS5 dataset, while the HUNSPM method only mines 7259 negative sequence patterns under the same conditions. That is to say, the number of high-utility repeated negative sequence patterns mined from the DS5 dataset by the method described in this application under the condition that the minimum utility threshold is 0.01 is 2.35 times the number of negative sequence patterns mined by the HUNSPM method. Moreover, by comparing the above data, it can also be known that under the condition that the minimum utility threshold is 0.02, the number of high-utility repeated negative sequence patterns obtained when the method described in this application tests the DS4 dataset is 1.08 times the number of high-utility repeated negative sequence patterns obtained when the method described in this application tests the DS5 dataset. Under the condition that the minimum utility threshold is 0.005, the number of negative sequence patterns obtained when the HUNSPM method tests the DS4 dataset is 1.12 times the number of negative sequence patterns obtained when the HUNSPM method tests the DS5 dataset. This shows that when the method described in this application mines high-utility repeated negative sequence patterns from a dataset with a larger average number of transactions per customer, it can mine more high-utility repeated negative sequence patterns.
[0120] From Figure 8 and Figure 9 It can be seen that:
[0121] (1) Under the condition that the minimum utility threshold of the method described in this application is 0.004, 35,795 high-utility repeated negative sequence patterns are mined from the DS1 dataset, while the HUNSPM method only mines 14,113 negative sequence patterns under the same conditions. That is to say, the number of high-utility repeated negative sequence patterns mined from the DS1 dataset by the method described in this application under the condition that the minimum utility threshold is 0.005 is 2.53 times the number of negative sequence patterns mined by the HUNSPM method;
[0122] Under the condition that the minimum utility threshold of the method described in this application is 0.004, 58,819 high-utility repeated negative sequence patterns are mined from the DS6 dataset, while the HUNSPM method only mines 15,440 negative sequence patterns under the same conditions. That is to say, the number of high-utility repeated negative sequence patterns mined from the DS6 dataset by the method described in this application under the condition that the minimum utility threshold is 0.004 is 3.80 times the number of negative sequence patterns mined by the HUNSPM method; Moreover, by comparing the above data, it can also be known that under the condition that the minimum utility threshold is 0.004, the number of high-utility repeated negative sequence patterns obtained when the method described in this application tests the DS1 dataset is 1.64 times the number of high-utility repeated negative sequence patterns obtained when the method described in this application tests the DS6 dataset, and under the condition that the minimum utility threshold is 0.005, the number of negative sequence patterns obtained when the HUNSPM method tests the DS6 dataset is 1.09 times the number of negative sequence patterns obtained when the HUNSPM method tests the DS1 dataset. This shows that when the method described in this application mines high-utility repeated negative sequence patterns from a dataset with a larger maximum pattern number, it can mine more high-utility repeated negative sequence patterns.
[0123] (2) Under the condition that the minimum utility threshold of the method described in this application is 0.004, 1,105,165 repeated negative sequence candidate patterns are mined from the DS1 dataset, while the HUNSPM method only mines 14,113 negative sequence patterns under the same conditions. That is to say, the number of repeated negative sequence candidate patterns mined from the DS1 dataset by the method described in this application under the condition that the minimum utility threshold is 0.004 is 78.3 times the number of negative sequence patterns mined by the HUNSPM method; This shows that when the method described in this application mines repeated negative sequence candidate patterns from a dataset with a larger maximum pattern number, it can mine more repeated negative sequence candidate patterns.
[0124] From Figure 8 and Figure 10 It can be seen that:
[0125] (1) Under the condition that the minimum utility threshold of the method described in this application is 0.004, 35,795 high-utility repeated negative sequence patterns are mined from the DS1 dataset, while the HUNSPM method only mines 14,113 negative sequence patterns under the same conditions. That is to say, the number of high-utility repeated negative sequence patterns mined from the DS1 dataset by the method described in this application under the condition that the minimum utility threshold is 0.004 is 2.53 times the number of negative sequence patterns mined by the HUNSPM method.
[0126] Under the condition that the minimum utility threshold of the method described in this application is 0.004, 3,676 high-utility repeated negative sequence patterns are mined from the DS7 dataset, while the HUNSPM method only mines 1,994 negative sequence patterns under the same conditions. That is to say, the number of high-utility repeated negative sequence patterns mined from the DS7 dataset by the method described in this application under the condition that the minimum utility threshold is 0.004 is 1.84 times the number of negative sequence patterns mined by the HUNSPM method. Moreover, by comparing the above data, it can also be known that under the condition that the minimum utility threshold is 0.004, the number of high-utility repeated negative sequence patterns obtained when the method described in this application tests the DS1 dataset is 9.74 times the number of high-utility repeated negative sequence patterns obtained when the method described in this application tests the DS7 dataset. Under the condition that the minimum utility threshold is 0.004, the number of negative sequence patterns obtained when the HUNSPM method tests the DS1 dataset is 7.07 times the number of negative sequence patterns obtained when the HUNSPM method tests the DS7 dataset. This shows that when the method described in this application mines high-utility repeated negative sequence patterns from a dataset with fewer items, it can mine more high-utility repeated negative sequence patterns.
[0127] (2) Under the condition that the minimum utility threshold of the method described in this application is 0.004, 1,105,165 repeated negative sequence candidate patterns are mined from the DS1 dataset, while the HUNSPM method only mines 14,113 negative sequence patterns under the same conditions. That is to say, the number of repeated negative sequence candidate patterns mined from the DS1 dataset by the method described in this application under the condition that the minimum utility threshold is 0.004 is 78.3 times the number of negative sequence patterns mined by the HUNSPM method. This shows that when the method described in this application mines repeated negative sequence candidate patterns from a dataset with fewer items, it can mine more repeated negative sequence candidate patterns.
[0128] In addition, this application also tests and compares the method described in this application and the HUNSPM method in terms of the mining ability λ per unit time. The experimental results are shown in Table 3. In Table 3, λ1 represents the mining ability per unit time of the method described in this application, λ1 = (time for mining high-utility repeated negative sequence patterns / number of high-utility repeated negative sequence patterns mined), and λ2 represents the mining ability per unit time of the HUNSPM method, λ2 = (time for mining negative sequence patterns / number of negative sequence patterns mined). In this application, the smaller the value of the mining ability λ per unit time, the more superior the mining efficiency of the mining method.
[0129] Table 3 Test Results of the Mining Ability per Unit Time of the Method in this Application and the HUNSPM Method for Different Datasets
[0130]
[0131] As can be seen from Table 3, the mining ability per unit time of the method described in this application for datasets DS1 to DS7 is significantly better than that of the HUNSPM method. For example, when the minimum utility threshold is 0.01, the mining ability per unit time λ1 of the method described in this application for mining high-utility repeated negative sequence patterns from the DS1 dataset (with 10K items) is 0.131, while the mining ability per unit time λ2 of the HUNSPM method for mining high-utility negative sequence patterns under the same conditions is 3.1. That is to say, the mining ability per unit time of the method described in this application for mining high-utility repeated negative sequence patterns from the DS1 dataset when the minimum utility threshold is 0.01 is 23.66 times that of the HUNSPM method for mining high-utility negative sequence patterns.
[0132] When the minimum utility threshold is 0.005, the mining ability per unit time λ1 of the method described in this application for mining high-utility repeated negative sequence patterns from the DS5 dataset is 0.012, while the mining ability per unit time λ2 of the HUNSPM method for mining high-utility negative sequence patterns under the same conditions is 0.638. That is to say, when the minimum utility threshold is 0.005, the mining ability per unit time of the method described in this application for mining high-utility repeated negative sequence patterns from the DS5 dataset is 53.1 times that of the HUNSPM method for mining high-utility negative sequence patterns. Obviously, when the method described in this application is used to mine the DS5 dataset with a higher transaction complexity compared to the DS1 dataset, it still has better test results for the mining ability per unit time.< / c>
Claims
1. A commodity recommendation method based on the mining of high-utility repetitive negative sequence patterns, characterized in that: It includes the following steps: S1. Perform data cleaning and classification processing on the user's shopping data in sequence to obtain a shopping sequence; count the shopping sequence and its corresponding user ID into the user shopping sequence data table in chronological order; S2. Mine high-utility repeated positive sequence patterns from the shopping sequences in the user shopping sequence data table, and perform negative transformation processing to obtain repeated negative sequence candidate patterns. Calculate the utility value of the repeated negative sequence candidate patterns based on the commodity element influence rate, and use the repeated negative sequence candidate patterns with a utility value greater than or equal to the preset minimum utility threshold ξ as high-utility repeated negative sequence patterns; The negative transformation processing includes the following steps: perform negative transformation operations on any k commodity elements in the high-utility repeated positive sequence pattern with a length of m to obtain repeated negative sequence candidate patterns. m ranges from 2 to n, where n is equal to the number of commodity elements in the shopping sequence, and k is the smallest integer not less than m / 2; The constraints for negative transformation processing are: (1). It is not allowed to continuously appear item sets that only contain one negative commodity element; and when the length of the items in the item set is greater than 1, the negative commodity elements in the items are not all negative; (2). It is allowed to appear item sets that only contain one negative commodity element, and not all the items in the item set are negative; Calculating the utility value of a repeated negative sequence candidate pattern based on the impact rate of commodity elements includes the following steps: First, calculate the th commodity element in the encoded shopping sequence for the impact rate of commodity elements , and its calculation method is shown in Equation (5): (5) In formula (5), represents the th commodity element in the repeated negative sequence candidate pattern, represents the utility value of the th commodity element in the repeated negative sequence candidate pattern recorded in the sequence element influence rate table in the encoded shopping sequence ; represents the utility values of all commodity elements in their respective encoded shopping sequences ; represents the total utility value of all commodity elements appearing in all the encoded shopping sequences DB in the user shopping sequence data table; Calculate the utility value of the repeated negative sequence candidate pattern based on the influence rate of commodity elements The calculation formula is shown in Equation (6) as follows: (6) In formula (6), represents the utility value of the non-overlapping positive sequence candidate pattern, represents the th commodity element in the repeated negative sequence candidate pattern in the encoded shopping sequence represents the influence rate of the commodity element in the encoded shopping sequence, indicating the number of occurrences of a single negative element in the sequence element influence rate table in the encoded shopping sequence ; represents the length size of the encoded shopping sequence corresponding to in the sequence element influence rate table. S3. Adjust the products displayed on the platform interface based on the high-utility repeated negative sequence patterns, their utility values, and the corresponding user IDs.
2. The commodity recommendation method based on mining of high-utility repetitive negative sequence patterns according to claim 1, characterized in that: In step S1, the classification processing of the shopping data after data cleaning includes the following steps: 1). Create a set for each user in the shopping data after data cleaning, and set a unique user ID for each user; 2). In the user set, count the types of products ITEM purchased by the user and the purchase quantity of each type of product ITEM; 3). Count all types of products ITEM and their utility values in the shopping data after data cleaning into the element data table.
3. The commodity recommendation method based on high-utility repeated negative sequence pattern mining according to claim 1, wherein: Step S2 specifically includes the following steps: S2-1. Mine high-utility repeated positive sequence patterns from the shopping sequences in the user shopping sequence data table; S2-2. Perform negative transformation processing on all the high-utility repeated positive sequence patterns stored in the high-utility repeated positive sequence pattern list to obtain repeated negative sequence candidate patterns; after negative transformation processing, assign the utility value of the original high-utility repeated positive sequence pattern to the corresponding repeated negative sequence candidate pattern to make it the initial utility value of the repeated negative sequence candidate pattern; S2-3. By traversing all the repeated negative sequence candidate patterns, calculate and store the utility value of each repeated negative sequence candidate pattern based on the commodity element influence rate to predict the purchase potential of these repeated negative sequence candidate patterns for users; then, compare the utility value of each repeated negative sequence candidate pattern with the preset minimum utility threshold ξ. When the utility value of the repeated negative sequence candidate pattern is greater than or equal to the minimum utility threshold ξ, the repeated negative sequence candidate pattern is recognized as a high-utility repeated negative sequence pattern, otherwise it is not.
4. The commodity recommendation method based on high-utility repeated negative sequence pattern mining according to claim 3, wherein: Step S2-1 specifically includes the following steps: S2-1-1. Perform encoding operations on the element data table and the shopping sequence to obtain the encoded element data table and the encoded shopping sequence; S2-1-2. Perform mining of repeated positive sequence candidate patterns of length 1 for all encoded shopping sequences, and mine repeated positive sequence candidate patterns of length 1 for each type of commodity element in each shopping sequence; S2-1-3. Calculate the utility value of the repeated positive sequence candidate patterns of length 1, and compare it with the preset minimum utility threshold ξ. When the utility value of the repeated positive sequence candidate patterns of length 1 is greater than or equal to the minimum utility threshold ξ, then the repeated positive sequence candidate pattern of length 1 is a high-utility repeated positive sequence pattern of length 1; then, record the above-mentioned repeated positive sequence candidate patterns of length 1 in the repeated positive sequence candidate pattern list, and record the above high-utility repeated positive sequence patterns in the high-utility repeated positive sequence pattern list; S2-1-4. Connect the different repeated positive sequence candidate patterns of length 1 of the same user at the same time in a recursive loop to construct repeated positive sequence candidate patterns of lengths 2 to n respectively, where n is equal to the number of commodity elements in the shopping sequence; S2-1-5. Use a non-overlapping method to constrain all repeated positive sequence candidate patterns with a length greater than or equal to 2 stored in the repeated positive sequence candidate pattern list to obtain non-overlapping positive sequence candidate patterns, calculate the utility value of the non-overlapping positive sequence candidate patterns, and then compare the utility value of the non-overlapping positive sequence candidate patterns with the preset minimum utility threshold ξ. When the utility value of the non-overlapping positive sequence candidate patterns is greater than or equal to the minimum utility threshold ξ, then the non-overlapping positive sequence candidate pattern is a high-utility repeated positive sequence pattern with a length greater than or equal to 2, otherwise it is not; subsequently, record the above high-utility repeated positive sequence patterns in the high-utility repeated positive sequence pattern list.
5. The commodity recommendation method based on high-utility repetitive negative sequence pattern mining according to claim 4, wherein: In step S2-1-5, using a non-overlapping method to constrain the repeated positive sequence candidate patterns with a length greater than or equal to 2 includes the following steps: (1). Mine all repeated positive sequence candidate patterns with a length greater than or equal to 2 from the user shopping sequence data table, obtain the corresponding matching position patterns of the above repeated positive sequence candidate patterns, and calculate the utility values of all repeated positive sequence candidate patterns with a length greater than or equal to 2. Store all repeated positive sequence candidate patterns with a length greater than or equal to 2 and their corresponding matching position patterns and utility values in a hash table; (2). Arrange the matching position patterns in the hash table in the order of the purchase sequence of commodity elements; (3). Traverse all the matching position patterns in the hash table in the order of the purchase sequence of commodity elements, and delete the subsequent matching position patterns and their corresponding matching position patterns and utility values whose positions of the same commodity element are the same as those in the previous matching position patterns; the above settings can prevent the commodity elements in the repeated positive sequence candidate patterns from being reused at the same position in other repeated positive sequence candidate patterns, but can be reused at different positions.
6. A commodity recommendation system for implementing the commodity recommendation method based on high-utility repetitive negative sequence pattern mining described in claim 1, characterized in that: It includes a data storage layer, an algorithm layer, and an application layer, where, The data storage layer is used to collect users' shopping history data, clean the collected users' shopping history data to obtain the shopping data after data cleaning; then, classify the shopping data after data cleaning to obtain shopping sequences; then, statistically record the shopping sequences and their corresponding user IDs into the user shopping sequence data table in chronological order, and the data storage layer transmits the user shopping sequence data table and its corresponding element data table to the algorithm layer; The algorithm layer is used to mine high-utility repeated positive sequence patterns for the shopping sequences in the user shopping sequence data table output by the data storage layer, mine repeated negative sequence candidate patterns based on the mined high-utility repeated positive sequence patterns, and screen out the repeated negative sequence candidate patterns with utility values greater than or equal to the preset minimum utility threshold ξ as high-utility repeated negative sequence patterns; the algorithm layer passes the high-utility repeated negative sequence patterns to the application layer; The application layer is used to receive the high-utility repeated negative sequence patterns from the algorithm layer as recommendation information and adjust the products displayed on the platform interface according to the user ID; at the same time, save the adjustment records, generate a log file and transmit it to the data storage layer for archiving and storage.
Citation Information
Patent Citations
A commodity recommendation system based on actionable high utility negative sequential rules mining and its working method
AU2020103191A4
Application of repeated negative sequence pattern in customer purchase behavior analysis
CN104537553A
Cited By
Commodity real-time recommendation method and system capable of efficiently using repeated negative sequence pattern mining
CN121052908A
A commodity real-time recommendation method and system based on efficient repeated negative sequence pattern mining
CN121052908B
