Model construction method, apparatus, device, medium, and product
By constructing an unsupervised complaint user prediction model and utilizing hash trees and hash forests, the problem of difficulty in predicting complaint behavior based on new data in existing technologies is solved, thereby improving the accuracy of complaint user prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中移信息技术有限公司
- Filing Date
- 2022-12-06
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies rely on supervised models when predicting user complaints, which makes it difficult to predict complaint behavior in new data and results in low accuracy.
An unsupervised model for predicting complainant users is constructed. By acquiring user feature data, a hash tree and a distance hash forest are built using a family of distance hash functions to predict whether a user to be detected is a user to be complained about.
It improves the accuracy and precision of predicting complainants without requiring tag information.
Smart Images

Figure CN115828174B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a model building method, apparatus, device, medium, and product. Background Technology
[0002] Today, with telecommunications operators fully operational, their focus has shifted from increasing the number of users to improving user quality. User complaints are a major factor affecting user quality.
[0003] Currently, the prediction of whether a user will file a complaint is done using supervised models. These supervised models require prior knowledge of the user's complaint label, and the data is based on historical data. As a result, the models can generally only identify complaint behavior in historical data, and it is difficult to predict complaint behavior in new data in actual production, leading to low accuracy. Summary of the Invention
[0004] The purpose of this application is to provide a model building method, apparatus, device, medium, and product to build an unsupervised complaint user prediction model, thereby improving the accuracy of complaint user prediction.
[0005] The technical solution of this application is as follows:
[0006] Firstly, a model construction method is provided, which includes:
[0007] Acquire feature data from multiple users; each user has multiple feature data; each feature data corresponds to the business related to the user's complaint.
[0008] Based on the characteristic data of each user and the distance hash function, a family of hash functions is obtained;
[0009] Construct a hash tree based on a family of hash functions;
[0010] A distance hash forest is constructed based on multiple hash trees; the distance hash forest is used to predict whether a user to be detected is a user to be reported.
[0011] In one possible implementation, after acquiring feature data from multiple users, the method further includes:
[0012] For each user's multiple feature data, each feature data is preprocessed to obtain the target feature data;
[0013] Based on the characteristic data of each user and the distance hash function, a family of hash functions is obtained, including:
[0014] Based on the target feature data and the distance hash function, a family of hash functions is obtained.
[0015] In one possible implementation, the feature data of each user is preprocessed to obtain target feature data, including:
[0016] Perform the following operations on each user's feature data to obtain the first target feature data:
[0017] For the first feature data with missing values, delete the first feature data; where the first feature data is the data used to characterize the user's attribute features;
[0018] For the second feature data with missing values, the second feature data is filled with preset values; wherein, the second feature data is used to represent user-customized business data and user consumption data;
[0019] For non-compliant third-feature data, the third-feature data will be deleted; the third-feature data is used to characterize data that violates the norm.
[0020] For the fourth feature data that does not meet the first preset condition, discretization processing is performed; wherein, the fourth feature data includes the consumption growth rate, and the first preset condition includes that the consumption growth rate is not negative;
[0021] Based on the first target feature data, the target feature data is determined.
[0022] In one possible implementation, determining target feature data based on the first target feature data includes:
[0023] Based on chi-square detection, a preset number of second target feature data are selected from the first target feature data;
[0024] Frequency statistics were performed on the feature data of the second target.
[0025] Logarithmic transformation is performed on the second target feature data whose frequency exceeds a preset frequency threshold to obtain the target feature data.
[0026] In one possible implementation, based on the characteristic data of each user and the distance hash function, a family of hash functions is obtained, including:
[0027] Each user is divided into N subsamples; each subsample contains M users, where M and N are both positive integers.
[0028] For each subsample, calculate the hash line projection distance between the M users in each subsample;
[0029] Based on the hash line projection distance, the M users in the subsample are placed into different hash buckets;
[0030] Based on different hash buckets, a family of hash functions is obtained.
[0031] In one possible implementation, calculating the hashline projection distance between M users in each subsample includes:
[0032] Select two target users from M users; where the target users are any two users from the M users.
[0033] The subsample is input into the distance hash function to obtain the hash line projection distance between each of the M users in the subsample and the target user.
[0034] In one possible implementation, a hash tree is constructed based on a family of hash functions, including:
[0035] Select P groups of hash buckets from the family of hash functions;
[0036] For each hash bucket in the hash function family, calculate the hash line projection distance for each user in the hash bucket;
[0037] Users with the same hash line projection distance are identified as a sub-data class;
[0038] Traverse each sub-data class, perform hash calculations on sub-data classes with multiple users, until a sub-data class satisfies the second preset condition, and generate a hash tree; wherein, the second preset condition includes: there is only one user in the sub-data class, or the height of the hash tree corresponding to the sub-data class is greater than or equal to the preset height.
[0039] In one possible implementation, P groups of hash buckets are selected from the family of hash functions, including:
[0040] Determine the distribution entropy of each hash bucket in the hash function family;
[0041] Sort the distribution entropies from highest to lowest.
[0042] Select the hash buckets corresponding to the top P distribution entropies in the sorting.
[0043] In one possible implementation, after constructing a distance hash forest based on multiple hash trees, the method further includes:
[0044] Obtain the feature data to be processed for the user to be predicted;
[0045] The feature data to be processed is input into the hash forest to obtain the score of the user to be predicted as the user to be complained about.
[0046] If the score is greater than a preset score threshold, the user is identified as a user to be complained about.
[0047] Secondly, a model building apparatus is provided, the apparatus comprising:
[0048] The acquisition module is used to acquire feature data of multiple users; each user has multiple feature data; each feature data is used to characterize the user as an unsuspecting user who customized the complaint.
[0049] The determination module is used to obtain a family of hash functions based on the feature data of each user and the distance hash function;
[0050] Modules for building hash trees based on a family of hash functions;
[0051] The module is used to build a distance hash forest based on multiple hash trees; and to predict whether a user to be detected is a user to be complained about based on the distance hash forest.
[0052] Thirdly, embodiments of this application provide an electronic device, which includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor. When the program or instructions are executed by the processor, they implement the steps of any of the model building methods described in the embodiments of this application.
[0053] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, and when the program or instructions are executed by a processor, they implement the steps of any of the model building methods described in embodiments of this application.
[0054] Fifthly, embodiments of this application provide a computer program product, wherein the instructions in the computer program product, when executed by a processor of an electronic device, enable the electronic device to perform the steps of any of the model building methods described in embodiments of this application.
[0055] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects:
[0056] In the embodiments of this application, a family of hash functions is obtained by acquiring feature data corresponding to multiple user complaints and distance hash functions. A hash tree is constructed based on the hash function family, and a distance hash forest is constructed based on multiple hash trees. The distance hash forest is used to predict whether the user to be detected is a user who complained about the customized service without knowing it. In this way, the user's service feature data is acquired when acquiring data, without needing to determine whether the user is a complaining user. This eliminates the need to add labels to complaining users, realizes unsupervised learning, and obtains a model to predict the user to be complained about, thereby improving the accuracy of the complaint user prediction.
[0057] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0058] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.
[0059] Figure 1 This is one of the flowcharts illustrating the model building method according to the first aspect of this application;
[0060] Figure 2 This is a second schematic flowchart of the model building method involved in the first aspect of this application;
[0061] Figure 3 This is a schematic diagram of the structure of a model building apparatus provided in the second aspect embodiment of this application;
[0062] Figure 4 This is a schematic diagram of the structure of an electronic device provided in the third aspect of this application. Detailed Implementation
[0063] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0064] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples consistent with some aspects of this application as detailed in the appended claims.
[0065] As described in the background section, existing technologies suffer from the problem of difficulty in predicting complaint behavior in new data from actual production, resulting in low accuracy. To address this issue, this application provides a model building method, apparatus, device, medium, and product. By acquiring feature data corresponding to multiple user complaints and distance hash functions, a family of hash functions is obtained. Based on the hash function family, a hash tree is constructed. Based on multiple hash trees, a distance hash forest is constructed to predict whether a user to be detected is an unsuspecting user complaining about customized services. In this way, the user's business feature data is acquired without needing to determine whether the user is a complainant. This eliminates the need to label complainants, enabling unsupervised learning and obtaining a model to predict users to be complained about, thereby improving the accuracy of complaint user prediction.
[0066] The model construction method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0067] Figure 1 A flowchart illustrating a model building method provided in one embodiment of this application is shown.
[0068] like Figure 1 As shown, the model building method provided in this application includes the following steps:
[0069] S110. Obtain feature data of multiple users; where each user has multiple feature data; each feature data corresponds to the data of the user's complaint.
[0070] Here, users can be from multiple regions, and feature data can be feature data from different times. The feature data for multiple users can also be feature data from users in multiple regions at different times. Feature selection can be pre-defined or randomly selected during use, and each user has multiple feature data. The services complained about by users can be any service, including unknowingly customized services.
[0071] As an example, to obtain network-wide data for July, August, and September from 10,900 provinces, the selection of features could involve tracing the source of complaints to pinpoint a specific order as unknowingly customized, examining the differences in characteristics between unknowingly customized users and normal users, and selecting the following 30 features to obtain feature data:
[0072]
[0073] S120. Based on the characteristic data of each user and the distance hash function, a family of hash functions is obtained.
[0074] Based on the feature data of each user and the distance hash function, the feature data is divided into multiple categories, resulting in a family of hash functions.
[0075] S130. Construct a hash tree based on a family of hash functions.
[0076] Based on the hash group function, the feature data is recursively partitioned until all users corresponding to the feature data are isolated, and a hash tree is gradually generated, wherein the hash tree includes at least one.
[0077] S140. Construct a distance hash forest based on multiple hash trees; use the distance hash forest to predict whether the user to be detected is a user to be complained about.
[0078] Here, the distance hash forest consists of multiple isolated hash trees.
[0079] In this way, by acquiring feature data corresponding to multiple user complaints and distance hash functions, a family of hash functions is obtained. Based on the hash function family, a hash tree is constructed. Based on multiple hash trees, a distance hash forest is constructed. The distance hash forest is used to predict whether the user to be detected is a user who complained about the customized service without knowing it. In this way, the user's business feature data is acquired when acquiring data, without needing to determine whether the user is a complainant. This eliminates the need to add labels to complainants, realizes unsupervised learning, and obtains a model to predict users to be complained about, thereby improving the accuracy of complainant prediction.
[0080] Based on this, in some embodiments, after S110 described above, the method may further include:
[0081] For each user's multiple feature data, each feature data is preprocessed to obtain the target feature data;
[0082] Based on the characteristic data of each user and the distance hash function, a family of hash functions is obtained, including:
[0083] Based on the target feature data and the distance hash function, a family of hash functions is obtained.
[0084] The target feature data can be the data obtained after preprocessing each feature data.
[0085] In some embodiments, preprocessing the feature data may specifically involve deleting invalid or non-compliant data.
[0086] In some embodiments, preprocessing of feature data may specifically involve imputing missing values. Here, the imputing value may be the average, maximum, or minimum value corresponding to the missing value, and the specific value can be set according to the user's situation.
[0087] In one example, the age characteristics of three users, User 1, User 2, and User 3, are obtained. If User 1 and User 2 have corresponding age values, while User 3's age value is empty, then the average, maximum, or minimum age of User 2 and User 3 can be used as User 3's age.
[0088] This reduces interference from unusable feature data, thereby improving the accuracy of predicting complaining users.
[0089] Based on this, in some embodiments, preprocessing of the feature data of each user to obtain target feature data may include:
[0090] Perform the following operations on each user's feature data to obtain the first target feature data:
[0091] For the first feature data with missing values, delete the first feature data; where the first feature data is the data used to characterize the user's attribute features;
[0092] For the second feature data with missing values, the second feature data is filled with preset values; wherein, the second feature data is used to represent user-customized business data and user consumption data;
[0093] For non-compliant third-feature data, the third-feature data will be deleted; the third-feature data is used to characterize data that violates the norm.
[0094] For the fourth feature data that does not meet the first preset condition, discretization processing is performed; wherein, the fourth feature data includes the consumption growth rate, and the first preset condition includes that the consumption growth rate is not negative;
[0095] Based on the first target feature data, the target feature data is determined.
[0096] The first target feature data can be data obtained by deleting the first feature data with missing values, data obtained by filling the second feature data with missing values with preset values, data obtained by deleting the non-compliant third feature data, or data obtained by discretizing the fourth feature data that does not meet the first preset condition.
[0097] Here, the first feature data is used to characterize the user's attribute characteristics, the second feature data is used to characterize the user's customized business data and the user's consumption data, the third feature data is used to characterize data that deviates from the norm, and the fourth feature data includes the consumption increase. The first preset condition includes that the consumption increase is not negative.
[0098] In some embodiments, preprocessing the feature data of an individual user may include deleting or filling feature data with missing values, and may also include deleting data that does not conform to the norm.
[0099] As an example, for first feature data with missing values, the first feature data is deleted, where the first feature data is data used to characterize the user's attribute characteristics, and the data characterizing the user's attribute characteristics may be, but is not limited to, user age, user status, and total cost variance.
[0100] In another example, for second feature data with missing values, the second feature data is filled with preset values; wherein, the second feature data is used to represent user-customized business data and user consumption data, and the second feature data may be, but is not limited to, total cost, monthly cost, last month's cost, consumption increase, and the second feature data may be filled with 0.
[0101] In another example, for non-compliant third characteristic data, the third characteristic data is deleted; where the third characteristic data is used to characterize data that violates the norm, the third characteristic data may be, but is not limited to, characteristic data corresponding to users whose age is negative or exceeds 100. In this case, all characteristic data of that user are deleted.
[0102] In some embodiments, the obtained first target feature data may be normalized feature data or may contain negative values. Here, feature data containing negative values can be further processed.
[0103] As an example, for negative consumption growth rates, discretization is performed to convert them into discrete data, which are divided into three categories: increased consumption growth, decreased consumption growth, and unchanged consumption growth. The categorical variables are then transformed using a LabelEncoder to represent all categorical variables with numbers (e.g., increased consumption growth is represented by 0, unchanged consumption growth by 1, and decreased consumption growth by 2).
[0104] This standardized processing of feature data improved the accuracy of the model, thereby enhancing the precision of predicting complainant users.
[0105] Based on this, in some embodiments, determining target feature data based on the first target feature data includes:
[0106] Based on chi-square detection, a preset number of second target feature data are selected from the first target feature data;
[0107] Frequency statistics were performed on the feature data of the second target.
[0108] Logarithmic transformation is performed on the second target feature data whose frequency exceeds a preset frequency threshold to obtain the target feature data.
[0109] The preset quantity can be a pre-set number of feature data selected from the first target feature data.
[0110] The second target feature data can be selected from the first target feature data based on chi-square detection, which involves filtering out a predetermined number of data.
[0111] The preset frequency threshold can be a frequency threshold set based on features, and different frequency thresholds can be set according to different features.
[0112] In some embodiments, after feature analysis, it is found that most feature data have a 0% correlation with whether or not a complaint has been filed, and some are even negatively correlated. Here, a preset number of second target feature data can be selected from the first target feature data.
[0113] In some embodiments, the chi-square test is used for feature selection.
[0114] As an example, the chi-square test was used to select 11 features from 30 features for model training. These 11 features include age, total amount of business processed this month, number of product code matches in the complaint table, number of product complaints in the past 3 months, number of product cancellations in the past month, consumption growth rate, number of user complaints in the past 6 months, number of calls to 10086 in the past 3 months, whether the user is a Magic Box user, whether the product was used after subscription, and whether the transaction was processed at night.
[0115] In some embodiments, frequency statistics are performed on the second target feature data. It should be noted that only feature data with frequency are statistically analyzed.
[0116] In some embodiments, when there is tailing data in the features, a logarithmic transformation is performed on the second target feature data whose frequency exceeds a preset frequency threshold to obtain the target feature data. Tailing data refers to the presence of maximum values in certain fields.
[0117] As an example, the number of complaints in the past 6 months with a value of 10 is relatively large, while the number of other complaints is between 0 and 3. In this case, the number of complaints in the past 6 months is logarithmically transformed.
[0118] This further standardizes the feature data, improves the accuracy of the model, and thus enhances the precision of predicting complainant users.
[0119] Based on this, in some embodiments, the above-mentioned S120 may specifically include:
[0120] Each user is divided into N subsamples; each subsample contains M users, where M and N are both positive integers.
[0121] For each subsample, calculate the hash line projection distance between the M users in each subsample;
[0122] Based on the hash line projection distance, the M users in the subsample are placed into different hash buckets;
[0123] Based on different hash buckets, a family of hash functions is obtained.
[0124] In some embodiments, each user is divided into N subsamples, and each user can be assigned to any subsample, with each subsample having M users.
[0125] In some embodiments, feature data in an arbitrary space is mapped to a line defined in the real number space, and the hash line projection distance between M users in each subsample is calculated based on the feature data on this line.
[0126] As an example, based on the hash line projection distance, the M users in the subsample are placed into different hash buckets. Because the distance-based hashing (DBH) algorithm has a balanced hash table, when it performs nearest neighbor retrieval, the mapping result is only two hash buckets, 0 and 1. Therefore, the data can only be divided into two parts, and its original hash function family formula (1) is as follows:
[0127]
[0128] in, This indicates that the hash line projection distance is within the range of hash bucket 0.
[0129] The original DBH function hashes the data into two buckets of roughly equal size, but this only divides the data into two categories. In order to more accurately and finely divide the data into different parts to find outliers, the function is optimized by using a number of non-repeating subsamples w to divide the hash path, that is, dividing the different hash line projection distances into w parts to form a new family of hash functions. The calculation formula (2) is as follows:
[0130]
[0131] in, Let x be a distance hash function, and let its projection lie within the interval formed by w. Let r represent the window size.
[0132] As an example, with 10 samples, 5 are selected as subsamples. After mapping with the distance hash function, similar data with similar hash values will be hashed into the same bucket, while other different data will be assigned to different buckets. For example, 2 subsamples have the same hash line projection distance, another 2 subsamples have the same hash line projection distance, and the remaining subsample has a hash line projection distance that is different from the first two. Therefore, w is 3 here, and r is defined by the amount of data.
[0133] In this way, M users can be placed into multiple different hash buckets, resulting in a family of hash functions.
[0134] Based on this, in some embodiments, calculating the hash line projection distance between M users in each subsample may include:
[0135] Select two target users from M users; where the target users are any two users from the M users.
[0136] The subsample is input into the distance hash function to obtain the hash line projection distance between each of the M users in the subsample and the target user.
[0137] In some embodiments, the hash line projection distance between M users in each subsample is calculated using the following distance hash function formula (3):
[0138]
[0139] Where x represents all subsamples, x1 and x2 are two sample points arbitrarily selected from all samples, D(x, x1) represents the Euclidean distance between x and x1, D(x1, x2) represents the Euclidean distance between x1 and x2, and D(x, x2) represents the Euclidean distance between x and x2.
[0140] In the embodiments provided in this application, a distance hash function can be used to calculate the hash line projection distance between each of the M users in the subsample and the target user.
[0141] Based on this, in some embodiments, the above-mentioned S130 may specifically include:
[0142] Select P groups of hash buckets from the family of hash functions;
[0143] For each hash bucket in the hash function family, calculate the hash line projection distance for each user in the hash bucket;
[0144] Users with the same hash line projection distance are identified as a sub-data class;
[0145] Traverse each sub-data class, perform hash calculations on sub-data classes with multiple users, until a sub-data class satisfies the second preset condition, and generate a hash tree; wherein, the second preset condition includes: there is only one user in the sub-data class, or the height of the hash tree corresponding to the sub-data class is greater than or equal to the preset height.
[0146] In some embodiments, P hash buckets are randomly selected from a family of hash functions, where each hash bucket consists of K feature data, which can be randomly selected from all feature data. The size of K is the same for each hash bucket, but the selected feature data can be different. Similarly, the size of K is the same for each hash function, but the selected feature data can be different. Here, hash buckets and hash functions are corresponding entities.
[0147] As an example, three hash buckets are selected, each containing four feature data. The four feature data in each hash bucket can be the same or different, and the selection of feature data is random.
[0148] In some embodiments, the hash line projection distance corresponding to each user in the hash bucket is calculated using the distance hash function formula (3) described above.
[0149] In some embodiments, users with the same hash line projection distance in each hash bucket are identified as a sub-data class.
[0150] In some embodiments, each data class is traversed, and hash calculations are performed on sub-data classes with multiple users until all leaf nodes have only one user, or the hash tree corresponding to the sub-data class has reached a specified height.
[0151] In this way, hash buckets are selected from the hash group function, and sub-data classes are divided based on the hash line projection distance in each hash bucket. Users corresponding to all feature data are isolated, and a hash tree is gradually generated.
[0152] Based on this, in some embodiments, P groups of hash buckets are selected from the hash function family, including:
[0153] Determine the distribution entropy of each hash bucket in the hash function family;
[0154] Sort the distribution entropies from highest to lowest.
[0155] Select the hash buckets corresponding to the top P distribution entropies in the sorting.
[0156] In some embodiments, the distribution entropy of each hash bucket in the hash function family is calculated using the following formula (4):
[0157]
[0158] Where, N r Let m represent the number of users in the r-th bucket, and m represent the number of buckets that are not empty.
[0159] Select a subset of hash buckets with higher distribution entropy.
[0160] In this way, selecting hash buckets by calculating distribution entropy improves retrieval performance and anomaly detection efficiency.
[0161] In some embodiments, such as Figure 2 Following S140 above, the method further includes:
[0162] S150. Obtain the feature data to be processed for the user to be predicted.
[0163] The user to be predicted can be a predicted sample that is predicted using a trained model, and the specific user to be predicted does not have a label.
[0164] The feature data to be processed can be the feature data of the predicted samples that need to be processed using the model.
[0165] S160. Input the feature data to be processed into the hash forest to obtain the score of the user to be predicted as the user to be complained about.
[0166] The feature data to be processed is input into the hash forest, and the results of each tree need to be calculated comprehensively. The score of the user to be predicted as the user to be complained about is obtained by formula (5):
[0167]
[0168] Where t is the number of hash trees, h i (x) represents the height of the user to be predicted in each tree. This represents the path length.
[0169] S170. If the score is greater than the preset score threshold, the user is identified as a user to be complained about.
[0170] The preset score threshold can be a height limit imposed on each tree, which can be set according to the actual situation.
[0171] In some embodiments, abnormal users tend to appear in shorter branches. A height limit is imposed on each tree. If the score is greater than a preset score threshold, the user is identified as a user to be complained about. Here, the preset score threshold is the imposed height limit, which is determined by formula (6):
[0172]
[0173] in, γ represents the number of users to be predicted, w represents the number of unique users to be predicted, and γ is Euler's constant.
[0174] In this way, for the trained model, the historical feature data of new users are input into the model, the output structure is used to verify the model's precision and recall.
[0175] As an example, three types of feature data are used as datasets to validate the model training performance:
[0176] Dataset A: Includes the feature data of the first target;
[0177] Dataset B: Includes feature data for the second target;
[0178] Dataset C: Includes the second target feature data after logarithmic transformation.
[0179] The sample size was set to 421,000, including 420,600 normal samples and 400 complaint samples. Multiple algorithms were used for training, and the algorithms used and the training results are as follows:
[0180]
[0181]
[0182] The ratio of the number of correct complaint samples detected by recall to the total number of complaint samples used in training (400 in this case).
[0183] In another example, the algorithm described above is used to make predictions on the dataset, and combined with the true labels, the model is evaluated, resulting in the following confusion matrix:
[0184]
[0185] In the confusion matrix, for example for dataset A, the original total number of positive samples is 558777 + 34 = 558811, of which 558777 are predicted as positive samples and 34 are predicted as complaints; the original total number of complaints is 118 + 182 = 300, of which 118 are predicted as positive samples and 182 are predicted as complaints.
[0186] Verification shows that, in the embodiments provided in this application, the model test structure achieves a precision of 89% and a recall of 62% on dataset C, which is quite satisfactory.
[0187] It should be noted that the model building method provided in this application embodiment can be executed by a model building device or a control module in the model building device for executing the model building method.
[0188] Based on the same inventive concept as the model building method described above, this application also provides a model building apparatus. The following is in conjunction with... Figure 3 The model building apparatus provided in the embodiments of this application will be described in detail.
[0189] Figure 3 This is a schematic diagram of a model building apparatus according to an exemplary embodiment.
[0190] like Figure 3 As shown, the model building apparatus 300 may include:
[0191] The acquisition module 310 is used to acquire feature data of multiple users; whereby each user has multiple feature data; each feature data corresponds to the service complaint filed by the user.
[0192] The determination module 320 is used to obtain a family of hash functions based on the feature data of each user and the distance hash function;
[0193] Module 330 is used to construct hash trees based on a family of hash functions;
[0194] Module 330 is also used to build a distance hash forest based on multiple hash trees; and to predict whether a user to be detected is a user to be complained about based on the distance hash forest.
[0195] Accordingly, in some embodiments, the device 300 further includes:
[0196] The data processing module is used to preprocess the feature data of each user after acquiring feature data from multiple users, in order to obtain target feature data.
[0197] The determining module 320 is also used to obtain a family of hash functions based on the feature data of each user and the distance hash function, which may include:
[0198] Based on the target feature data and the distance hash function, a family of hash functions is obtained.
[0199] Based on this, in some embodiments, the data processing module may specifically include:
[0200] The first target feature data determination submodule is used to perform the following operations on each user's feature data to obtain the first target feature data:
[0201] For the first feature data with missing values, delete the first feature data; where the first feature data is the data used to characterize the user's attribute features;
[0202] For the second feature data with missing values, the second feature data is filled with preset values; wherein, the second feature data is used to represent user-customized business data and user consumption data;
[0203] For non-compliant third-feature data, the third-feature data will be deleted; the third-feature data is used to characterize data that violates the norm.
[0204] For the fourth feature data that does not meet the first preset condition, discretization processing is performed; wherein, the fourth feature data includes the consumption growth rate, and the first preset condition includes that the consumption growth rate is not negative;
[0205] The target feature data determination submodule is used to determine target feature data based on the first target feature data.
[0206] Based on this, in some embodiments, the target feature data determination submodule may specifically include:
[0207] The filtering unit is used to filter out a preset number of second target feature data from the first target feature data based on chi-square detection;
[0208] The statistical unit is used to perform frequency statistics on the feature data of the second target.
[0209] The logarithmic transformation unit is used to perform a logarithmic transformation on the second target feature data whose frequency exceeds a preset frequency threshold to obtain the target feature data.
[0210] Based on this, in some embodiments, the determining module 320 may specifically include:
[0211] The partitioning submodule is used to divide each user into N subsamples; where each subsample contains M users, and M and N are both positive integers.
[0212] The computation submodule is used to calculate the hash line projection distance between M users in each subsample for each subsample;
[0213] The hash bucket placement submodule is used to place M users in a subsample into different hash buckets based on the hash line projection distance;
[0214] The hash function family determination submodule is used to obtain the hash function family based on different hash buckets.
[0215] Based on this, in some embodiments, the computing submodule may specifically include:
[0216] The selection unit is used to select two target users from M users; wherein the target users are any two users from the M users.
[0217] The distance determination unit is used to input the subsample into the distance hash function to obtain the hash line projection distance between each of the M users in the subsample and the target user.
[0218] Based on this, in some embodiments, the construction module 330 may specifically include:
[0219] The hash bucket selection submodule is used to select P groups of hash buckets from the family of hash functions;
[0220] The distance calculation submodule is used to calculate the hash line projection distance for each user in each hash bucket in the hash function family;
[0221] The sub-data class determination submodule is used to identify users with the same hash line projection distance as a sub-data class;
[0222] The hash tree generation submodule is used to traverse each sub-data class, perform hash calculations on sub-data classes with multiple users, until the sub-data class meets the second preset condition, and generate a hash tree; wherein, the second preset condition includes: there is only one user in the sub-data class, or the height of the hash tree corresponding to the sub-data class is greater than or equal to the preset height.
[0223] Based on this, in some embodiments, the hash bucket selection submodule may specifically include:
[0224] The distribution entropy determination unit is used to determine the distribution entropy of each hash bucket in the hash function family;
[0225] A sorting unit is used to sort the distribution entropies from highest to lowest.
[0226] The corresponding selection unit is used to select the hash buckets corresponding to the P distribution entropies in the sorting order.
[0227] Accordingly, in some embodiments, the device 300 further includes:
[0228] The acquisition module 310 is also used to acquire the unprocessed feature data of the user to be predicted after constructing a distance hash forest based on multiple hash trees;
[0229] The determination module 320 is also used to input the feature data to be processed into the hash forest to obtain the score of the user to be predicted as the user to be complained about;
[0230] The determination module 320 is also used to determine a user as a user to be complained about when the score is greater than a preset score threshold.
[0231] The model building apparatus provided in this application embodiment can be used to execute the model building methods provided in the above method embodiments. The implementation principle and technical effect are similar, and will not be described in detail here for the sake of brevity.
[0232] Based on the same inventive concept, embodiments of this application also provide an electronic device.
[0233] Figure 4 A schematic diagram of the hardware structure of the model building device provided in an embodiment of this application is shown.
[0234] The model building device may include a processor 401 and a memory 402 storing computer program instructions.
[0235] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0236] Memory 402 may include mass storage for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 402 is non-volatile solid-state memory.
[0237] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.
[0238] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the model construction methods in the above embodiments.
[0239] In one example, the model building device may also include a communication interface 403 and a bus 410. Wherein, as Figure 4As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.
[0240] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0241] Bus 410 includes hardware, software, or both, that couples components of a model-building device together. For example, and not limited to, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Linear Predictive Coding (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (Peripheral Component Interconnect-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VESA Local Bus, VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 410 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application contemplates any suitable bus or interconnect. The electronic device can perform the model-building method in the embodiments of this invention, thereby achieving... Figure 1 and Figure 2 The described model construction method.
[0242] Furthermore, in conjunction with the model building methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the model building methods in the above embodiments.
[0243] This application also provides a computer program product, wherein the instructions in the computer program product, when executed by the processor of an electronic device, cause the electronic device to perform various processes implementing any of the above-described model construction method embodiments.
[0244] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0245] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0246] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0247] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.
Claims
1. A model construction method, characterized in that, The method includes: Acquire feature data from multiple users; wherein each user has multiple feature data; each feature data corresponds to the service complaint filed by the user. Based on the feature data of each user and the distance hash function, a family of hash functions is obtained, wherein each user is divided into N subsamples; each subsample contains M users, where M and N are both positive integers; for each subsample, the hash line projection distance between the M users in each subsample is calculated; based on the hash line projection distance, the M users in the subsample are placed into different hash buckets; based on the different hash buckets, the family of hash functions is obtained. Based on the hash function family, a hash tree is constructed, wherein P hash buckets are selected from the hash function family; for each hash bucket in the hash function family, the hash line projection distance corresponding to each user in the hash bucket is calculated; users with the same hash line projection distance are determined as a sub-data class; each sub-data class is traversed, and hash calculation is performed on sub-data classes with multiple users until the sub-data class meets a second preset condition, and a hash tree is generated; wherein the second preset condition includes: there is only one user in the sub-data class, or the height of the hash tree corresponding to the sub-data class is greater than or equal to a preset height; A distance hash forest is constructed based on multiple hash trees; the distance hash forest is used to predict whether a user to be detected is a user to be complained about.
2. The method according to claim 1, characterized in that, After acquiring the feature data of multiple users, the method further includes: For each user's multiple feature data, each feature data is preprocessed to obtain target feature data; The family of hash functions obtained based on the feature data of each user and the distance hash function includes: Based on the target feature data and the distance hash function, a family of hash functions is obtained.
3. The method according to claim 2, characterized in that, The preprocessing of the feature data of each user to obtain target feature data includes: For each user's feature data, perform the following operations to obtain the first target feature data: For the first feature data with missing values, the first feature data is deleted; wherein, the first feature data is data used to characterize the attribute features of the user; For the second feature data with missing values, the second feature data is filled with preset values; wherein, the second feature data is used to represent the user-customized business data and the user's consumption data; For non-compliant third feature data, the third feature data shall be deleted; wherein, the third feature data is used to characterize data that violates the norm. For the fourth feature data that does not meet the first preset condition, discretization processing is performed; wherein, the fourth feature data includes the consumption growth rate, and the first preset condition includes that the consumption growth rate is not negative; Based on the first target feature data, target feature data is determined.
4. The method according to claim 3, characterized in that, The step of determining the target feature data based on the first target feature data includes: Based on chi-square detection, a preset number of second target feature data are selected from the first target feature data; Frequency statistics are performed on the second target feature data; Logarithmic transformation is performed on the second target feature data whose frequency exceeds a preset frequency threshold to obtain the target feature data.
5. The method according to claim 1, characterized in that, The calculation of the hash line projection distance between M users in each subsample includes: Two target users are selected from the M users; wherein the target users are any two users from the M users. The subsample is input into the distance hash function to obtain the hash line projection distance between each of the M users in the subsample and the target user.
6. The method according to claim 1, characterized in that, The step of selecting P groups of hash buckets from the hash function family includes: Determine the distribution entropy of each hash bucket in the hash function family; The distribution entropies are sorted from highest to lowest. Select the hash buckets corresponding to the top P distribution entropies in the sorting.
7. The method according to claim 1, characterized in that, After constructing a distance hash forest based on multiple hash trees, the method further includes: Obtain the feature data to be processed for the user to be predicted; The feature data to be processed is input into the hash forest to obtain the score of the user to be predicted as the user to be complained about. If the score is greater than a preset score threshold, the user is identified as a user to be complained about.
8. A model building apparatus, characterized in that, The device includes: The acquisition module is used to acquire feature data of multiple users; wherein each user has multiple feature data; each feature data is used to characterize the user as an unsuspecting user who filed a customized complaint. The determination module is used to obtain a family of hash functions based on the feature data of each user and the distance hash function, wherein each user is divided into N subsamples; wherein each subsample has M users, and M and N are both positive integers; for each subsample, the hash line projection distance between the M users in each subsample is calculated; based on the hash line projection distance, the M users in the subsample are placed into different hash buckets; and based on the different hash buckets, the family of hash functions is obtained. A construction module is used to construct a hash tree based on the hash function family, wherein P groups of hash buckets are selected from the hash function family; for each hash bucket in the hash function family, the hash line projection distance corresponding to each user in the hash bucket is calculated; users with the same hash line projection distance are determined as a sub-data class; each sub-data class is traversed, and hash calculation is performed on sub-data classes with multiple users until the sub-data class meets a second preset condition, and a hash tree is generated; wherein the second preset condition includes: there is only one user in the sub-data class, or the height of the hash tree corresponding to the sub-data class is greater than or equal to a preset height; The construction module is also used to construct a distance hash forest based on multiple hash trees; and to predict whether the user to be detected is a user to be complained about based on the distance hash forest.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the model building method as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the model building method as described in any one of claims 1-7.
11. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device causes the electronic device to perform the steps of the model building method as described in any one of claims 1-7.