A method, device and equipment for precision marketing based on user consumption data
By normalizing consumer data and dividing it using Mahalanobis distance, and combining this with the MAHAKIL algorithm to generate new samples, the problem of classifier bias towards the majority class is solved, enabling accurate identification of minority users and improving marketing precision.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-17
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, classifiers based on imbalanced data tend to favor the majority class in precision marketing, making it difficult to accurately identify minority users.
By acquiring and normalizing consumer data, the dataset is divided into majority and minority classes. The Mahalanobis distance of the minority class samples is calculated, and the samples are sorted and partitioned into subsets. The MAHAKIL algorithm is used to iteratively generate descendant samples to form a new minority class dataset, which is then used to train a classifier with the majority class dataset.
It achieves a balance in the sample size relationship between minority and majority class datasets, improves the classifier's accuracy in identifying minority users, and enhances the precision of marketing.
Smart Images

Figure CN116012072B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and in particular to a precise marketing method, apparatus, and equipment based on user consumption data. Background Technology
[0002] With the continuous advancement of information technology, all aspects of people's lives have gradually become digitized, and every action generates a large amount of data.
[0003] Currently, in the mining of consumer online behavior data, the data is abstracted into user feature "tags". Using tags to form user models, namely "user profiles", can effectively remove redundancy and noise from the data and improve the processing of unstructured and semi-structured data. Accurately outlining "user profiles" is the key to this process.
[0004] In marketing campaigns, high-spending consumers often become the focus of precision marketing. However, this high-spending group is a minority compared to the vast number of users. Therefore, the ratio between ordinary user data and "precision marketing" user data is extremely unbalanced. If we rely solely on traditional classifiers designed based on balanced datasets, they will be biased towards the majority class when dealing with imbalanced data. This will lead to incorrect classification of the minority class, making it difficult to accurately depict the profile of the minority users and affecting marketing effectiveness. Summary of the Invention
[0005] This invention provides a precision marketing method based on user consumption data, which solves the problem in the prior art where classifiers obtained from imbalanced data tend to favor the majority class, making it difficult to accurately identify minority users during precision marketing.
[0006] The first aspect of this invention provides a precision marketing method based on user consumption data, comprising:
[0007] Acquire consumption data and perform normalization processing, then divide the normalized dataset into majority class datasets and minority class datasets;
[0008] Calculate the Mahalanobis distance of each sample in the minority class dataset, sort the samples according to the Mahalanobis distance, and then divide each sample into several subsets;
[0009] The number of iterations for the minority class samples is calculated based on the preset target number of samples, and then the minimum Mahalanobis distance is calculated based on the number of iterations. The MAHAKIL algorithm with added random parameters is used to take samples in different subsets as parent samples, and the offspring samples are generated iteratively. The offspring samples whose Mahalanobis distance with the parent samples is greater than or equal to the minimum Mahalanobis distance are formed into a new minority class dataset.
[0010] Train a user group classifier using a new minority class dataset and a majority class dataset to enable precise marketing to different user groups.
[0011] Optionally, the step of calculating the Mahalanobis distance of each sample in the minority class dataset, sorting the samples according to the Mahalanobis distance, and then dividing each sample into several subsets specifically includes:
[0012] Calculate the Mahalanobis distance between samples in the minority class dataset;
[0013] After sorting the samples according to Mahalanobis distance, the boundary samples are determined.
[0014] The sorted dataset is divided into several subsets based on the location of the partitioned samples.
[0015] Optionally, the calculation model for the preset target number of samples is specifically as follows:
[0016]
[0017] In the formula, len(Datas) k ) represents the target number of samples, len(Datas) max ) represents the number of samples in the majority class, len(Datas) min ) represents the number of minority class samples, and Q represents the expected proportion of the minority class.
[0018] Optionally, the formula for calculating the Mahalanobis distance of each sample in the minority class dataset is as follows:
[0019] M 2 =(xv) t S -1 (xv)
[0020] Where x is a sample in the minority class dataset, M is the Mahalanobis distance of x in the minority class dataset, v is the sample mean of the minority class dataset, S is the covariance matrix, and t is the number of iterations.
[0021] Optionally, the iterative generation of descendant samples includes:
[0022] If the Mahalanobis distance between a descendant sample and one of its parents is less than the minimum Mahalanobis distance during iteration, then the mean or Euclidean distance of the parents is used as the descendant sample for further iteration.
[0023] Optionally, after forming a new minority class dataset from the offspring samples whose Mahalanobis distance to their parents is greater than or equal to the minimum Mahalanobis distance, the method further includes:
[0024] If the number of new samples does not meet the target number of samples, the minority class dataset will be merged into a new minority class dataset as a supplement.
[0025] A second aspect of this application provides a precision marketing device based on user consumption data, comprising:
[0026] The initial dataset partitioning module is used to acquire consumer data and perform normalization processing, dividing the normalized dataset into majority class datasets and minority class datasets;
[0027] The minority class dataset partitioning module is used to calculate the Mahalanobis distance of each sample in the minority class dataset, sort the samples according to the Mahalanobis distance, and then divide each sample into several subsets.
[0028] The minority class dataset balancing module is used to calculate the number of iterations for minority class samples based on the preset target number of samples, and then calculate the minimum Mahalanobis distance based on the number of iterations; the MAHAKIL algorithm with added random parameters is used to take samples in different subsets as parent samples, iteratively generate offspring samples, and form a new minority class dataset by combining offspring samples whose Mahalanobis distance with the parent samples is greater than or equal to the minimum Mahalanobis distance.
[0029] The classifier precision marketing module is used to train a user group classifier with new minority and majority class datasets to conduct precision marketing to different user groups.
[0030] Optionally, in the minority class dataset partitioning module, the Mahalanobis distance of each sample in the minority class dataset is calculated, and the samples are sorted according to the Mahalanobis distance before being divided into several subsets, specifically including:
[0031] Calculate the Mahalanobis distance between samples in the minority class dataset;
[0032] After sorting the samples according to Mahalanobis distance, the boundary samples are determined.
[0033] The sorted dataset is divided into several subsets based on the location of the partitioned samples.
[0034] Optionally, in the minority class dataset balancing module, the preset target sample number calculation model is specifically as follows:
[0035]
[0036] In the formula, len(Datas) k ) represents the target number of samples, len(Datas) max ) represents the number of samples in the majority class, len(Datas) min ) represents the number of minority class samples, and Q represents the expected proportion of the minority class.
[0037] A third aspect of this application provides a precision marketing device based on user consumption data, the device comprising a processor and a memory:
[0038] The memory is used to store program code and transmit the program code to the processor;
[0039] The processor is used to execute the precision marketing method based on user consumption data according to any one of the first aspects of the present invention, according to the instructions in the program code.
[0040] As can be seen from the above technical solutions, the present invention has the following advantages: By acquiring consumer data and performing normalization processing, the normalized dataset is divided into a majority class dataset and a minority class dataset; the Mahalanobis distance of each sample in the minority class dataset is calculated, and the samples are sorted according to the Mahalanobis distance before being divided into several subsets; the number of iterations for the minority class samples is calculated according to the preset target number of samples, and then the minimum Mahalanobis distance is calculated based on the number of iterations; the samples in different subsets are used as parent samples by the MAHAKIL algorithm with added random parameters, and offspring samples are iteratively generated; the offspring samples whose Mahalanobis distance with the parent samples is greater than or equal to the minimum Mahalanobis distance are formed into a new minority class dataset; a user group classifier is trained with the new minority class dataset and the majority class dataset to conduct precise marketing to different user groups; by generating several new samples that meet the Mahalanobis distance requirement in the minority class dataset, the sample quantity relationship between the minority class dataset and the majority class dataset is balanced, and after training the classifier with the two datasets, the classifier can accurately identify minority users and will not be biased towards a certain type of user due to the difference in the number of training datasets, thus improving the accuracy of marketing. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is the first flowchart of a precision marketing approach based on user consumption data;
[0043] Figure 2 The second flowchart for a precision marketing approach based on user consumption data;
[0044] Figure 3 The third flowchart for a precision marketing approach based on user consumption data;
[0045] Figure 4 This is a diagram of a precision marketing device based on user consumption data. Detailed Implementation
[0046] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0047] This invention provides a precision marketing method based on user consumption data, which solves the problem in the prior art where classifiers obtained from imbalanced data tend to favor the majority class, making it difficult to accurately identify minority users during precision marketing.
[0048] Please see Figure 1 , Figure 1 The first flowchart of the precision marketing method based on user consumption data provided in the embodiments of the present invention is shown.
[0049] S100: Acquire consumption data and perform normalization processing, then divide the normalized dataset into majority class datasets and minority class datasets.
[0050] It should be noted that consumer consumption data can be collected and organized from company-related platforms such as Xiaoyi Butler, Group CPCP, Group New Sales Platform, and Baichuan Company's production and sales platform, and then normalized. In the normalized consumption data, it is necessary to identify which samples in a certain category of consumption data are in the minority class. Consumption behavior data includes: price range of goods sold, quantity of goods sold, type of goods sold, etc. Then, the datasets of each consumption data are divided, for example, by dividing the price range of goods sold, resulting in a majority class set for the normal price range and a minority class set for the high price range. Data samples from the minority class of each consumption data set are added to the minority class dataset, and data samples from the majority class of each consumption data set are added to the majority class dataset, ultimately resulting in the majority class dataset and the minority class dataset.
[0051] S200 calculates the Mahalanobis distance of each sample in the minority class dataset, sorts the samples according to the Mahalanobis distance, and then divides each sample into several subsets.
[0052] It should be noted that Mahalanobis distance was proposed by the Indian statistician PC Mahalanobis. It represents the distance between a point and a distribution by taking into account the relationships between various properties, and is scale-independent, independent of the measurement scale.
[0053] After sorting the samples in the minority class dataset by Mahalanobis distance, the minority class dataset is divided into several subsets according to a preset ratio. In actual implementation, the dataset can be divided into two subsets from the middle of the sample sorting with a ratio of 50%. The preset ratio and the number of subsets are set according to actual needs.
[0054] S300: Calculate the number of iterations for minority class samples based on the preset target number of samples, and then calculate the minimum Mahalanobis distance based on the number of iterations; use the MAHAKIL algorithm with added random parameters to take samples in different subsets as parent samples, iteratively generate offspring samples, and form a new minority class dataset by combining offspring samples whose Mahalanobis distance with parent samples is greater than or equal to the minimum Mahalanobis distance.
[0055] It should be noted that the target number of samples in the minority class dataset is preset based on the number of samples in the majority class dataset after balancing. The specific formula for calculating the number of iterations based on this target number of samples is as follows:
[0056]
[0057] Where t is the number of iterations, len(Datas) K () represents the target sample size;
[0058] The distance of the last new sample in the iteration is the minimum Mahalanobis distance min. d The calculation formula is:
[0059]
[0060] In the subsets of the minority class dataset, two subsets are selected alternately to extract data as parent samples. The parent samples are combined using the MAHAKIL algorithm with added random parameters to obtain new samples. The offspring samples obtained in the first iteration are the first new samples. The first new samples are then combined with the parent samples using the MAHAKIL algorithm with added random parameters to obtain the second new samples. At this point, the first new samples are equivalent to the parent samples of the second new samples. After multiple iterations, the samples in the new samples whose Mahalanobis distance with the parent samples is greater than or equal to the minimum Mahalanobis distance are formed into a new minority class dataset. The number of samples in this new minority class dataset is the target number of samples.
[0061] S400 trains a user group classifier using new minority and majority class datasets to enable precise marketing to different user groups.
[0062] It should be noted that when the number of new minority class datasets that meet the target sample size is balanced with that of majority class datasets, the trained user group classifier can accurately classify users based on user data, enabling precise marketing based on user classification.
[0063] In this embodiment, by acquiring and normalizing consumer data, the normalized dataset is divided into a majority class dataset and a minority class dataset. The Mahalanobis distance of each sample in the minority class dataset is calculated, and the samples are sorted according to the Mahalanobis distance before being further divided into subsets. The number of iterations for the minority class samples is calculated based on a preset target number of samples, and then the minimum Mahalanobis distance is calculated using the number of iterations. Using the MAHAKIL algorithm with added random parameters, samples within different subsets are used as parent samples to iteratively generate offspring samples. Offspring samples whose Mahalanobis distance to their parent samples is greater than or equal to the minimum Mahalanobis distance form a new minority class dataset. A user group classifier is trained using the new minority class dataset and the majority class dataset to conduct precise marketing to different user groups. By generating several new samples in the minority class dataset that meet the Mahalanobis distance requirement, the sample quantity relationship between the minority and majority class datasets is balanced. After training the classifier with both datasets, the classifier can accurately identify minority users without bias towards one type of user due to differences in the number of training datasets, thus improving the accuracy of marketing.
[0064] The above is a detailed description of the first embodiment of a precision marketing method based on user consumption data provided in this application. The following is a detailed description of the second embodiment of a precision marketing method based on user consumption data provided in this application.
[0065] This embodiment further provides a specific example of step S200 in a precision marketing method based on user consumption data. Please refer to [link to specific example]. Figure 2 Step S200 specifically includes steps S201-S203, as detailed below:
[0066] S201, calculate the Mahalanobis distance between samples in the minority class dataset;
[0067] It should be noted that the formula for calculating Mahalanobis distance is:
[0068] M 2 =(xv) t S -1 (xv)
[0069] Where x is a sample in the minority class dataset, M is the Mahalanobis distance of x in the minority class dataset, v is the sample mean of the minority class dataset, and S is the covariance matrix.
[0070] The pseudocode expression is:
[0071] for i = 0 → len(Datas min )do
[0072] DataSorts min append(i);
[0073] end.
[0074] S202, determine the boundary samples after sorting the samples according to Mahalanobis distance;
[0075] It should be noted that the samples are sorted according to Mahalanobis distance, and then the boundary samples are determined according to the preset division ratio or the number of subsets. For example, if the preset division ratio is 50% or the samples are divided into 2 subsets, then the samples ranked in the 50% of the total number of samples are selected as the boundary samples.
[0076] S203 divides the sorted dataset into several subsets based on the location of the partitioned samples.
[0077] It should be noted that the dataset is divided into several subsets based on the position of the boundary sample. Different numbers of boundary samples result in different numbers of subsets. This embodiment uses a partitioning method that divides the dataset into two subsets in the middle. Combined with the calculation of Mahalanobis distance, the corresponding pseudocode expression is as follows:
[0078]
[0079]
[0080] Furthermore, samples are labeled in different subsets, with each sample assigned a unique label, so that parent samples can be combined during subsequent iterations.
[0081] Furthermore, in a more specific embodiment, the pseudocode expression for step S100 above, which involves acquiring consumption data and performing normalization processing, and dividing the normalized dataset into majority class datasets and minority class datasets, is as follows:
[0082] Input the initial dataset: Datas prime Output the largest dataset: Datas max Output a small dataset: Datas min ;
[0083]
[0084] In this embodiment, after the consumer data set is initially classified by data normalization, it is then sorted by Mahalanobis distance of each sample in the minority class set, and several subsets are divided according to a preset proportion or number of subsets. This makes the classification of the subsets of the minority class set as parent samples more accurate, and ensures that the new samples generated subsequently conform to the characteristics of minority class data and do not exceed the minority class boundary.
[0085] The above is a detailed description of the second embodiment of a precision marketing method based on user consumption data provided in this application. The following is a detailed description of the third embodiment of a precision marketing method based on user consumption data provided in this application.
[0086] In this embodiment, a specific implementation of step S300 is further provided; please refer to [link to relevant documentation]. Figure 3 Step S300 specifically includes steps S301-S303, as detailed below:
[0087] S301, Calculate the target number of samples based on the number of samples in the majority class dataset and the minority class dataset and the expected minority class percentage;
[0088] It should be noted that the specific model for calculating the target sample size is as follows:
[0089]
[0090] In the formula, len(Datas) k ) represents the target number of samples; len(Datas) max ) represents the number of samples in the majority class; len(Datas) min ) represents the number of minority class samples; Q represents the expected minority class percentage, which is set according to the actual calculation needs.
[0091] S302, calculate the number of iterations for the minority class samples based on the number of target samples, and then calculate the minimum Mahalanobis distance based on the number of iterations;
[0092] S303 uses the MAHAKIL algorithm with added random parameters to take samples in different subset regions as parent samples and iteratively generate offspring samples.
[0093] It should be noted that only samples whose distance from their parents is greater than or equal to the minimum Mahalanobis distance can produce new offspring samples with their parents; that is, the Mahalanobis distance between the last generation and its parents is less than the minimum Mahalanobis distance.
[0094] Furthermore, during the process of generating new samples, datas(a,b) are used to synthesize new samples, where 1≤a≤2. b Let b represent the b-th partition of generation a. The pseudocode implementation of the synthesis method is as follows:
[0095] Input Q: the percentage of minority class samples; Output: the set of minority class samples containing new samples: DatasN min ;
[0096]
[0097]
[0098] The MAHAKIL algorithm with added random parameters is used to generate new samples, taking into account the randomness and uncertainty of user consumption, which further improves the accuracy of new samples from minority users.
[0099] Furthermore, taking a k-dimensional coordinate system as an example, assume that the parent sample points are A(x) and A(x) respectively. a1 ,x a2 ,...,x ak ) and B(x b1 ,x b2 ,...,x bk The Mahalanobis distance between points A and B is denoted as M(A,B). First, the sample child node C(x) with random parameters is calculated using the aforementioned pseudocode method. c1 ,x c2 ,...,x ck The Mahalanobis distances between point C and points A and B are calculated and denoted as M(A,C) and M(B,C) respectively. If M(A,C) < mind or M(B,C) < mind, then the iteration number of point C has reached near the last generation. However, since point C is too close to its parent node, if new samples are generated as parent nodes in the future, the similarity between some new samples will be very high. Therefore, in order to continue the iteration, node C' is regenerated based on node C. In a specific implementation, C' is the midpoint of the mean or Euclidean distance between node A and node B. Then, C' and A and B are combined to be used as parent nodes for subsequent child nodes.
[0100] S304. Extract the offspring samples whose Mahalanobis distance from their parents is greater than or equal to the minimum Mahalanobis distance, and combine them to obtain a new minority class dataset.
[0101] It should be noted that if the number of generated samples exceeds the actual number of samples required, the excess new nodes can be pruned evenly in the last generation of offspring. When generating new samples, the algorithm may terminate the iteration due to the limitation of minimum Mahalanobis distance, but the number of new samples may not meet the target number of samples. In this case, the minority class dataset divided in step S100 can be merged into the new minority class dataset as a supplement to the number of new samples.
[0102] Furthermore, to verify the effectiveness of the new sample dataset balancing for classification, SMOTE oversampling was used to compare the data accuracy with the algorithm of this invention. After ensuring that the data distribution and initial data values were consistent for both oversampling methods, a confusion matrix was used for performance evaluation, as detailed below:
[0103] TPR: The accuracy of positive class prediction, also known as recall, is expressed as follows:
[0104]
[0105] Where TP indicates that the category is positive and the prediction is also positive, and FN indicates that the prediction is negative.
[0106] ACC: Represents the model's classification accuracy for positive and negative classes, expressed as follows:
[0107]
[0108] Where TN indicates that the negative class itself is also predicted to be negative, and FP indicates that the positive class itself is predicted to be negative.
[0109] FPR: Represents the false positive rate for the negative class, as follows:
[0110]
[0111] The results of the SMOTE method and this approach on the Adule dataset are shown in the table below:
[0112]
[0113]
[0114] Table 1 Performance Evaluation of Oversampling Method
[0115] The traditional SMOTE algorithm does not take into account the distribution of data and noisy instances, so the generated new samples may exceed the boundary of the minority class. Originally intended to generate new samples of the minority class, it unintentionally generates new samples of the majority class, which is contrary to the original plan of the algorithm. That is, it cannot guarantee that the newly generated samples belong to the minority class, which also demonstrates the effectiveness of this solution.
[0116] In this embodiment, by calculating the number of target samples and then calculating the number of iterations and the minimum Mahalanobis distance, the randomness of user consumption is taken into account when generating new samples using the MAHAKIL algorithm with added random parameters. This results in generating new samples within the minority class data classification boundary, improving the accuracy of the new samples. Consequently, the classifier obtained during subsequent training is more accurate, thus improving the efficiency of precision marketing.
[0117] The above is a detailed description of the second embodiment of a precision marketing method based on user consumption data provided in this application. The following is a detailed description of a precision marketing device based on user consumption data provided in the second aspect of this application.
[0118] Please see Figure 4 , Figure 4 This is a diagram of a precision marketing device based on user consumption data. This embodiment provides a precision marketing device based on user consumption data, including:
[0119] The dataset preliminary partitioning module 10 is used to acquire consumption data and perform normalization processing, dividing the normalized dataset into majority class datasets and minority class datasets;
[0120] The minority class dataset partitioning module 20 is used to calculate the Mahalanobis distance of each sample in the minority class dataset, and then sort the samples according to the Mahalanobis distance and divide each sample into several subsets.
[0121] The minority class dataset balancing module 30 is used to calculate the number of iterations for minority class samples based on the preset target number of samples, and then calculate the minimum Mahalanobis distance based on the number of iterations; the MAHAKIL algorithm with added random parameters is used to take samples in different subsets as parent samples, iteratively generate offspring samples, and form a new minority class dataset by combining offspring samples whose Mahalanobis distance with parent samples is greater than or equal to the minimum Mahalanobis distance.
[0122] The classifier precision marketing module 40 is used to train a user group classifier with new minority and majority class datasets to conduct precision marketing to different user groups.
[0123] Furthermore, in the minority class dataset partitioning module 20, the Mahalanobis distance of each sample in the minority class dataset is calculated, and the samples are sorted according to the Mahalanobis distance before being divided into several subsets. Specifically, this includes:
[0124] Calculate the Mahalanobis distance between samples in the minority class dataset;
[0125] After sorting the samples according to Mahalanobis distance, the boundary samples are determined.
[0126] The sorted dataset is divided into several subsets based on the location of the partitioned samples.
[0127] Furthermore, in the minority class dataset balancing module 30, the calculation model for the preset target number of samples is specifically as follows:
[0128]
[0129] In the formula, len(Datas) k ) represents the target number of samples, len(Datas) max ) represents the number of samples in the majority class, len(Datas) min ) represents the number of minority class samples, and Q represents the expected proportion of the minority class.
[0130] A third aspect of this application also provides a precision marketing device based on user consumption data, including a processor and a memory: wherein the memory is used to store program code and transmit the program code to the processor; the processor is used to execute the precision marketing method based on user consumption data of the first aspect according to the instructions in the program code.
[0131] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and equipment can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0132] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0133] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0134] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0135] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0136] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for precision marketing based on user consumption data, characterized by, The method comprises the following steps: obtaining consumption data and performing normalization processing, and dividing the normalized data set into a majority class data set and a minority class data set; the consumption data comprises a sales product price interval, a sales product quantity and a sales product category; calculating the Mahalanobis distance of each sample in the minority class data set, and sorting the samples according to the Mahalanobis distance and then dividing each sample into several subsets; calculating the iteration number of the minority class samples according to a preset target sample number, and then calculating the minimum Mahalanobis distance according to the iteration number; using the MAHAKIL algorithm with a random parameter to take the samples in different subsets as parent samples, iteratively generating offspring samples, and taking the offspring samples with a Mahalanobis distance greater than or equal to the minimum Mahalanobis distance from the parent samples to form a new minority class data set; training a user group classifier using the new minority class data set and the majority class data set to perform precise marketing to different user groups. 2.The precision marketing method based on user consumption data according to claim 1, characterized in that, The method for calculating the Mahalanobis distance of each sample in the minority class data set and sorting the samples according to the Mahalanobis distance and then dividing each sample into several subsets comprises the following steps: calculating the Mahalanobis distance of each sample in the minority class data set; determining a boundary sample after sorting the samples according to the Mahalanobis distance; dividing the sorted data set into several subsets according to the position of the boundary sample. 3.The precision marketing method based on user consumption data according to claim 1, characterized in that, The calculation model of the preset target sample number is as follows: In the formula, is the number of target samples, is the number of majority class samples, is the number of minority class samples, and Q is the predicted proportion of minority classes. 4.The precision marketing method based on user consumption data according to claim 2, characterized in that, The calculation formula for calculating the Mahalanobis distance of each sample in the minority class data set is as follows: wherein, is a sample in the minority class dataset, is is the Mahalanobis distance in the minority class dataset, is the sample mean of the minority class dataset, is the covariance matrix, is the number of iterations. 5.The precision marketing method based on user consumption data according to claim 1, wherein, The method for iteratively generating offspring samples comprises the following steps: if the Mahalanobis distance between an offspring sample and one of its parent samples in the iteration is less than the minimum Mahalanobis distance, then taking the mean value or the Euclidean distance midpoint of the parent samples as the offspring sample to continue the iteration. 6.The precision marketing method based on user consumption data according to claim 1, wherein, After the offspring samples with a Mahalanobis distance greater than or equal to the minimum Mahalanobis distance from the parent samples are taken to form a new minority class data set, the method further comprises the following steps: if the number of new samples does not meet the target sample number, then merging the minority class data set into the new minority class data set as a supplement.
7. A precision marketing device based on user consumption data, characterized by, The method comprises the following steps: a data set preliminary division module is configured to obtain consumption data and perform normalization processing, and divide the normalized data set into a majority class data set and a minority class data set; the consumption data comprises a sales product price interval, a sales product quantity and a sales product category; a minority class data set division module is configured to calculate the Mahalanobis distance of each sample in the minority class data set, and sort the samples according to the Mahalanobis distance and then divide each sample into several subsets; a minority class data set balancing module is configured to calculate the iteration number of the minority class samples according to a preset target sample number, and then calculate the minimum Mahalanobis distance according to the iteration number; and use the MAHAKIL algorithm with a random parameter to take the samples in different subsets as parent samples, iteratively generate offspring samples, and take the offspring samples with a Mahalanobis distance greater than or equal to the minimum Mahalanobis distance from the parent samples to form a new minority class data set; a classifier precise marketing module is configured to train a user group classifier using the new minority class data set and the majority class data set to perform precise marketing to different user groups. 8.The precision marketing device based on user consumption data according to claim 7, wherein, In the minority class data set division module, the method for calculating the Mahalanobis distance of each sample in the minority class data set and sorting the samples according to the Mahalanobis distance and then dividing each sample into several subsets comprises the following steps: Calculate Mahalanobis distances of each sample in the minority class data set; Determine a boundary sample after sorting the samples according to the Mahalanobis distances; Divide the sorted data set into several subsets according to the positions of the partition samples. 9.The precision marketing device based on user consumption data according to claim 7, wherein, In the minority class data set balancing module, the calculation model of the preset target sample number is specifically: In the formula, is the target sample number, is the majority class sample number, is the minority class sample number, and Q is the predicted proportion of the minority class.
10. A precision marketing device based on user consumption data, characterized by, The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the precise marketing method based on user consumption data according to the instructions in the program code.
Citation Information
Patent Citations
Prediction method for unbalanced data set based on isolated forest learning
CN112070125A
Cerebral stroke screening data preprocessing method and system
CN115114995A