A training method, device and electronic device for a product recommendation model
By selecting and processing time series features from the selected features and combining them with a recurrent neural network training model, the problem that the tree model cannot learn time series information is solved, and the training efficiency and accuracy of product recommendations are improved.
Patent Information
- Application Number
- CN202210615759.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-28
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2039-08-28
AI Technical Summary
Tree models cannot effectively learn temporal information in product recommendations, resulting in low training efficiency and insufficient accuracy.
A feature whose time series characteristics meet preset conditions is selected from multiple selected features as a time series feature, and a third sample set is constructed through processing, and a recurrent neural network is used to train a product recommendation model.
The training efficiency and accuracy of the product recommendation model are improved, and time series information can be better utilized for product recommendations.
Smart Images

Figure CN115049052B_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with application date of August 28, 2019, application number 201910803314.8, and titled “A training method, device and electronic device for a product recommendation model”. Technical Field
[0002] The present invention relates to the technical field of product recommendation, and more specifically, to a product recommendation model training method, a product recommendation model training device, an electronic device, and a readable storage medium. Background Art
[0003] In the era of big data, most companies have their own accumulated data. To provide customized products to different customers, the commonly used machine learning-based product recommendation method is usually: based on the product recommendation model, for each customer, the matching value between the recommended products and the customer is calculated, and the matching value is sorted, and the top-ranked products are recommended to the customer.
[0004] Tree models are widely used in industry due to their advantages, including ease of implementation, good parallelism, and strong interpretability. For example, in recommendation systems, tree models such as random forests, GBDT (Gradient Boosting Decisive Tree), and XGBOOST (eXtreme Gradient Boosting) are commonly used as product recommendation models. However, due to their relative simplicity, tree models require a large number of features for training and are unable to learn the temporal information contained in certain features.
[0005] Therefore, a model training method is proposed to make it easier for the product recommendation model to learn useful information. Summary of the Invention
[0006] The present invention provides a new technical solution for training a product recommendation model, which enables the product recommendation model to learn useful information more easily.
[0007] According to a first aspect of the present invention, a method for training a product recommendation model is provided, comprising:
[0008] Obtaining an original first sample set for training a product recommendation model, wherein each original sample in the first sample set includes a plurality of selected features and labels;
[0009] Selecting a feature whose timing characteristics meet a preset condition from the plurality of selected features as a timing feature;
[0010] Processing the selected time series features to obtain at least one processed feature;
[0011] constructing a second sample set, wherein each second sample in the second sample set includes the plurality of selected features, the at least one processing feature, and the label;
[0012] Based on the second sample set, a predetermined machine learning algorithm is used to train a product recommendation model.
[0013] Optionally, the step of processing the selected time series features to obtain at least one processing feature includes:
[0014] Constructing a third sample set using the selected time series features and corresponding labels;
[0015] A recurrent neural network is trained based on the third sample set; and a value of each third sample in a hidden layer of the neural network is obtained as a feature value of a processing feature corresponding to the third sample.
[0016] Optionally, the step of selecting a feature whose timing characteristics meet a preset condition from the multiple selected features as the timing feature includes:
[0017] For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period;
[0018] For each selected feature, determine the number of extreme value points of the average value in the order of the set time periods;
[0019] A selected feature whose number of extreme value points meets a preset first screening condition is selected as the time series feature.
[0020] Optionally, the step of selecting a feature whose number of extreme value points meets a preset first screening condition as the time series feature includes:
[0021] Sorting the selected features in descending order according to the number of extreme value points, and obtaining a first sorting order on each selected feature;
[0022] Selected features whose first sorting order conforms to a preset first sorting range are selected as the time series features.
[0023] Optionally, the step of selecting a feature whose timing characteristics meet a preset condition from the multiple selected features as the timing feature includes:
[0024] For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period;
[0025] Determine how much the mean value of each selected characteristic changes over a set number of time periods;
[0026] The selected feature whose variation range meets the preset second screening condition is selected as the time series feature.
[0027] Optionally, the step of determining the variation range of the average value of each selected feature within a plurality of set time periods includes:
[0028] For each selected feature, determine the extreme points of the mean value in the order of the set time periods;
[0029] For each selected feature, determine the absolute value of the increase or decrease between adjacent extreme points;
[0030] Determine the average of the absolute values of the increase and decrease of each selected feature as the change amplitude of the corresponding selected feature.
[0031] Optionally, the step of selecting a feature whose variation amplitude meets a preset second screening condition as the time series feature includes:
[0032] Sorting the selected features in descending order according to the magnitude of the change, and obtaining a second sort order for each selected feature;
[0033] Selected features whose second sorting order conforms to a preset second sorting range are selected as the time series features.
[0034] Optionally, the machine learning algorithm is a random forest algorithm.
[0035] Optionally, each third sample has a corresponding sample identifier;
[0036] The step of training a recurrent neural network based on the third sample set includes:
[0037] For each sample identifier, according to the third sample corresponding to the sample identifier, using the undetermined parameters of the recurrent neural network algorithm as variables, determining an expression corresponding to the sample identifier;
[0038] Solve the expression of each sample identifier, determine the undetermined parameters of the recurrent neural network algorithm, and obtain the recurrent neural network.
[0039] Optionally, each sample ID is used as the target sample ID in turn.
[0040] The target sample identification expression is expressed as:
[0041]
[0042]
[0043] Among them, w i 、w h 、w o All parameters are pending. Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected time period for the target sample, The value of the hidden layer node of the third sample collected within the τ-1th set time period is identified as the target sample, y τ A label corresponding to the third sample collected within the τth set time period is identified for the target sample.
[0044] Optionally, the method further includes:
[0045] Obtaining a feature value of a selected feature corresponding to at least one preset candidate product for a target user to be recommended;
[0046] Based on the product recommendation model, obtaining a recommendation score for each candidate product and the target user according to the feature value of the selected feature of the target user corresponding to each candidate product;
[0047] The candidate products whose recommendation scores meet the preset recommendation conditions are selected and recommended to the target user as target products.
[0048] Optionally, the step of obtaining a recommendation score for each candidate product and the target user based on the feature value of the selected feature of the target user corresponding to each candidate product based on the product recommendation model includes:
[0049] Obtaining a feature value of a processing feature of each candidate product corresponding to the target user based on the feature value of the time series feature of each candidate product corresponding to the target user;
[0050] Based on the product recommendation model, recommendation scores corresponding to the candidate products and the target user are obtained according to the feature values of the selected features and the feature values of the processing features of each candidate product selected by the target user.
[0051] Optionally, the step of selecting the candidate product whose recommendation score meets a preset recommendation condition and recommending it to the target user as the target product includes:
[0052] Sort the candidate products in descending order according to the recommendation score, and obtain the sorting order of each candidate product;
[0053] The candidate commodities whose sorting order meets the preset third sorting range are selected and recommended to the target user as target commodities.
[0054] Optionally, the method further includes:
[0055] Each candidate product and the ranking order of each candidate product are displayed.
[0056] According to a second aspect of the present invention, a training device for a product recommendation model is provided, comprising:
[0057] A first sample acquisition module, configured to acquire an original first sample set for training a product recommendation model, wherein each original sample in the first sample set includes a plurality of selected features and labels;
[0058] A time series feature selection module, configured to select a feature whose time series characteristic meets a preset condition from the plurality of selected features as a time series feature;
[0059] a time series feature processing module, configured to process the selected time series feature to obtain at least one processing feature;
[0060] A second sample construction module, configured to construct a second sample set, wherein each second sample in the second sample set includes the plurality of selected features, the at least one processing feature, and the label;
[0061] The recommendation model training module is used to train a product recommendation model based on the second sample set using a predetermined machine learning algorithm.
[0062] Optionally, the timing feature processing module is further used to:
[0063] Constructing a third sample set using the selected time series features and corresponding labels;
[0064] A recurrent neural network is trained based on the third sample set; and a value of each third sample in a hidden layer of the neural network is obtained as a feature value of a processing feature corresponding to the third sample.
[0065] Optionally, the time series feature selection module is further used to:
[0066] For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period;
[0067] For each selected feature, determine the number of extreme value points of the average value in the order of the set time periods;
[0068] A selected feature whose number of extreme value points meets a preset first screening condition is selected as the time series feature.
[0069] Optionally, the selected feature whose number of extreme value points meets a preset first screening condition as the time series feature includes:
[0070] Sorting the selected features in descending order according to the number of extreme value points, and obtaining a first sorting order on each selected feature;
[0071] Selected features whose first sorting order conforms to a preset first sorting range are selected as the time series features.
[0072] Optionally, the time series feature selection module is further used to:
[0073] For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period;
[0074] Determine how much the mean value of each selected characteristic changes over a set number of time periods;
[0075] The selected feature whose variation range meets the preset second screening condition is selected as the time series feature.
[0076] Optionally, determining the variation range of the average value of each selected feature within a plurality of set time periods includes:
[0077] For each selected feature, determine the extreme points of the mean value in the order of the set time periods;
[0078] For each selected feature, determine the absolute value of the increase or decrease between adjacent extreme points;
[0079] Determine the average of the absolute values of the increase and decrease of each selected feature as the change amplitude of the corresponding selected feature.
[0080] Optionally, the selected feature whose variation amplitude meets a preset second screening condition as the time series feature includes:
[0081] Sorting the selected features in descending order according to the magnitude of the change, and obtaining a second sort order for each selected feature;
[0082] Selected features whose second sorting order conforms to a preset second sorting range are selected as the time series features.
[0083] Optionally, the machine learning algorithm is a random forest algorithm.
[0084] Optionally, each third sample has a corresponding sample identifier;
[0085] The training of the recurrent neural network based on the third sample set includes:
[0086] For each sample identifier, according to the third sample corresponding to the sample identifier, using the undetermined parameters of the recurrent neural network algorithm as variables, determining an expression corresponding to the sample identifier;
[0087] Solve the expression of each sample identifier, determine the undetermined parameters of the recurrent neural network algorithm, and obtain the recurrent neural network.
[0088] Optionally, each sample ID is used as the target sample ID in turn.
[0089] The target sample identification expression is expressed as:
[0090]
[0091]
[0092] Among them, w i 、w h 、w o All parameters are pending. Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected time period for the target sample, The value of the hidden layer node of the third sample collected within the τ-1th set time period is identified as the target sample, y τ A label corresponding to the third sample collected within the τth set time period is identified for the target sample.
[0093] Optionally, the device further includes:
[0094] A feature value acquisition module is used to obtain a feature value of a selected feature corresponding to at least one preset candidate product to be recommended to a target user;
[0095] a recommendation score acquisition module, configured to acquire, based on the product recommendation model, a recommendation score for each candidate product and the target user according to the feature value of the selected feature of the target user corresponding to each candidate product;
[0096] The product recommendation module is used to select candidate products whose recommendation scores meet preset recommendation conditions and recommend them to the target user as target products.
[0097] Optionally, the recommendation score acquisition module is further configured to:
[0098] Obtaining a feature value of a processing feature of each candidate product corresponding to the target user based on the feature value of the time series feature of each candidate product corresponding to the target user;
[0099] Based on the product recommendation model, recommendation scores corresponding to the candidate products and the target user are obtained according to the feature values of the selected features and the feature values of the processing features of each candidate product selected by the target user.
[0100] Optionally, the product recommendation module is further configured to:
[0101] Sort the candidate products in descending order according to the recommendation score, and obtain the sorting order of each candidate product;
[0102] The candidate commodities whose sorting order meets the preset third sorting range are selected and recommended to the target user as target commodities.
[0103] Optionally, the device further includes:
[0104] A module for displaying each candidate product and the ranking order of each candidate product.
[0105] According to a third aspect of the present invention, there is provided an electronic device, comprising:
[0106] The device according to the second aspect of the present invention; or
[0107] A processor and a memory, wherein the memory is used to store instructions, and the instructions are used to control the processor to execute the method according to the first aspect of the present invention.
[0108] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to the first aspect of the present invention when executed by a processor.
[0109] In an embodiment of the present invention, by selecting time series features whose timing meets preset conditions from selected features, processing the time series features to obtain processed features, and merging the selected features with the processed features, the dimension of the second sample features used to train the product recommendation model can be increased, making it easier for the predetermined machine learning algorithm to learn useful information, thereby improving the accuracy of the resulting product recommendation model. Furthermore, the processed features are obtained by processing the time series features, and therefore, the time series information contained in the processed features enables the product recommendation model to better utilize this time series information.
[0110] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0111] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0112] Figure 1 is a block diagram showing an example of a hardware configuration of an electronic device that can be used to implement an embodiment of the present invention;
[0113] Figure 2 A flowchart showing a method for training a product recommendation model according to a first embodiment of the present invention is shown;
[0114] Figure 3 A flowchart showing a method for training a product recommendation model according to a second embodiment of the present invention is shown;
[0115] Figure 4 A flowchart showing an example of a method for training a product recommendation model according to an embodiment of the present invention;
[0116] Figure 5 A block diagram showing an example of a training device for a product recommendation model according to an embodiment of the present invention;
[0117] Figure 6 A block diagram showing another example of a training device for a product recommendation model according to an embodiment of the present invention;
[0118] Figure 7 A block diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0119] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention.
[0120] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0121] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0122] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0123] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0124] Hereinafter, various embodiments and examples according to embodiments of the present invention will be described with reference to the accompanying drawings.
[0125] <Hardware Configuration>
[0126] Figure 1 is a block diagram showing a hardware configuration of an electronic device 1000 that can implement an embodiment of the present invention.
[0127] The electronic device 1000 may be a portable computer, a desktop computer, a mobile phone, a tablet computer, etc. Figure 1 As shown, electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. Processor 1100 may be a central processing unit (CPU), a microprocessor (MCU), or the like. Memory 1200 may include, for example, ROM (read-only memory), RAM (random access memory), or a non-volatile memory such as a hard disk. Interface device 1300 may include, for example, a USB interface or a headphone jack. Communication device 1400 may be capable of wired or wireless communication, specifically, Wi-Fi, Bluetooth, 2G / 3G / 4G / 5G communication, or the like. Display device 1500 may be, for example, an LCD display or a touchscreen display. Input device 1600 may include, for example, a touchscreen, a keyboard, or somatosensory input. Users may input and output voice information through speaker 1700 and microphone 1800.
[0128] Figure 1 The electronic device shown is merely illustrative and does not in any way limit the present invention, its application or use. In the embodiment of the present invention, the memory 1200 of the electronic device 1000 is used to store instructions, which are used to control the processor 1100 to operate to perform any of the product recommendation model training methods provided in the embodiment of the present invention. It should be understood by those skilled in the art that although Figure 1 While multiple devices are shown for electronic device 1000, the present invention may only relate to some of these devices. For example, electronic device 1000 may only relate to processor 1100 and storage device 1200. A skilled artisan can design instructions based on the disclosed scheme. How instructions control processor operations is well known in the art and will not be described in detail here.
[0129] <Method Example>
[0130] In this embodiment, a method for training a product recommendation model is provided. The method for training a product recommendation model can be implemented by an electronic device. The electronic device can be Figure 1 The electronic device 1000 is shown.
[0131] according to Figure 2 As shown, the product recommendation model training method of this embodiment may include the following steps S2100 to S2500:
[0132] Step S2100: Obtain an original first sample set for training a product recommendation model.
[0133] The first sample set includes multiple original samples, and each original sample includes multiple selected features and labels.
[0134] In one embodiment, each original sample in the first sample set has a corresponding timestamp, which indicates the time when the original sample was collected. The label of the original sample can indicate whether the corresponding user performed a corresponding operation on the corresponding product when the sample was generated, such as purchase, browsing, or favorite. Each original sample can also have a sample identifier, and the user and product corresponding to the original sample can be determined based on the sample identifier.
[0135] In one embodiment, the sample identifier can be obtained by combining the unique user identifier of the corresponding user and the unique product identifier of the corresponding product. For example, the label of an original sample indicates whether user A performed a corresponding operation on product A when the sample was generated. User A's unique user identifier is 111, and product A's unique product identifier is 222. Then, the sample identifier of the original sample can be 111222, or 222111, etc.
[0136] In the first sample set, there may be multiple original samples with the same sample identifier, and the timestamps corresponding to these original samples are different.
[0137] Step S2200 , selecting a feature whose temporal sequence meets a preset condition from a plurality of selected features as a temporal feature.
[0138] In the first embodiment, the step of selecting the time series feature may include steps S2211 to S2213 as follows:
[0139] Step S2211: For the original samples collected within each set time period, calculate the average value of each selected feature within the corresponding set time period.
[0140] In one embodiment, multiple set time periods may be preselected, and the length of each set time period may be equal, for example, each set time period may be 1 day.
[0141] The corresponding set time period can be determined based on the timestamp of the original sample. For example, if the timestamp of the original sample is 18:00 on January 1, 2019, then it can be determined that the original sample was collected within the set time period of January 1, 2019.
[0142] By using the set time period corresponding to each original sample, the original samples collected in each set time period can be obtained.
[0143] For multiple original samples collected in each set period, the average value of each selected feature in the corresponding set period can be calculated separately. For example, in the first set period, there are original samples 1-M, each of which contains N selected features, and the feature value of the jth (j∈[1,N]) selected feature of the ith (i∈[1,M])th original sample is f ij , the average value of the jth selected feature in the first selected period can be expressed as
[0144] In one example, the average value of each selected feature in each set time period may be as shown in Table 1 below:
[0145] Table 1
[0146]
[0147] In Table 1, the first column represents the selected features, the first row represents the selected time period, and the values therein represent the average values of the corresponding selected features in the corresponding set time period.
[0148] Step S2212: For each selected feature, determine the number of extreme value points of the average value according to the order of the preset time periods.
[0149] In this embodiment, extreme value points may include maximum value points and minimum value points. Specifically, if the average value of the selected feature in a set period is greater than the average value in two adjacent set period times, then the average value of the set feature in the set period is a maximum value point of the selected feature. If the average value of the selected feature in a set period is less than the average value in two adjacent set period times, then the average value of the set feature in the set period is a minimum value point of the selected feature. The average value of the set feature in the first set period and the average value in the last set period are also regarded as extreme value points of the selected feature.
[0150] In the example shown in Table 1 above, for the selected feature f1, its extreme value points include -1, 3, and -2, so the number of extreme value points of the selected feature f1 is 3. For the selected feature f2, its extreme value points include -1, 6, 4, 7, 6, 9, and 5, so the number of extreme value points of the selected feature f2 is 7. For the selected feature f3, its extreme value points include -2, 9, 3, 9, and 2, so the number of extreme value points of the selected feature f3 is 5. For the selected feature f4, its extreme value points include 3, 8, 3, 9, 3, and 9, so the number of extreme value points of the selected feature f4 is 6. For the selected feature f5, its extreme value points include 1, 9, 1, 9, and 1, so the number of extreme value points of the selected feature f5 is 5.
[0151] Step S2213 , selecting a selected feature whose number of extreme value points meets a preset first screening condition as a time series feature.
[0152] In one embodiment, selecting a selected feature whose number of extreme value points meets a preset first screening condition as a time series feature may include the following steps S2213-1 to S2213-2:
[0153] Step S2213 - 1 , sorting the selected features in descending order according to the number of extreme value points, and obtaining the first sorting order on each selected feature.
[0154] In the example shown in Table 1 above, the number of extreme points of the selected features f1 to f5 are 3, 7, 5, 6, and 5 respectively. The selected features f1 to f5 are sorted in descending order according to the number of extreme points, and the first sorting order of the selected features f1 to f5 is 5, 1, 3, 2, and 3 respectively.
[0155] Step S2213 - 2 , selecting selected features whose first sorting order conforms to a preset first sorting range as time series features.
[0156] In the example shown in Table 1 above, the first sorting range can be pre-set based on the application scenario or specific requirements. For example, the first sorting range can be 1-3. Then, the selected features whose first sorting order meets the preset first sorting range include selected features f2, f4, f3, and f5. For another example, the first sorting range can be 1-2. Then, the selected features whose first sorting order meets the preset first sorting range include selected features f2 and f4.
[0157] In the second embodiment, the step of selecting the time series feature may further include steps S2221 to S2223 as follows:
[0158] Step S2221: For the original samples collected within each set time period, calculate the average value of each selected feature within the corresponding set time period.
[0159] This step can refer to the aforementioned step S2211 and will not be repeated here.
[0160] Step S2222: Determine the variation of the average value of each selected feature within a plurality of set time periods.
[0161] In one embodiment, determining the variation range of the average value of each selected feature within a plurality of set time periods includes steps S2222-1 to S2222-3 as follows:
[0162] Step S2222-1: For each selected feature, determine the extreme value point of the average value according to the order of the set time periods.
[0163] The step S2222-1 can refer to the aforementioned step S2212 and will not be repeated here.
[0164] Step S2222-2: For each selected feature, determine the absolute value of the increase or decrease between adjacent extreme points.
[0165] In one embodiment, the absolute value of the increase or decrease may be the ratio between the difference between adjacent extreme value points and the value of the previous extreme value point, wherein the previous extreme value point is an extreme value point earlier in the corresponding set time period among the adjacent extreme value points.
[0166] In the example shown in Table 1 above, for the selected feature f1, the absolute value of the increase or decrease between adjacent extreme points -1 and 3 is |(-1-3) / (-1)|=4, and the absolute value of the increase or decrease between adjacent extreme points 3 and -2 is |[3-(-2)] / 3|=1.7.
[0167] For the selected feature f2, the absolute value of the increase or decrease between adjacent extreme points -1 and 6 is |(-1-6) / (-1)|=7, the absolute value of the increase or decrease between adjacent extreme points 6 and 4 is |(6-4) / 6|=0.3, the absolute value of the increase or decrease between adjacent extreme points 4 and 7 is |(4-7) / 4|=0.75, the absolute value of the increase or decrease between adjacent extreme points 7 and 6 is |(7-6) / 7|=0.1, the absolute value of the increase or decrease between adjacent extreme points 6 and 9 is |(6-9) / 6|=0.5, and the absolute value of the increase or decrease between adjacent extreme points 9 and 5 is |(9-5) / 9|=0.4.
[0168] For the selected feature f3, the absolute value of the increase or decrease between adjacent extreme points -2 and 9 is |(-2-9) / (-2)|=5.5, the absolute value of the increase or decrease between adjacent extreme points 9 and 3 is |(9-3) / 9|=0.7, the absolute value of the increase or decrease between adjacent extreme points 3 and 9 is |(3-9) / 3|=2, and the absolute value of the increase or decrease between adjacent extreme points 9 and 2 is |(9-2) / 9|=0.8.
[0169] For the selected feature f4, the absolute value of the increase or decrease between adjacent extreme points 3 and 8 is |(3-8) / 3|=1.7, the absolute value of the increase or decrease between adjacent extreme points 8 and 3 is |(8-3) / 8|=0.6, the absolute value of the increase or decrease between adjacent extreme points 3 and 9 is |(3-9) / 3|=2, the absolute value of the increase or decrease between adjacent extreme points 9 and 3 is |(9-3) / 9|=0.7, and the absolute value of the increase or decrease between adjacent extreme points 3 and 9 is |(3-9) / 3|=2.
[0170] For the selected feature f5, the absolute value of the increase or decrease between adjacent extreme points 1 and 9 is |(1-9) / 1|=8, the absolute value of the increase or decrease between adjacent extreme points 9 and 1 is |(9-1) / 9|=0.9, the absolute value of the increase or decrease between adjacent extreme points 1 and 9 is |(1-9) / 1|=8, the absolute value of the increase or decrease between adjacent extreme points 9 and 1 is |(9-1) / 9|=0.9.
[0171] Step S2222-3, determine the average of the absolute values of the increase and decrease of each selected feature as the change amplitude of the corresponding selected feature.
[0172] In the example shown in Table 1 above, for the selected feature f1, the average value of the absolute value of the price increase or decrease can be (4+1.7) / 2=2.85. For the selected feature f2, the average value of the absolute value of the price increase or decrease can be (7+0.3+0.75+0.1+0.5+0.4) / 6=1.5. For the selected feature f3, the average value of the absolute value of the price increase or decrease can be (5.5+0.7+2+0.8) / 4=2.25. For the selected feature f4, the average value of the absolute value of the price increase or decrease can be (1.7+0.6+2+0.7+2) / 5=1.4. For the selected feature f5, the average value of the absolute value of the price increase or decrease can be (8+0.9+8+0.9) / 4=4.45.
[0173] Then, the change amplitude of the selected feature f1 is 2.85, the change amplitude of the selected feature f2 is 1.5, the change amplitude of the selected feature f3 is 2.25, the change amplitude of the selected feature f4 is 1.4, and the change amplitude of the selected feature f5 is 4.45.
[0174] Step S2223 , selecting the selected features whose variation range meets the preset second screening condition as the time series features.
[0175] In one embodiment, a method of selecting a selected feature whose change amplitude meets a preset second screening condition as a time series feature may be: selecting a selected feature whose change amplitude exceeds a preset amplitude threshold as a time series feature.
[0176] The amplitude threshold may be pre-set according to an application scenario or specific requirements. For example, the amplitude threshold may be 2, and the selected features with a change amplitude exceeding 2 include selected features f1, f3, and f5.
[0177] In one embodiment, the step of selecting the selected feature whose variation amplitude meets the preset second screening condition as the time series feature includes the following steps S2223-1 to S2223-2:
[0178] Step S2223-1: sort the selected features in descending order according to the magnitude of change, and obtain a second sort order for each selected feature.
[0179] The selected features f1 to f5 are sorted in descending order according to the change amplitude, and the second sorting values of the selected features f1 to f5 are 2, 4, 3, 5, and 1 respectively.
[0180] Step S2223-2: Select the selected features whose second sorting order conforms to the preset second sorting range as the time series features.
[0181] The second sorting range may be pre-set according to an application scenario or specific requirements. For example, the second sorting range may be 1-4. Then, the selected features whose second sorting order conforms to the preset second sorting range include selected features f5, f1, f3 and f2.
[0182] Step S2300 : Processing the selected time series features to obtain at least one processed feature.
[0183] In one embodiment, processing the selected time series features to obtain at least one processing feature includes the following steps S2310 to S2320:
[0184] Step S2310: construct a third sample set using the selected time series features and corresponding labels.
[0185] In one embodiment, the third sample set includes third samples, and each third sample includes a time series feature and a corresponding label.
[0186] Specifically, the characteristic value and corresponding label of the time series feature in each original sample may be obtained to form a corresponding third sample, and the corresponding original sample and the third sample have the same sample label and correspond to the same set time period.
[0187] Step S2320: training a recurrent neural network based on the third sample set, and obtaining a value of each third sample in the hidden layer of the recurrent neural network as a feature value of the processing feature corresponding to the third sample.
[0188] In one embodiment, the step of training the recurrent neural network based on the third sample set includes the following steps S2321-S2322:
[0189] Step S2321: For each sample identifier, according to the third sample corresponding to the sample identifier, using the undetermined parameters of the recurrent neural network algorithm as variables, determine an expression corresponding to the sample identifier.
[0190] In one embodiment, each sample identifier may be used as a target sample identifier in turn, and an expression of the target sample identifier may be determined based on the third sample corresponding to the target sample identifier and using the undetermined parameters of the recurrent neural network algorithm as variables.
[0191] Specifically, for a target sample identifier, there are third samples corresponding to multiple set time periods. The expression of the target sample identifier can be expressed as:
[0192]
[0193]
[0194] Among them, w i 、w h 、w o All parameters are pending. Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected period for the target sample, The value of the hidden layer node of the third sample collected within the τ-1th set period is identified as the target sample, y τ The label corresponding to the third sample collected within the τth set time period is identified for the target sample.
[0195] Step S2322, solve the expression of each sample identifier, determine the undetermined parameters of the recurrent neural network algorithm, and obtain the recurrent neural network.
[0196] After obtaining the recurrent neural network, the value of each third sample in the hidden layer of the recurrent neural network is obtained as the feature value of the processing feature corresponding to the third sample.
[0197] In one embodiment, each sample identifier may be used as a target sample identifier in turn, and the value of each third sample of the target sample identifier in the hidden layer of the neural network may be obtained by the following formula:
[0198]
[0199] Among them, w i 、w o are the parameters of the solved recurrent neural network, Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected period for the target sample, Identify the value of the hidden layer node of the third sample collected within the τ-1th set time period for the target sample.
[0200] For the target sample identifier, the value of the hidden layer node of the third sample collected within the first set period Need to be based on To calculate, It can be an initial value set in advance according to the application scenario or specific requirements, for example, it can be 0. Can be the same or different.
[0201] In one example, the hidden layer value can be a vector, and the number of rows in the vector can be the number of nodes in the hidden layer. The number of nodes in the hidden layer can be pre-set based on the application scenario or specific requirements. The number of nodes in the hidden layer is equal to the number of processing features. For example, the number of nodes in the hidden layer can be K. The hidden layer value can then be a K-dimensional vector. The value of each row in the K-dimensional vector represents the feature value of a processing feature corresponding to the third sample.
[0202] For example, if the K-dimensional vector corresponding to a third sample is A1 A2 A3 A4, then A1 represents the characteristic value of the first processing feature of the third sample, A2 represents the characteristic value of the second processing feature of the third sample, A3 represents the characteristic value of the third processing feature of the third sample, and A4 represents the characteristic value of the fourth processing feature of the third sample.
[0203] Step S2400 : constructing a second sample set, wherein each second sample in the second sample set includes a plurality of selected features, at least one processing feature, and a label.
[0204] Specifically, the characteristic value of the processing feature of each third sample may be obtained, and each third sample may be merged with the corresponding original sample to obtain a second sample, so that each second sample includes the characteristic values of the selected feature and the processing feature, as well as the corresponding label. The corresponding original sample, second sample, and third sample have the same sample label and correspond to the same set time period.
[0205] Step S2500: Based on the second sample set, a predetermined machine learning algorithm is used to train a product recommendation model.
[0206] In one embodiment, the predetermined machine learning algorithm can be, for example, any one or more of a random forest algorithm, a GBDT (Gradient Boosting Decison Tree) algorithm, an XGBOOST (eXtreme GradientBoosting) algorithm, a logistic regression algorithm, a neural network algorithm, or other machine learning algorithms.
[0207] In an embodiment of the present invention, by selecting time series features whose timing meets preset conditions from selected features, processing the time series features to obtain processed features, and merging the selected features with the processed features, the dimension of the second sample features used to train the product recommendation model can be increased, making it easier for the predetermined machine learning algorithm to learn useful information, thereby improving the accuracy of the resulting product recommendation model. Furthermore, the processed features are obtained by processing the time series features, and therefore, the time series information contained in the processed features enables the product recommendation model to better utilize this time series information.
[0208] In one embodiment, after obtaining the product recommendation model, the method may further include: Figure 3 Steps S3100 to S3300 are shown:
[0209] Step S3100: Obtain the feature value of the selected feature of at least one preset candidate product corresponding to the target user to be recommended.
[0210] In one embodiment, at least one candidate product may be pre-set for a target user or for all users, that is, the candidate products corresponding to different users may be the same or different.
[0211] The selected features of the target user corresponding to each candidate product may include the features of the target user and the features of the corresponding candidate product. Therefore, among the selected features of the target user corresponding to different candidate products, the feature values of the target user's features are the same, while the feature values of the features of different candidate products may be the same or different.
[0212] Step S3200 : Based on the product recommendation model, the recommendation score of each candidate product and the target user is obtained according to the feature value of the selected feature of the target user corresponding to each candidate product.
[0213] In one embodiment, the step of obtaining the recommendation score of each candidate product and the target user may include the following steps S3210 to S3220:
[0214] Step S3210 , obtaining a feature value of a processing feature corresponding to each candidate commodity of the target user based on the feature value of the temporal feature corresponding to each candidate commodity of the target user.
[0215] Since the time series features are included in the selected features, the time series features of the target user corresponding to each candidate product may include the features corresponding to the candidate product and the features of the target user, or may only include the features corresponding to the candidate product or the features of the target user.
[0216] In one embodiment, for each candidate product corresponding to the target user, the feature value of the time series feature may be substituted into the recurrent neural network obtained in step S2322 to obtain the feature value of the processing feature.
[0217] For details, reference may be made to the description of the step of obtaining the characteristic value of the processing characteristic of each third sample in the aforementioned step 2322 , which will not be repeated here.
[0218] Step S3220 , based on the product recommendation model, obtain the recommendation score corresponding to the candidate product and the target user according to the feature value of the selected feature and the feature value of the processing feature of each candidate product of the target user.
[0219] In one embodiment, the feature values of the selected features and the feature values of the processing features of each candidate product of the target user may be respectively substituted into the product recommendation model to obtain the recommendation scores of the corresponding candidate products and the target user.
[0220] Step S3300: Select candidate products whose recommendation scores meet the preset recommendation conditions and recommend them to the target user as target products.
[0221] In one embodiment, candidate commodities with recommendation scores exceeding a preset score threshold may be selected and recommended to the target user as target commodities.
[0222] The score threshold may be pre-set according to the application scenario or specific needs. For example, the score threshold may be 8. Then, candidate products with a recommendation score exceeding 8 may be selected and recommended to the target user as target products.
[0223] In one embodiment, the step of selecting candidate products whose recommendation scores meet preset recommendation conditions and recommending them as target products to target users may include the following steps S3310 to S3320:
[0224] Step S3310: sort the candidate products in descending order according to the recommendation score, and obtain the sorting order of each candidate product.
[0225] Step S3320 : Select candidate products whose sorting order meets the preset third sorting range and recommend them to the target user as target products.
[0226] In one embodiment, the third ranking range may be pre-set based on the application scenario or specific needs. For example, the third ranking range may be 1 to 5, and then the candidate products ranked 1 to 5 may be recommended to the target user as target products.
[0227] In one embodiment, the method may further include: displaying each candidate product and its ranking for the target user to view. The target user may also reselect a candidate product of actual preference based on the displayed candidate products and their ranking.
[0228] The product recommendation model obtained based on the embodiments of the present invention can accurately and effectively obtain the target user's preference for each candidate product, and select target products that are more in line with the user's preferences for accurate recommendation to the target user, thereby actually meeting the target user's product acquisition needs and improving the target user's product acquisition experience.
[0229] <Example 1>
[0230] The following will be combined Figure 4 The training method of the product recommendation model provided in this embodiment is further described. Figure 4 As shown, the method includes:
[0231] Step S4001: Obtain an original first sample set for training a product recommendation model.
[0232] The first sample set includes multiple original samples, and each original sample includes multiple selected features and labels.
[0233] Step S4002: For the original samples collected in each set time period, the average value of each selected feature in the corresponding set time period is calculated.
[0234] Step S4003: For each selected feature, determine the number of extreme value points of the average value according to the order of the preset time periods.
[0235] Step S4004: sort the selected features in descending order according to the number of extreme value points, and obtain the first sorting order on each selected feature.
[0236] Step S4005 : Selecting selected features whose first sorting order conforms to a preset first sorting range as time series features.
[0237] Step S4006: construct a third sample set using the selected time series features and corresponding labels.
[0238] Step S4007: For each sample identifier, according to the third sample corresponding to the sample identifier, using the undetermined parameters of the recurrent neural network algorithm as variables, determine an expression corresponding to the sample identifier.
[0239] Each sample identifier can be used as a target sample identifier in turn, and an expression of the target sample identifier can be determined based on the third sample corresponding to the target sample identifier and with the undetermined parameters of the recurrent neural network algorithm as variables.
[0240] Specifically, for a target sample identifier, there are third samples corresponding to multiple set time periods. The expression of the target sample identifier can be expressed as:
[0241]
[0242]
[0243] Among them, w i 、w h 、w o All parameters are pending. Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected period for the target sample, The value of the hidden layer node of the third sample collected within the τ-1th set period is identified as the target sample, y τ Identify the target sample with a label corresponding to the third sample collected within the τth set time period.
[0244] Step S4008, solving the expression of each sample identifier, determining the undetermined parameters of the recurrent neural network algorithm, and obtaining the recurrent neural network.
[0245] Step S4009: Obtain the value of each third sample in the hidden layer of the recurrent neural network as the feature value of the processing feature corresponding to the third sample.
[0246] In one embodiment, each sample identifier may be used as a target sample identifier in turn, and the value of each third sample of the target sample identifier in the hidden layer of the neural network may be obtained by the following formula:
[0247]
[0248] Among them, w i 、w o are the parameters of the solved recurrent neural network, Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected period for the target sample, Identify the value of the hidden layer node of the third sample collected within the τ-1th set time period for the target sample.
[0249] For the target sample identifier, the value of the hidden layer node of the third sample collected within the first set period Need to be based on To calculate, It can be an initial value set in advance according to the application scenario or specific requirements, for example, it can be 0. Can be the same or different.
[0250] In one example, the hidden layer value can be a vector, and the number of rows in the vector can be the number of nodes in the hidden layer. The number of nodes in the hidden layer can be pre-set based on the application scenario or specific requirements. The number of nodes in the hidden layer is equal to the number of processing features. For example, the number of nodes in the hidden layer can be K. The hidden layer value can then be a K-dimensional vector. The value of each row in the K-dimensional vector represents the feature value of a processing feature corresponding to the third sample.
[0251] For example, the K-dimensional vector corresponding to the third sample is Then, A1 represents the characteristic value of the first processing feature of the third sample, A2 represents the characteristic value of the second processing feature of the third sample, A3 represents the characteristic value of the third processing feature of the third sample, and A4 represents the characteristic value of the fourth processing feature of the third sample.
[0252] Step S4010: constructing a second sample set, wherein each second sample in the second sample set includes a plurality of selected features, at least one processing feature, and a label.
[0253] Step S4011: Based on the second sample set, a predetermined machine learning algorithm is used to train a product recommendation model.
[0254] Step S4012: Obtain the feature value of the selected feature of at least one preset candidate product corresponding to the target user to be recommended.
[0255] Step S4013 , obtaining a feature value of a processing feature corresponding to each candidate commodity of the target user based on the feature value of the temporal feature corresponding to each candidate commodity of the target user.
[0256] Step S4014 , based on the product recommendation model, obtain the recommendation score corresponding to the candidate product and the target user according to the feature value of the selected feature and the feature value of the processing feature of each candidate product of the target user.
[0257] Step S4015 : Select candidate products whose recommendation scores meet the preset recommendation conditions and recommend them to the target user as target products.
[0258] <Device Example>
[0259] In this embodiment, a training device 5000 for a product recommendation model is provided. Figure 5As shown, it includes a first sample acquisition module 5100, a time series feature selection module 5200, a time series feature processing module 5300, a second sample construction module 5400, and a recommendation model training module 5500. The first sample acquisition module 5100 is used to obtain an original first sample set for training a product recommendation model, wherein each original sample in the first sample set includes multiple selected features and labels; the time series feature selection module 5200 is used to select features whose time series characteristics meet preset conditions from the multiple selected features as time series features; the time series feature processing module 5300 is used to process the selected time series features to obtain at least one processed feature; the second sample construction module 5400 is used to construct a second sample set, wherein each second sample in the second sample set includes multiple selected features, at least one processed feature, and a label; and the recommendation model training module 5500 is used to train a product recommendation model based on the second sample set using a predetermined machine learning algorithm.
[0260] In one embodiment, the timing feature processing module 5300 may also be used to:
[0261] Constructing a third sample set using the selected time series features and corresponding labels;
[0262] A recurrent neural network is trained based on the third sample set; and a value of each third sample in a hidden layer of the neural network is obtained as a feature value of a processing feature corresponding to the third sample.
[0263] In one embodiment, the time series feature selection module 5200 may also be used to:
[0264] For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period;
[0265] For each selected feature, determine the number of extreme value points of the average value in the order of the set time periods;
[0266] The selected feature whose number of extreme value points meets the preset first screening condition is selected as the time series feature.
[0267] In one embodiment, the selected features whose number of extreme value points meets the preset first screening condition are selected as time series features, including:
[0268] Sort the selected features in descending order according to the number of extreme points and obtain the first sort order on each selected feature;
[0269] Selected features whose first sorting order conforms to a preset first sorting range are selected as time series features.
[0270] In one embodiment, the time series feature selection module 5200 may also be used to:
[0271] For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period;
[0272] Determine how much the mean value of each selected characteristic changes over a set number of time periods;
[0273] The selected features whose change amplitude meets the preset second screening condition are selected as the time series features.
[0274] In one embodiment, determining the variation of the average value of each selected feature within a plurality of set time periods includes:
[0275] For each selected feature, determine the extreme points of the mean value in the order of the set time periods;
[0276] For each selected feature, determine the absolute value of the increase or decrease between adjacent extreme points;
[0277] Determine the average of the absolute values of the increase and decrease of each selected feature as the change amplitude of the corresponding selected feature.
[0278] In one embodiment, the selected features whose variation amplitude meets the preset second screening condition are selected as the time series features, including:
[0279] Sort the selected features in descending order according to the magnitude of change, and obtain a second sort order for each selected feature;
[0280] Selected features whose second sorting order conforms to a preset second sorting range are selected as time series features.
[0281] In one embodiment, the machine learning algorithm is a random forest algorithm.
[0282] In one embodiment, each third sample has a corresponding sample identifier;
[0283] Training a recurrent neural network based on the third sample set includes:
[0284] For each sample identifier, according to the third sample corresponding to the sample identifier, using the undetermined parameters of the recurrent neural network algorithm as variables, determine an expression corresponding to the sample identifier;
[0285] Solve the expression of each sample identification, determine the undetermined parameters of the recurrent neural network algorithm, and obtain the recurrent neural network.
[0286] In one embodiment, each sample identifier is used as the target sample identifier in turn.
[0287] The expression of target sample identification is expressed as:
[0288]
[0289]
[0290] Among them, w i 、w h 、w o All parameters are pending. Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected period for the target sample, The value of the hidden layer node of the third sample collected within the τ-1th set period is identified as the target sample, y τ Identify the target sample with a label corresponding to the third sample collected within the τth set time period.
[0291] In one embodiment, the apparatus 5000 may further include: Figure 6 The feature value acquisition module 6100, recommendation score acquisition module 6200, and product recommendation module 6300 are shown. The feature value acquisition module 6100 is used to obtain the feature value of the selected feature of at least one preset candidate product corresponding to the target user to be recommended; the recommendation score acquisition module 6200 is used to obtain the recommendation score of each candidate product and the target user based on the feature value of the selected feature of each candidate product corresponding to the target user based on the product recommendation model; the product recommendation module 6300 is used to select the candidate products whose recommendation scores meet the preset recommendation conditions and recommend them as target products to the target user.
[0292] In one embodiment, the recommendation score acquisition module 6200 may also be used to:
[0293] Obtaining the feature value of the processing feature of the target user corresponding to each candidate product based on the feature value of the time series feature of the target user corresponding to each candidate product;
[0294] Based on the product recommendation model, the recommendation score corresponding to the candidate product and the target user is obtained according to the feature value of the selected feature of the target user corresponding to each candidate product and the feature value of the processing feature.
[0295] In one embodiment, the product recommendation module 6300 may also be used to:
[0296] Sort candidate products in descending order according to recommendation scores, and obtain the ranking order of each candidate product;
[0297] The candidate products whose sorting order meets the preset third sorting range are selected and recommended to the target user as target products.
[0298] In one embodiment, the apparatus 5000 may further include:
[0299] A module used to display each candidate product and the ranking order of each candidate product.
[0300] Those skilled in the art should understand that the training device 5000 for the product recommendation model can be implemented in various ways. For example, the training device 5000 for the product recommendation model can be implemented by configuring the processor with instructions. For example, the instructions can be stored in a ROM, and when the device is started, the instructions are read from the ROM into a programmable device to implement the training device 5000 for the product recommendation model. For example, the training device 5000 for the product recommendation model can be solidified into a dedicated device (such as an ASIC). The training device 5000 for the product recommendation model can be divided into independent units, or they can be combined together for implementation. The training device 5000 for the product recommendation model can be implemented by one of the various implementation methods described above, or can be implemented by a combination of two or more of the various implementation methods described above.
[0301] In this embodiment, the training device 5000 for the product recommendation model can have multiple implementation forms. For example, the training device 5000 for the product recommendation model can be a functional module running in any software product or application that provides product recommendation services, or it can be an embedded peripheral, plug-in, patch, etc. of these software products or applications, or it can be these software products or applications themselves.
[0302] <Electronic equipment>
[0303] In this embodiment, an electronic device 7000 is also provided. The electronic device 7000 may be Figure 1 The electronic device 1000 is shown.
[0304] In one aspect, the electronic device 7000 may include the aforementioned product recommendation model training device 8000, for implementing the product recommendation model training method of any embodiment of the present invention.
[0305] On the other hand, Figure 7 As shown, the electronic device 7000 may further include a processor 7100 and a memory 7200, wherein the memory 7200 is used to store executable instructions; the processor 7100 is used to control the operation of the electronic device 7000 to execute the training method of the product recommendation model according to any embodiment of the present invention under the control of the instructions.
[0306] In this embodiment, the electronic device 7000 can be a mobile phone, a tablet computer, a PDA, a desktop computer, a laptop computer, a workstation, a game console, or other device.
[0307] <Computer-readable storage medium>
[0308] In this embodiment, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the training method of the product recommendation model as described in any embodiment of the present invention.
[0309] The present invention may be a device, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0310] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
[0311] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0312] The computer program instructions for performing the operation of the present invention can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The computer readable program instructions can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), is personalized by utilizing the state information of the computer readable program instructions, and the electronic circuit can execute the computer readable program instructions, thereby realizing various aspects of the present invention.
[0313] Various aspects of the present invention are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.
[0314] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0315] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0316] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of an instruction, and the module, program segment or part of the instruction contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.
[0317] While various embodiments of the present invention have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technological improvements in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.
Claims
1. A method for training a product recommendation model, comprising: Obtaining an original first sample set for training a product recommendation model, wherein each original sample in the first sample set includes a plurality of selected features and a label; wherein the label of the original sample indicates whether the corresponding user performed a corresponding operation on the corresponding product when the original sample was generated, the operation including purchase, browsing, or collection; Selecting a feature whose timing characteristics meet a preset condition from the plurality of selected features as a timing feature; Processing the selected time series features to obtain at least one processed feature; constructing a second sample set, wherein each second sample in the second sample set includes the plurality of selected features, the at least one processing feature, and the label; Based on the second sample set, a predetermined machine learning algorithm is used to train a product recommendation model; The step of processing the selected time series features to obtain at least one processing feature includes: Constructing a third sample set using the selected time series features and corresponding labels; A recurrent neural network is trained based on the third sample set; and a value of each third sample in a hidden layer of the neural network is obtained as a feature value of a processing feature corresponding to the third sample.
2. The method according to claim 1, wherein The step of selecting a feature whose timing characteristics meet a preset condition from the plurality of selected features as the timing feature comprises: For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period; For each selected feature, determine the number of extreme value points of the average value in the order of the set time periods; A selected feature whose number of extreme value points meets a preset first screening condition is selected as the time series feature.
3. The method according to claim 2, wherein: The step of selecting a feature whose number of extreme value points meets a preset first screening condition as the time series feature includes: Sorting the selected features in descending order according to the number of extreme value points, and obtaining a first sorting order on each selected feature; Selected features whose first sorting order conforms to a preset first sorting range are selected as the time series features.
4. The method according to claim 1, wherein The step of selecting a feature whose timing characteristics meet a preset condition from the plurality of selected features as the timing feature comprises: For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period; Determine how much the mean value of each selected characteristic changes over a set number of time periods; The selected feature whose variation range meets the preset second screening condition is selected as the time series feature.
5. The method according to claim 4, wherein The step of determining the variation of the average value of each selected feature within a plurality of set time periods comprises: For each selected feature, determine the extreme points of the mean value in the order of the set time periods; For each selected feature, determine the absolute value of the increase or decrease between adjacent extreme points; Determine the average of the absolute values of the increase and decrease of each selected feature as the change amplitude of the corresponding selected feature.
6. The method according to claim 4, wherein: The step of selecting the selected feature whose variation amplitude meets the preset second screening condition as the time series feature includes: Sorting the selected features in descending order according to the magnitude of the change, and obtaining a second sort order for each selected feature; Selected features whose second sorting order conforms to a preset second sorting range are selected as the time series features.
7. The method according to claim 1, wherein The machine learning algorithm is a random forest algorithm.
8. The method according to claim 1, wherein Each third sample has a corresponding sample identifier; The step of training a recurrent neural network based on the third sample set includes: For each sample identifier, according to the third sample corresponding to the sample identifier, using the undetermined parameters of the recurrent neural network algorithm as variables, determining an expression corresponding to the sample identifier; Solve the expression of each sample identifier, determine the undetermined parameters of the recurrent neural network algorithm, and obtain the recurrent neural network.
9. The method according to claim 8, wherein Each sample ID is used as the target sample ID in turn. The target sample identification expression is expressed as: in, 、 、 All parameters are pending. Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected time period for the target sample, Identify the value of the hidden layer node of the third sample collected within the τ-1th set time period for the target sample, A label corresponding to the third sample collected within the τth set time period is identified for the target sample.
10. The method according to any one of claims 1 to 9, wherein The method further comprises: Obtaining a feature value of a selected feature corresponding to at least one preset candidate product for a target user to be recommended; Based on the product recommendation model, obtaining a recommendation score for each candidate product and the target user according to the feature value of the selected feature of the target user corresponding to each candidate product; The candidate products whose recommendation scores meet the preset recommendation conditions are selected and recommended to the target user as target products.
11. The method according to claim 10, wherein: The step of obtaining a recommendation score for each candidate product and the target user based on the product recommendation model and the feature value of the selected feature of each candidate product by the target user includes: Obtaining a feature value of a processing feature of each candidate product corresponding to the target user based on the feature value of the time series feature of each candidate product corresponding to the target user; Based on the product recommendation model, recommendation scores corresponding to the candidate products and the target user are obtained according to the feature values of the selected features and the feature values of the processing features of each candidate product of the target user.
12. The method according to claim 10, wherein: The step of selecting the candidate product whose recommendation score meets the preset recommendation condition and recommending it to the target user as the target product includes: Sort the candidate products in descending order according to the recommendation score, and obtain the sorting order of each candidate product; The candidate commodities whose sorting order meets the preset third sorting range are selected and recommended to the target user as target commodities.
13. The method according to claim 12, wherein: The method further comprises: Each candidate product and the ranking order of each candidate product are displayed.
14. A training device for a product recommendation model, comprising: A first sample acquisition module is configured to acquire an original first sample set for training a product recommendation model, wherein each original sample in the first sample set includes a plurality of selected features and a label; wherein the label of the original sample indicates whether the corresponding user performed a corresponding operation on the corresponding product when the original sample was generated, wherein the operation includes purchase, browsing, or collection; A time series feature selection module, configured to select a feature whose time series characteristic meets a preset condition from the plurality of selected features as a time series feature; a time series feature processing module, configured to process the selected time series feature to obtain at least one processing feature; A second sample construction module, configured to construct a second sample set, wherein each second sample in the second sample set includes the plurality of selected features, the at least one processing feature, and the label; A recommendation model training module, configured to train a product recommendation model based on the second sample set using a predetermined machine learning algorithm; The timing feature processing module is also used for: Constructing a third sample set using the selected time series features and corresponding labels; A recurrent neural network is trained based on the third sample set; and a value of each third sample in a hidden layer of the neural network is obtained as a feature value of a processing feature corresponding to the third sample.
15. The device according to claim 14, wherein The temporal feature selection module is further used for: For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period; For each selected feature, determine the number of extreme value points of the average value in the order of the set time periods; A selected feature whose number of extreme value points meets a preset first screening condition is selected as the time series feature.
16. The device according to claim 15, wherein The selected feature whose number of extreme value points meets the preset first screening condition as the time series feature includes: Sorting the selected features in descending order according to the number of extreme value points, and obtaining a first sorting order on each selected feature; Selected features whose first sorting order conforms to a preset first sorting range are selected as the time series features.
17. The device according to claim 14, wherein The temporal feature selection module is further used for: For the original samples collected within each set period, calculate the average value of each selected feature within the corresponding set period; Determine how much the mean value of each selected characteristic changes over a set number of time periods; The selected feature whose variation range meets the preset second screening condition is selected as the time series feature.
18. The device according to claim 17, wherein Determining the variation range of the average value of each selected feature within a plurality of set time periods includes: For each selected feature, determine the extreme points of the mean value in the order of the set time periods; For each selected feature, determine the absolute value of the increase or decrease between adjacent extreme points; Determine the average of the absolute values of the increase and decrease of each selected feature as the change amplitude of the corresponding selected feature.
19. The device according to claim 17, wherein The selected features whose change amplitude meets the preset second screening condition as the time series features include: Sorting the selected features in descending order according to the magnitude of the change, and obtaining a second sort order for each selected feature; Selected features whose second sorting order conforms to a preset second sorting range are selected as the time series features.
20. The apparatus according to claim 14, wherein The machine learning algorithm is a random forest algorithm.
21. The apparatus according to claim 14, wherein Each third sample has a corresponding sample identifier; The training of the recurrent neural network based on the third sample set includes: For each sample identifier, according to the third sample corresponding to the sample identifier, using the undetermined parameters of the recurrent neural network algorithm as variables, determining an expression corresponding to the sample identifier; Solve the expression of each sample identifier, determine the undetermined parameters of the recurrent neural network algorithm, and obtain the recurrent neural network.
22. The device according to claim 21, wherein Each sample ID is used as the target sample ID in turn. The target sample identification expression is expressed as: in, 、 、 All parameters are pending. Identify the characteristic value of the time series characteristic of the third sample collected within the τth set time period for the target sample, Identify the value of the hidden layer node of the third sample collected in the τth selected time period for the target sample, Identify the value of the hidden layer node of the third sample collected within the τ-1th set time period for the target sample, A label corresponding to the third sample collected within the τth set time period is identified for the target sample.
23. The device according to any one of claims 14 to 22, wherein: The device further comprises: A feature value acquisition module is used to obtain a feature value of a selected feature corresponding to at least one preset candidate product to be recommended to a target user; a recommendation score acquisition module, configured to acquire, based on the product recommendation model, a recommendation score for each candidate product and the target user according to the feature value of the selected feature of the target user corresponding to each candidate product; The product recommendation module is used to select candidate products whose recommendation scores meet preset recommendation conditions and recommend them to the target user as target products.
24. The device according to claim 23, wherein The recommendation score acquisition module is further used for: Obtaining a feature value of a processing feature of each candidate product corresponding to the target user based on the feature value of the time series feature of each candidate product corresponding to the target user; Based on the product recommendation model, recommendation scores corresponding to the candidate products and the target user are obtained according to the feature values of the selected features and the feature values of the processing features of each candidate product of the target user.
25. The apparatus according to claim 23, wherein The product recommendation module is also used to: Sort the candidate products in descending order according to the recommendation score, and obtain the sorting order of each candidate product; The candidate commodities whose sorting order meets the preset third sorting range are selected and recommended to the target user as target commodities.
26. The device according to claim 25, wherein The device further comprises: A module for displaying each candidate product and the ranking order of each candidate product.
27. An electronic device comprising: The device according to any one of claims 14 to 26; or, A processor and a memory, wherein the memory is used to store instructions, and the instructions are used to control the processor to execute the method according to any one of claims 1 to 13.
28. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 13 when executed by a processor.
Citation Information
Patent Citations
Personalized commodity recommendation method and personalized commodity recommendation system
CN108629665A