User classification method, apparatus, device, and medium
By acquiring historical data on users' order volume and using a pre-trained user classification model, feature information reflecting the order placement cycle is extracted. The model is then trained using a CNN-LSTM spatiotemporal network and a machine learning model, solving the problem of inaccurate identification of users' order placement cycles in existing technologies and achieving accurate classification of users who place orders periodically.
Patent Information
- Application Number
- CN202210671014.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2042-06-14
AI Technical Summary
Existing technology has difficulty in accurately identifying the periodicity of a user's order placement, leading to the misidentification of users who place orders periodically and making accurate classification impossible.
By acquiring users' historical order volume data, and using a pre-trained user classification model, feature information reflecting the order cycle is extracted, including first-cycle feature information and second-cycle feature information. The CNN-LSTM spatiotemporal network is used for feature extraction, and LR, GBDT, and SVM models are combined for training to identify users' order cycles.
Accurately identifying users' order cycles solves the problem of users being misidentified, and improves the accuracy and fit of classification.
Smart Images

Figure CN117290616B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a user classification method and device, equipment and a medium. BACKGROUND
[0002] With the wide application of artificial intelligence technology, the change rule of user historical single quantity is usually described by using last week, last month, last year today and the same ring ratio, so as to identify potential users.
[0003] In the process of implementing the present application, the inventors found that at least the following technical problems exist in the related art: For users with strong seasonal order issuing, for example, almost only in a specific one or two months of each year, the order quantity is almost zero in the remaining months. If the above-mentioned technology is used to extract features, it will lead to the user being identified as high potential if the extraction is done during the high-frequency order issuing period, and if the extraction is done during the period with less order quantity, it will lead to the user being identified as a loss. Therefore, the features extracted in the related art cannot well describe the user order issuing periodicity, and there is a lack of relevant information that can accurately describe the customer order issuing periodicity, which leads to the misidentification of users belonging to the periodic order issuing type, and the user order issuing period cannot be accurately identified, so that the users with periodic order issuing cannot be accurately classified. SUMMARY
[0004] In a first aspect, embodiments of the present application provide a user classification method, which comprises: obtaining historical data of order quantity of a user; inputting the historical data of order quantity into a pre-trained user classification model to obtain a classification result of the user; the classification result represents an order issuing period to which the order quantity of the user conforms; the user classification model classifies based on feature information reflecting the order issuing period; the feature information at least includes first period feature information and second period feature information; the first period feature information is feature information reflecting the annual order issuing period of the user; and the second period feature information is feature information reflecting an order issuing period shorter than the annual order issuing period.
[0005] According to the embodiments of the present application, the user classification model is trained by the following steps: based on the historical data of order quantity of the user, the first period feature information, the second period feature information and the space-time feature information of the order quantity are determined respectively; and based on the first period feature information, the second period feature information and the space-time feature information of the order quantity, the user classification model is trained.
[0006] According to the embodiment of the present application, the historical order quantity data includes historical order quantity data in at least two years from the current time, the first period characteristic information of the order quantity is determined based on the historical order quantity data of the user, and the first period characteristic information of the order quantity includes: screening the user according to the historical order quantity data of the user in the at least two years to obtain a target user; and determining the first period characteristic information of the order quantity based on the historical order quantity data of the target user in the at least two years.
[0007] According to the embodiment of the present application, the historical order quantity data in each year includes historical order quantity data in 12 consecutive months, the target user is obtained by screening the user according to the historical order quantity data of the user in the at least two years, and the screening includes: calculating the sum of order quantities of the user in a specified month of each year, and eliminating the user whose sum of order quantities in the specified month of any year is less than a preset first threshold value; for each user remaining after the elimination, calculating the ratio of the sum of candidate month order quantities of the user in each year to the total order quantity of the year; wherein the candidate month is a month with a top K order quantity in the specified month of each year of the user in descending order of order quantity, and K is a positive integer; the user whose ratio corresponding to two consecutive years in the at least two years exceeds a preset second threshold value is a reserved user; for each reserved user, the number of months that are the same in the candidate months of different years is a first number, and the reserved user is a target user when the first number exceeds a preset third threshold value.
[0008] According to the embodiment of the present application, the first period characteristic information of the order quantity is determined based on the historical order quantity data of the target user in the at least two years, and the determination includes: for each target user, the candidate month of the target user in each year and the first number of the target user are determined based on the historical order quantity data of the target user in the at least two years; and the number of candidate months of the target user in each year, the proportion of the order quantity of the candidate month to the total order quantity of the year, and the first number are determined as the first period characteristic information of the order quantity.
[0009] According to the embodiment of the present application, N consecutive natural days are taken as a slice, N is a positive integer, the historical order quantity data includes historical order quantity data of each day in a plurality of slices from the current time, and the second period characteristic information of the order quantity is determined based on the historical order quantity data of the user, and the determination includes: for each slice, the order quantity of each day in the slice is taken as an order quantity sequence of the slice; for each user, the similarity between the order quantity sequences of any two slices in the plurality of slices is calculated, and the average value of the similarity is taken as the second period characteristic information of the order quantity of the user; and the average value of the similarity of the user is taken as the second period characteristic information of the order quantity.
[0010] According to an embodiment of the present application, before calculating the similarity between the order amount sequences of any two of the plurality of slices for each user, the method further comprises: calculating the sum of the order amount of each day in the slice as the total order amount of the slice; and removing the slice with a total order amount less than the average total order amount of the plurality of slices from the plurality of slices.
[0011] According to an embodiment of the present application, the similarity comprises a Pearson correlation coefficient and a DTW distance, and the calculation of the similarity between the order amount sequences of any two of the plurality of slices and the average of the similarity as the second periodic feature information of the order amount of the user comprises: normalizing the order amount sequences of the plurality of slices; calculating the Pearson correlation coefficient and the DTW distance between the order amount sequences of any two of the plurality of slices; and taking the average of the Pearson correlation coefficient and the average of the DTW distance as the second periodic feature information of the order amount of the user.
[0012] According to an embodiment of the present application, the determination of the spatio-temporal feature information of the order amount based on the order amount history data of the user comprises: inputting the order amount history data of the user into a preset neural network for feature extraction to obtain the spatio-temporal feature information of the order amount.
[0013] According to an embodiment of the present application, the preset neural network comprises a CNN-LSTM spatio-temporal network.
[0014] According to an embodiment of the present application, the user classification model comprises an LR model, a GBDT model and an SVM model.
[0015] In a second aspect, embodiments of the present application provide a user classification device, which comprises: an acquisition module configured to acquire order amount history data of a user; and a classification module configured to input the order amount history data into a pre-trained user classification model to obtain a classification result of the user, wherein the classification result represents an order period to which the order amount of the user conforms, the user classification model classifies based on feature information reflecting the order period, and the feature information at least comprises first periodic feature information and second periodic feature information, the first periodic feature information is feature information reflecting an annual order period of a user, and the second periodic feature information is feature information reflecting an order period shorter than the annual order period of the user.
[0016] In a third aspect, embodiments of the present application provide an electronic device, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus; the memory is configured to store a computer program; and the processor is configured to execute the program stored on the memory to implement the method described above.
[0017] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the method described above.
[0018] The above technical solution provided by the embodiments of the present application has at least part or all of the following advantages compared with the related art: According to the user classification method of the embodiments of the present application, the user classification model based on the characteristic information reflecting the order placing period is used to classify the users, and the order placing amount historical data of the users is used as the input, the characteristic information of the order placing period reflects different order placing periods of the users, so that the order placing period of the users can be accurately identified by the user classification method, and the technical problem that the related art lacks relevant information which can accurately describe the order placing periodicity of the users and is difficult to accurately describe the order placing periodicity of the users is solved, and the users of the periodic order placing type are misidentified, and then the users of the periodic order placing type are accurately classified. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced as follows, and obviously, other drawings can also be obtained by those skilled in the art without any creative labor on the basis of these drawings.
[0021] Figure 1 The system architecture of the user classification method and device suitable for the embodiments of the present application is schematically shown;
[0022] Figure 2 The flowchart of the user classification method according to an embodiment of the present application is schematically shown;
[0023] Figure 3 The detailed implementation flowchart of the step of determining the first period characteristic information of the order placing amount based on the order placing amount historical data of the user in the user classification method according to an embodiment of the present application is schematically shown;
[0024] Figure 4 The detailed implementation flowchart of the operation S301 according to an embodiment of the present application is schematically shown;
[0025] Figure 5 The detailed implementation flowchart of the operation of determining the second period characteristic information of the order placing amount based on the order placing amount historical data of the user in the user classification method according to another embodiment of the present application is schematically shown;
[0026] Figure 6 Fig. 6 schematically shows a detailed implementation flowchart of training a user classification model in a user classification method according to another embodiment of the present application;
[0027] Figure 7 Fig. 5 schematically shows a detailed implementation flowchart of training a user classification model in a user classification method according to an embodiment of the present application;
[0028] Figure 8 Fig. 7 schematically shows a detailed implementation flowchart of training a user classification model in a user classification method according to another embodiment of the present application;
[0029] Figure 9 Fig. 8 schematically shows a detailed implementation flowchart of training a user classification model in a user classification method according to another embodiment of the present application;
[0030] Figure 10 Fig. 3 schematically shows a structural block diagram of a user classification device according to an embodiment of the present application;
[0031] Figure 11 Fig. 9 schematically shows a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0032] In the application of artificial intelligence technology in user classification analysis and other applications in the e-commerce field, the related art usually uses the features of last week, last month, last year today and the same ring to describe the change rule of user historical single quantity, so as to identify potential users. Although the features extracted by the above traditional method can describe the user's historical single quantity to some extent, there is less information related to the user's single periodicity, which may cause a part of the users belonging to the periodic single class to be misidentified in the traditional loss, potential tapping, public opinion and other models.
[0033] For users with strong single seasonality, for example, almost only in a specific one or two months of each year, the single quantity of the remaining months is almost zero. According to the above technology, if the features are extracted during the high-frequency single period, the user will be identified as high potential, and if the single quantity is less in the month, the user will be identified as loss. Some merchants selling seasonal fruits almost only in a specific one or two months of each year, and the single quantity in the remaining months is almost 0. If only according to the existing features, it may be identified as loss by the model. For example, some users who just have a small single quantity in the previous few months, in the month when they reach their high-frequency single period, have a higher single quantity, so they will be identified as high-potential users by the model.
[0034] Therefore, the related information capable of accurately describing the order placing periodicity of a user is lacked in the method of the related art, a user belonging to a periodic order placing type is misidentified, the order placing periodicity of the user cannot be accurately identified, and thus the user of the periodic order placing type cannot be accurately classified.
[0035] Therefore, the related information capable of accurately describing the order placing periodicity of a user is lacked in the method of the related art, a user belonging to a periodic order placing type is misidentified, the order placing periodicity of the user cannot be accurately identified, and thus the user of the periodic order placing type cannot be accurately classified.
[0036] In order to make the objects, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0037] Figure 1 The system architecture suitable for the user classification method and device of the embodiments of the present application is schematically shown.
[0038] Referring to Figure 1 The system architecture 100 suitable for the user classification method and device of the embodiments of the present application includes terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 is used to provide a communication link medium between the terminal devices 101, 102, and 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or optical fiber cables, and the like.
[0039] A user can use the terminal devices 101, 102, and 103 to interact with the server 105 through the network 104 to receive or send messages, and the like. The sent message can be query information, and the received message can be a query result. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, and the like (only as examples), can be installed on the terminal devices 101, 102, and 103.
[0040] The terminal devices 101, 102, and 103 can be various electronic devices such as display screens and support web browsing, for example, electronic devices including but not limited to smart phones, tablet computers, notebook computers, desktop computers, smart watches, and the like.
[0041] The server 105 can be a server providing various services, for example, a background management server (only as an example) providing service support for data processing of a webpage accessed by a user using a terminal device 101, 102, and 103. The background management server can analyze and process received access request data, and feed back the processing result (for example, a webpage, information, or data generated or obtained according to a user request) to the terminal device. Optionally, the server 105 can receive order quantity data sent by a user using a terminal device 101, 102, and 103, and the server 105 can be a cloud server. The server can execute a user classification method, and the server can also feed back a user classification result to the terminal device.
[0042] It should be noted that the execution subject of the user classification method provided by the embodiments of the present application can be a server, a desktop computer, a notebook computer, a smart phone, a tablet computer, and the like, for example, Figure 1 The terminal device or the server in the above can obtain order quantity data from a remote or from a local through a wired or wireless manner. The user classification method provided by the embodiments of the present application can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, and 103 and / or the server 105.
[0043] Correspondingly, the user classification apparatus provided by the embodiments of the present application can be generally arranged in the server 105 or the above terminal device with certain computing capability, and can also be executed by the server and the terminal device in cooperation with each other. Correspondingly, the user classification apparatus provided by the embodiments of the present application can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, and 103 and / or the server 105. Each part (for example, each unit, module) included in the user classification apparatus can be all arranged in the server, all arranged in the terminal device, or arranged in the server and the terminal device respectively.
[0044] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the above is only illustrative. According to the implementation needs, there can be any number of terminal devices, networks, and servers.
[0045] An exemplary embodiment of the present application provides a user classification method.
[0046] Figure 2A flow chart of a user classification method according to an embodiment of the present application is shown schematically;
[0047] Referring to Figure 2 The user classification method provided by the embodiments of the present application includes the following operations: S202, S204. The above-mentioned operations S202-S204 can be executed by a server or a terminal device with certain computing power.
[0048] In operation S202, the order placing amount history data of a user is obtained.
[0049] In operation S204, the order placing amount history data is input into a pre-trained user classification model to obtain a classification result of the user; the classification result represents an order placing period to which the order placing amount of the user conforms; the user classification model classifies based on feature information reflecting the order placing period; the feature information at least includes first period feature information and second period feature information; the first period feature information is feature information reflecting the annual order placing period of a user; and the second period feature information is feature information reflecting an order placing period shorter than the annual order placing period of a user.
[0050] Specifically, the order placing amount history data of a user can include many historical order placing data of users, for example, the historical daily order placing amount (such as transaction amount, order amount, and order quantity data), and the historical order placing information in a specific time period can be extracted and selected according to the required data. The classification result can represent the order placing period to which the order placing amount of a user conforms, and can also be understood as being able to represent whether a user is a periodic user. The pre-trained user classification model can classify based on feature information reflecting the order placing period. The feature information at least includes first period feature information and second period feature information. The above-mentioned first period feature information is feature information reflecting the annual order placing period of a user, and the above-mentioned second period feature information is feature information reflecting an order placing period shorter than the annual order placing period of a user, for example, some users have a shorter order placing period, such as weekly, monthly, and quarterly.
[0051] The above-mentioned first period feature information is feature information reflecting the annual order placing period of a user. Based on the first period feature, it can be determined whether the order placing amount of a user conforms to the rule of an annual period user, so as to determine that the conforming user belongs to the classification of an annual period user. In addition, the above-mentioned second period feature information is feature information reflecting an order placing period shorter than the annual order placing period of a user, for example, some users have a shorter order placing period, such as weekly, monthly, and quarterly. The above-mentioned spatiotemporal feature information can be extracted by a spatiotemporal network, for example, a traditional CNN network can better extract local spatial features, and an LSTM network is suitable for processing time series data and extracting relevant time series features, therefore, a CNN-LSTM network can be used as a spatiotemporal network to extract the two parts of features at the same time.
[0052] Based on the above operation, according to the user classification method of the embodiment of the application, the user classification model based on the characteristic information reflecting the order placing period is used to classify the user by taking the order placing amount history data of the user as the input, and the characteristic information of the order placing period reflects different order placing periods of the user, so that the order placing period of the user can be accurately identified by the user classification method, and the technical problem that the related art lacks relevant information that can accurately describe the order placing periodicity of the user and is difficult to accurately describe the order placing periodicity of the user, so that the user belonging to the periodic order placing type is misidentified is solved, and the user with periodic order placing is accurately classified.
[0053] Another exemplary embodiment of the application provides a user classification method, wherein the user classification model is obtained by training based on the following steps: based on the order placing amount history data of the user, first period characteristic information, second period characteristic information and space-time characteristic information of the order placing amount are determined respectively; and the user classification model is trained based on the first period characteristic information, the second period characteristic information and the space-time characteristic information of the order placing amount.
[0054] Specifically, the user classification model can be one of a LR (Logistic Regression, logistic regression) model, a SVM (Support Vector Machine, support vector machine), a GBDT (Gradient Boosting Decision Tree, gradient boosting iterative decision tree) model and other machine learning models. In some optional embodiments, the GBDT model with the advantages of being interpretable and stable in training can be used.
[0055] Based on the above operation, the user classification model can determine the first period characteristic information, the second period characteristic information and the space-time characteristic information of the order placing amount respectively to reflect the characteristics of different order placing periods, and the user classification model is trained based on the above characteristic information, so that the user classification model can accurately identify the order placing period of the user, effectively avoid the problem that the user belonging to the periodic order placing type is misidentified, and effectively improve the accurate identification of users with different order placing periods, greatly improving the fitting degree and the precision rate.
[0056] Figure 3 An illustrative detailed implementation flowchart of the step of determining the first period characteristic information of the order placing amount based on the order placing amount history data of the user in the user classification method according to an embodiment of the application is shown.
[0057] The historical order amount in each of the years includes a historical order amount of 12 consecutive months, and the historical order amount data includes a historical order amount of at least two years from the current time. The first period characteristic information of the order amount is determined based on the historical order amount data of the user, and can be implemented by operations S301 and S302.
[0058] In operation S301, the user is screened according to the historical order amount of the user in the at least two years, and a target user is obtained.
[0059] In operation S302, the first period characteristic information of the order amount is determined based on the historical order amount of the target user in the at least two years.
[0060] For example, based on the obtained historical order amount data of the user, the order amount data of at least two years from the current time can be determined. The years are relative years. If the current time is September 1, 2021, then two relative years from the current time are: September 1, 2019 to August 31, 2020, and September 1, 2020 to August 31, 2021.
[0061] In combination Figure 3 , in operation S301, the user is screened based on the historical order amount of the user in the at least two years, and a part of the user is filtered out to obtain a target user. In operation S302, the first period characteristic information of the order amount is determined based on the historical order amount of the target user in the at least two years.
[0062] Figure 4 An illustrative detailed implementation flowchart of operation S301 according to an embodiment of the application is shown.
[0063] Referring to Figure 4 , the operation S301 can be implemented by S401, S402, S403 and S404. The historical order amount in each of the years includes a historical order amount of 12 consecutive months.
[0064] In operation S401, the sum of the order amounts of the user in the specified months of each year is calculated, and the user whose sum of the order amounts in the specified months of any year is less than a preset first threshold value is removed from the user.
[0065] In operation S402, for each user remaining after the removal, the ratio of the sum of the order amounts of the candidate months of each year to the total order amount of the year is calculated. The candidate months are selected from the specified months of each year of the user in descending order of the order amount, and the order amount of the first K months is selected, where K is a positive integer.
[0066] In operation S403, the user whose ratio in the above two consecutive years exceeds the preset second threshold value is determined as a reserved user.
[0067] In operation S404, for each reserved user, the number of months with the same month in the candidate months of different years is determined as a first number, and the reserved user is determined as a target user when the first number exceeds a preset third threshold value.
[0068] For example, in the last two years, the historical order amount of the last two years includes the daily and monthly order amount of the last two years, and the order amount of each year includes the historical order amount of the last 12 months. Based on the historical data, the sum of the order amount of the specified month in each year of the user is determined in operation S401, and the user whose sum of the order amount of the specified month in any year is less than a preset first threshold value is removed from the user.
[0069] The specified month of each year can be January, February, March, April, May, July, August, September, October and December, and the months other than the specified month are June and November. The first threshold value can be set according to actual needs, for example, 10, 20, 50, etc. For example, this step can be implemented by counting the monthly order amount data of the user in the last 24 months (the last two years), and removing the user whose monthly order amount in each relative year is less than 10 (the first threshold value) except for June and November (the specified month).
[0070] In some possible embodiments, in combination with the above example, the periodicity of the order user in the year can be that the order amount in June and November is very large, for example, June and November are the big promotion months, and the huge transaction volume makes the order amount of the user increase greatly, while the order in the other 10 months is almost 0. Therefore, the user whose sum of the order amount in the months other than June and November (the specified month) is less than 10 (the first threshold value) can be well screened and removed, and the user who does not meet the order period rule of the year, for example, the user who orders 100 pieces per month, can be removed.
[0071] In operation S402, for each user remaining after the elimination, the sum of candidate monthly order amounts of each year is calculated, and the ratio of the sum of candidate monthly order amounts of each year to the total order amount of the year is calculated. For example, if the 12 consecutive months covered by the year are January to December, and K=3, the operation can be implemented as follows: the top 3 months with the largest order amounts are selected from the specified months (January, February, March, April, May, July, August, September, October, and December) of each year, i.e., the top 3 order months. For example, if the top 3 order months are January, February, and March, and the top 3 order amounts are 3, 2, and 1, respectively, the four months with the top 3 order amounts are January, February, March, and April. Then, the ratio of the monthly order amount of each of January, February, March, and April to the total order amount of the year is calculated, and the total order amount of the year is the sum of the order amounts of January to December.
[0072] Alternatively, the operation can also be implemented as follows: the top 3 order months with non-zero order amounts are selected from the specified months (January, February, March, April, May, July, August, September, October, and December) of each year, i.e., the top 3 order months. For example, if the top 3 order months are January, February, and March, and the order amounts of April, May, July, August, September, October, and December are all 0, and K=2, the top 2 order months are selected as the candidate months. Then, the ratio of the monthly order amount of each of January and February to the total order amount of the year is calculated.
[0073] In operation S403, for each user, if the ratio of the sum of candidate monthly order amounts of each year to the total order amount of the year exceeds a preset second threshold in two consecutive years, the user is selected as a reserved user. For example, the second threshold is a ratio, which can be 90%, 80%, etc. For example, if the ratio of each year exceeds 90% (the second threshold) in two consecutive years, e.g., 92% and 95%, respectively, the user is selected as a reserved user.
[0074] In operation S404, for each reserved user, the number of months with the same month in different years is calculated as a first number, and if the first number exceeds a preset third threshold, the reserved user is selected as a target user. Alternatively, the third threshold can be flexibly adjusted and set according to requirements, e.g., the third threshold is 2, 3, 4, etc.
[0075] For example, assuming that the current time is September 1, 2021, the two relative years are: year one (September 1, 2019 to August 31, 2020), and year two (September 1, 2020 to August 31, 2021). The reserved months of year one are February, March, April, and May of 2021, and the reserved months of year two are November of 2020 and February, March, and May of 2021. Taking the third threshold value of 2 as an example, the reserved months of year one and year two include the three same months of February, March, and May of 2021, so the first number is 3, which exceeds the second threshold value, and the reserved user is taken as a target user.
[0076] Based on the above operation, the user is filtered and screened through a series of operations to determine the target user, so as to accurately screen the user belonging to the annual cycle order type. In the operation S401, the sum of the order quantity of the user in each annual designated month is calculated, and the months other than the designated months are not included, which realizes the elimination of special months (for example, in actual application, it can be set as a big promotion month), so that the data is more reasonable, thereby aligning the data of users sensitive to special months and not sensitive to special months.
[0077] Optionally, based on the historical order quantity of the target user in the at least two years, the first period characteristic information of the order quantity is determined, including the following operations: for each target user, based on the historical order quantity of the target user in the at least two years, determining the candidate months of the target user in each year and the first number of the target user; the number of candidate months of the target user in each year, the proportion of the order quantity of the candidate months in the total order quantity of the corresponding year, and the first number are determined as the first period characteristic information of the order quantity.
[0078] For example, after obtaining the target user through operations S401-S404, the first period characteristic information of the order quantity can be determined, that is, the characteristics reflecting the user annual cycle are output. Taking K=3 as an example, the candidate months of each year (the number of top 3 order quantity months in the past year, the number of top 3 order quantity months in the previous year), the first number (the number of top 3 order quantity corresponding months in the two years), and the proportion of the order quantity of the candidate months in the total order quantity of the corresponding year (the proportion of the top 3 months in the total order quantity of the corresponding year in the past two years, 3 ratios are output each year, a total of 6) are determined as the first period characteristic information of the order quantity.
[0079] Based on the above operation, in the user classification method according to the embodiment of the application, the first periodic characteristic information of the order quantity can be determined based on the order quantity history data of the user, and the user classification model is trained based on the above characteristic information, so that the user classification method can accurately identify the order period of the user, and solve the technical problem that the related art lacks relevant information that can accurately describe the order periodicity of the customer, and it is difficult to well describe the order periodicity of the user, so that the user belonging to the periodic order type is misidentified, and then the periodic order user is accurately classified. By changing the traditional rule of calculating per year to a monthly sliding window, it can be implemented to iterate monthly, and calculate whether the user order quantity in at least the last 24 months (two relative years) meets the annual periodic user rule, and the annual order periodic user is accurately identified. For example, for a user with strong order seasonality, he almost only orders in a specific month or two each year, and the order quantity in the remaining months is almost zero. The first periodic characteristic information can well describe the annual order period of the user, so that the user classification model can accurately identify the annual order user, and greatly improve the fitting degree and the accurate call rate.
[0080] Figure 5 A detailed implementation flowchart of the operation of determining the second periodic characteristic information of the order quantity based on the order quantity history data of the user in the user classification method according to another embodiment of the application is schematically shown. Among them, the continuous N natural days are taken as a slice, N is a positive integer, the order quantity history data includes the historical order quantity of each day in multiple slices from the current time, and the operation of determining the second periodic characteristic information of the order quantity based on the order quantity history data of the user can be implemented to include operations S501, S502 and S503.
[0081] In operation S501, for each slice, the order quantity of each day in the slice is taken as the order quantity sequence of the slice;
[0082] In operation S502, for each user, the similarity between the order quantity sequences of any two slices in the above multiple slices is calculated, and the average value of the similarity is taken as the second periodic characteristic information of the order quantity of the user.
[0083] In operation S503, the average value of the similarity of the user is taken as the second periodic characteristic information of the order quantity.
[0084] For example, based on the obtained historical data of the user's order placing amount, the historical order placing amount of each day within a plurality of slices from the current time can be determined, N can be a positive integer, for example, 91 days, 182 days, etc. Taking N = 91 and four slices as an example, based on the order placing data of the four 91-day slices from the current time, by operation S501, the order amount sequence of the four slices can be determined, for example, the order amount sequence of one of the slices can be S1 = [D1, D2,..., D91], Di represents the value of the order amount of the i-th day, i = 1, 2,..., 91, so that the order amount sequences S1, S2, S3 and S4 of the four slices can be obtained. By operation S502, the similarity between the two slices is calculated, and by S503, the average value of the similarities is taken as the second period feature information of the order placing amount.
[0085] Optionally, the similarity can include a Pearson correlation coefficient and a DTW distance. The Pearson correlation coefficient can measure how two time series change together over time, and can represent the linear relationship between them with numbers -1 (negative correlation), 0 (no correlation) and 1 (complete correlation). In addition, the DTW distance, i.e. Dynamic Time Warping, can calculate the minimum distance that can match two time series by calculating the Euclidean distance of each point in the time series to all other points.
[0086] Taking the above example as an example, each slice is 91 days, and four slices are 364 days, which is approximately the length of a natural year. The order amount sequence of the 91-day slice can be calculated and averaged to reflect the periodicity of the user's order placing within the past year. At the same time, 91 is a multiple of 7, and the sum of the number of days in a quarter is usually 91, so a slice can also be approximately a quarter, so calculating in this way is equivalent to taking 4 91-day sliding calculations, and it can also identify multiple order placing periods, such as quarterly, monthly, etc. Shorter order placing periods than annual order placing periods. For example, if a user is a quarterly order placing user, based on the similarity between the four quarters, such as the order amount being large in the first month and the order amount being small in the remaining two months in each quarter, the user's order placing period feature can be identified.
[0087] Figure 6 A detailed implementation flowchart of training a user classification model in a user classification method according to another embodiment of the application is schematically shown.
[0088] The above similarity includes a Pearson correlation coefficient and a DTW distance, and before operation S502, the following operations S601 and S602 can also be included.
[0089] In operation S601, the sum of the order amounts of each day in the slice is calculated as the total order amount of the slice.
[0090] In operation S602, the slice whose total order amount is less than the average of the total order amounts of the plurality of slices is removed from the plurality of slices.
[0091] Through operations S601-S602, the plurality of slices of the user are screened, the sum of the order amounts of each 91-day slice is calculated, and the slice whose total order amount is less than the average of the total order amounts of four periods is removed.
[0092] Optionally, based on the four order amount sequences S1, S2, S3, and S4 obtained in the foregoing example, the similarity includes a Pearson correlation coefficient and a DTW distance.
[0093] Operation S502 can also be implemented to include operations S603, S604, and S605.
[0094] In operation S603, the order amount sequences of the plurality of slices are normalized.
[0095] In operation S604, the Pearson correlation coefficient and the DTW distance between the order amount sequences of any two slices in the plurality of slices are calculated.
[0096] In operation S605, the average of the Pearson correlation coefficients and the average of the DTW distances are taken as the second period feature information of the order amount of the user.
[0097] For example, in the slices remaining after being screened through operations S601-S602, the order amount sequences of each slice are normalized, and then the Pearson correlation coefficient and the DTW distance between any two sequences are calculated. For the current time, the Pearson correlation coefficient and the DTW distance between any two sequences can be obtained by taking a plurality of slices forward. For each natural day of each user, taking a certain day as a reference as the current time, a plurality of slices can be taken from the history before the day, and the Pearson correlation coefficient and the DTW distance between any two sequences can also be obtained. Therefore, if a certain day of each user is taken as the current time, the Pearson correlation coefficient and the DTW distance and the average of the two parameters can be calculated through the foregoing operations.
[0098] In an optional implementation, after the Pearson correlation coefficient and the DTW distance are obtained through operations S601-S605, the second period feature information of the order amount can be determined, that is, the feature reflecting the order period of the user shorter than the annual order period is output. Taking N=91 as an example, the average of the Pearson correlation coefficients and the average of the DTW distances of the removed end slices can be determined as the second period feature information of the order amount.
[0099] Based on the above operation, in the user classification method according to the embodiment of the application, the second periodic characteristic information of the order quantity can be determined based on the order quantity history data of the user, and the user classification model is trained based on the above characteristic information, so that the user classification method can accurately identify the order period of the user, and solve the technical problem that the related art lacks relevant information that can accurately describe the order periodicity of the customer, and it is difficult to well describe the order periodicity of the user, so that the user belonging to the periodic order type is misidentified, and then the periodic order user is accurately classified. The second periodic characteristic information can well describe the order period of the user, which is shorter than the annual order period, such as weekly, monthly, quarterly, etc., so that the user classification model can accurately identify these periodic order users, and greatly improve the fitting degree and the precision rate.
[0100] In an optional embodiment, the above operation of determining the spatio-temporal characteristic information of the order quantity based on the order quantity history data of the user includes: inputting the order quantity history data of the user into a preset neural network for feature extraction to obtain the spatio-temporal characteristic information of the order quantity. Specifically, the above operation can be implemented as: inputting the historical order quantity data of the user into a neural network, and extracting data features using the neural network, extracting time and space features, and adding them to the classification model for training, which can improve the fitting degree and the precision rate of the model.
[0101] Optionally, the above preset neural network includes a CNN-LSTM spatio-temporal network. The traditional CNN network can better extract local spatial features, and the LSTM network is suitable for processing time series data and extracting relevant time series features. Therefore, the CNN-LSTM network can be used as a spatio-temporal network to extract the two features at the same time.
[0102] Optionally, the above user classification model includes an LR model, a GBDT model and an SVM model. For example, the extracted features can be added to the GBDT model for training, so that when the model is used for classification or prediction, different order period users can be accurately identified, and the fitting degree and the precision rate are greatly improved.
[0103] Figure 7 An illustrative detailed implementation flowchart of training a user classification model in a user classification method according to an embodiment of the application is shown.
[0104] In combination Figure 7As shown, the data extraction includes obtaining the historical order amount data of the user, the data slicing includes determining the historical order amount in at least two years, the historical order amount in each of the years includes the historical order amount in 12 consecutive months, and the user with a small order amount is removed, and the candidate months of the remaining users are determined, so as to filter out the user showing the annual cycle rule as the target user (the user meeting the annual cycle rule) based on the foregoing operations S401-S404, and output the first cycle characteristic information of the target user, at least including the number of candidate months of the target user in each year, the proportion of the order amount of the candidate months in the total order amount of the corresponding year, and the first number. In an optional implementation, the information meeting the expected or specified dimension can be selected from the output first cycle characteristic information, so as to be added to the model to classify (predict the classification of) the different order cycles to which the user belongs.
[0105] Figure 8 The detailed implementation flowchart of training the user classification model in the user classification method according to another embodiment of the application is schematically shown.
[0106] In combination Figure 8 As shown, the data extraction includes obtaining the historical order amount data of the user, the data slicing includes determining the historical order amount in at least two years, the historical order amount in each of the years includes the historical order amount in 12 consecutive months, and the user with a small order amount is removed, and the candidate months of the remaining users are determined, so as to filter out the user showing the annual cycle rule as the target user (the user meeting the annual cycle rule) based on the foregoing operations S401-S404, and output the first cycle characteristic information of the target user, at least including the number of candidate months of the target user in each year, the proportion of the order amount of the candidate months in the total order amount of the corresponding year, and the first number. In an optional implementation, the information meeting the expected or specified dimension can be selected from the output first cycle characteristic information, so as to be added to the model to classify (predict the classification of) the different order cycles to which the user belongs.
[0107] Figure 9 The detailed implementation flowchart of training the user classification model in the user classification method according to another embodiment of the application is schematically shown.
[0108] In combination Figure 9 As shown, the data extraction includes obtaining the historical order amount data of the user, the data slicing includes determining the historical order amount in at least two years, the historical order amount in each of the years includes the historical order amount in 12 consecutive months, and the user with a small order amount is removed, and the candidate months of the remaining users are determined, so as to filter out the user showing the annual cycle rule as the target user (the user meeting the annual cycle rule) based on the foregoing operations S401-S404, and output the first cycle characteristic information of the target user, at least including the number of candidate months of the target user in each year, the proportion of the order amount of the candidate months in the total order amount of the corresponding year, and the first number. In an optional implementation, the information meeting the expected or specified dimension can be selected from the output first cycle characteristic information, so as to be added to the model to classify (predict the classification of) the different order cycles to which the user belongs.
[0109] Specifically, by the detailed implementation process of training the user classification model in the user classification method of the above embodiment, the user classification model is trained, and by inputting the obtained user order volume historical data into the model, classification is performed to obtain the period classification to which the user belongs, for example, the user belongs to an annual period user, a quarterly period user, a monthly period user, etc., avoiding misidentification of annual period users as lost users, etc., thereby being able to well describe the order period of the user, accurately identifying the periodic characteristics of the user, and effectively improving the fitting degree and the precision rate of the model.
[0110] In some optional embodiments, the user order volume time sequence can also be decomposed by Fourier transform into a superposition of multiple different period sine sequences as features, and the sequence is analyzed by a statistical method of time series difference, such as periodic analysis, to obtain information such as whether the user is a periodic user and the order period classification of the user.
[0111] The detailed implementation process of training the user classification model in the user classification method of the embodiment combines rule methods (extracting first period feature information), statistical methods (extracting second period feature information), and models (extracting spatiotemporal feature information), extracts features reflecting periodicity from historical order volume data of the user, and adds them to existing loss and potential tapping models to more accurately reflect data information, thereby using the trained model to classify users to obtain accurate order period classification, thereby improving the precision rate of the model.
[0112] Another exemplary embodiment of the application provides a user classification device.
[0113] Figure 10 The structure block diagram of the user classification device according to an embodiment of the application is schematically shown.
[0114] Referring to Figure 10 As shown in the figure, the user classification device 1200 provided by the embodiment of the application includes an acquisition module 1201 and a classification module 1202.
[0115] The acquisition module 1201 is configured to acquire historical order volume data of a user.
[0116] The classification module 1202 is configured to input the order placing amount history data into a pre-trained user classification model to obtain a classification result of the user, wherein the classification result represents an order placing period to which the order placing amount of the user belongs, and the user classification model is based on feature information reflecting the order placing period to classify the user, and the feature information at least includes first period feature information and second period feature information, the first period feature information is feature information reflecting an annual order placing period of the user, and the second period feature information is feature information reflecting an order placing period shorter than the annual order placing period.
[0117] The user classification device provided by the embodiment of the present application classifies the user by using the user classification model based on the feature information reflecting the order placing period and taking the order placing amount history data of the user as the input, and the feature information of the order placing period reflects different order placing periods of the user, so that the order placing period of the user can be accurately identified by using the user classification method, and the technical problem that the related art lacks relevant information capable of accurately describing the order placing periodicity of the user and is difficult to accurately describe the order placing periodicity of the user, so that the user belonging to the periodic order placing type is misidentified is solved, and the user who places orders periodically is accurately classified.
[0118] In the above embodiment, any of the acquisition module 1201 and the classification module 1202 can be combined in one module, or any of the modules can be split into multiple modules. Alternatively, at least part of the function of one or more of the modules can be combined with at least part of the function of the other modules, and implemented in one module. At least one of the acquisition module 1201 and the classification module 1202 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. hardware or firmware, or any one of software, hardware and firmware or a suitable combination of any of them. Alternatively, at least one of the acquisition module 1201 and the classification module 1202 can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is run.
[0119] Another exemplary embodiment of the present application provides an electronic device.
[0120] Figure 11 The structure block diagram of the electronic device provided by the embodiment of the present application is schematically shown.
[0121] Reference Figure 11As shown, the electronic device 1300 provided by the embodiment of the present application comprises a processor 1301, a communication interface 1302, a memory 1303 and a communication bus 1304, wherein the processor 1301, the communication interface 1302 and the memory 1303 complete mutual communication through the communication bus 1304; the memory 1303 is used for storing a computer program; the processor 1301 is used for executing the program stored on the memory to realize the user classification method as described above.
[0122] The eleventh example embodiment of the present application also provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the user classification method as described above.
[0123] The computer readable storage medium can be included in the device / apparatus described in the above embodiments; or can exist separately and not be assembled into the device / apparatus. The computer readable storage medium carries one or more programs, and the one or more programs are executed to realize the user classification method according to the embodiments of the present application.
[0124] According to the embodiments of the present application, the computer readable storage medium can be a non-volatile computer readable storage medium, which can include but is not limited to: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present application, the computer readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in connection with an instruction execution system, apparatus or device.
[0125] In this document, the terms "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations have any such actual relationship or order. Also, the terms "comprises", "comprising", or any other variations thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus including a series of elements includes not only those elements, but also other elements not explicitly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus including the element.
[0126] The foregoing is considered as illustrative only of the principles of the application. Numerous modifications and changes will readily occur to those skilled in the art, and it is intended to embrace all such modifications and changes that fall within the scope of the application. Accordingly, the application is not to be restricted in scope to the specific embodiments disclosed herein but is to be accorded the full scope that the principles and novel features request appropriately granted.
Claims
1. A user classification method, characterized in that, include: Obtain historical data on the number of orders placed by users; Input the historical order volume data into a pre-trained user classification model to obtain the user's classification result; The classification result represents the order placement cycle that the user's order placement volume conforms to. The user classification model classifies based on feature information reflecting the order placement cycle. The feature information includes at least first cycle feature information and second cycle feature information. The first cycle feature information is feature information reflecting the user's annual order placement cycle, and the second cycle feature information is feature information reflecting the user's order placement cycle that is shorter than the annual order placement cycle. The user classification model is trained through the following steps: Based on the historical order volume data of users in the training set, the first-period feature information, the second-period feature information, and the spatiotemporal feature information of the order volume are determined respectively. The user classification model is trained based on the first periodic feature information, the second periodic feature information, and the spatiotemporal feature information of the order volume.
2. The method according to claim 1, characterized in that, The historical order volume data includes historical order volumes within at least two years from the current time. Based on the historical order volume data of users in the training set, the first-period characteristic information of the order volume is determined, including: Based on the historical order volume of users in the training set over the aforementioned at least two years, the users in the training set are filtered to obtain the target users; Based on the target user's historical order volume over the at least two years, the first periodic characteristic information of the order volume is determined.
3. The method according to claim 2, characterized in that, The historical order volume within each said year includes the historical order volume for 12 consecutive months. The step of filtering users in the training set based on their historical order volume over at least two years to obtain target users includes: Calculate the sum of the number of orders placed by users in the training set in a specified month of each year, and remove users from the training set whose sum of the number of orders placed in the specified month of any year is less than a preset first threshold. For each user remaining after elimination, calculate the ratio of the sum of the order volume of the candidate months in each year to the total order volume in that year; wherein, the candidate months are selected from the specified months of each remaining user in each year according to the order volume from largest to smallest, and the months with the highest order volume are K, where K is a positive integer. Users whose ratio exceeds a preset second threshold for two consecutive years out of the at least two years are retained users; For each retained user, the number of months that are the same in different years is taken as the first number. If the first number exceeds a preset third threshold, the retained user is taken as the target user.
4. The method according to claim 2, characterized in that, The determination of the first periodic characteristic information of order volume based on the target user's historical order volume over the at least two years includes: For each target user, based on the target user's historical order volume in the at least two years, determine the candidate months for the target user in each year and the first number of the target user; The number of candidate months for the target user in each year, the proportion of the order volume of the candidate month to the total order volume of the corresponding year, and the first number are determined as the first periodic feature information of the order volume.
5. The method according to claim 1, characterized in that, Taking N consecutive natural days as a slice, where N is a positive integer, the historical order volume data includes the historical order volume for each day within multiple slices from the current time. The second periodic feature information for determining order volume based on the historical order volume data of users in the training set includes: For each slice, the number of orders placed each day within that slice is used as the order quantity sequence for that slice. For each user, the similarity between the single-order sequences of any two slices in the plurality of slices is calculated, and the average similarity is used as the second periodic feature information of the user's order volume; The average similarity of users in the training set is used as the second periodic feature information of the number of orders placed.
6. The method according to claim 5, characterized in that, Before calculating the similarity between univariate sequences of any two slices among the plurality of slices for each user, the method further includes: Calculate the sum of the number of orders placed each day within the slice, and use this sum as the total number of orders placed for the slice; Remove slices from the plurality of slices whose total number of orders is less than the average total number of orders of the plurality of slices.
7. The method according to claim 5, characterized in that, The similarity includes Pearson correlation coefficient and DTW distance. The calculation of the similarity between the single-order sequences of any two slices in the plurality of slices, and using the average similarity as the second periodic feature information of the user's order volume, includes: Normalize the individual sequences of the multiple slices; Calculate the Pearson correlation coefficient and DTW distance between any two univariate sequences in the plurality of slices; The average value of the Pearson correlation coefficient and the average value of the DTW distance are used as the second periodic feature information of the user's order volume.
8. The method according to claim 1, characterized in that, The method for determining the spatiotemporal feature information of order volume based on the historical order volume data of users in the training set includes: The historical order volume data of users in the training set is input into a preset neural network for feature extraction to obtain the spatiotemporal feature information of the order volume.
9. The method according to claim 8, characterized in that, The preset neural network includes a CNN-LSTM spatiotemporal network.
10. The method according to claim 9, characterized in that, The user classification models include the LR model, the GBDT model, and the SVM model.
11. A user classification device, characterized in that, The device includes: The acquisition module is used to acquire historical data on the number of orders placed by users. The classification module is used to input the historical order volume data into a pre-trained user classification model to obtain the classification result of the user. The classification result represents the order volume of the user conforms to the order cycle. The user classification model classifies based on feature information reflecting the order cycle. The feature information includes at least first cycle feature information and second cycle feature information. The first cycle feature information is the feature information reflecting the user's annual order cycle, and the second cycle feature information is the feature information reflecting the user's order cycle that is shorter than the annual order cycle. The user classification model is trained through the following steps: Based on the historical order volume data of users in the training set, the first-period feature information, the second-period feature information, and the spatiotemporal feature information of the order volume are determined respectively. The user classification model is trained based on the first periodic feature information, the second periodic feature information, and the spatiotemporal feature information of the order volume.
12. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method of any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 10.
Citation Information
Patent Citations
User classification model training method and device, user classification method and device
CN111078742A
User identification method, apparatus and device
CN112465546A