Feature processing method, device, computer readable storage medium and computer equipment
Through clustering and collinear parameter calculation, representative and distinctive features are selected, which solves the problem that traditional feature selection methods cannot screen out high-quality features, and realizes the training of interpretable machine learning model.
Patent Information
- Application Number
- CN201910160660.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-04
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2039-05-01
AI Technical Summary
Traditional feature selection methods cannot effectively screen out high-quality features, especially when model interpretability needs to be considered, making it difficult to provide high-quality features for machine learning or data mining.
By obtaining the feature vectors of candidate features, clustering, calculating collinear parameters within and between classes, filtering out target features that differ in line with collinear differences, and filtering out representative and distinctive characteristics from candidate features in high-dimensionality subset of features of .
A high-quality subset of the most descriptive feature of the target is achieved from high-dimensional features, and is used to train a stable and interpretable machine learning model.
Smart Images

Figure CN110163378B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning technology, and in particular to a feature processing method, apparatus, computer-readable storage medium, and computer equipment. Background Art
[0002] With the development of computer technology, machine learning technology has emerged. Machine learning is a science of artificial intelligence, which is a technology that uses data or past experience to optimize the performance standards of computer programs. Many business problems in the field of big data can be solved by corresponding machine learning models. In order to train a good machine learning model, it is often necessary to build good and representative training data. Therefore, how to construct and filter effective feature dimensions from massive data is an important problem that needs to be solved urgently.
[0003] Traditional feature selection methods usually use filtering, wrapping, or embedding methods. These three methods have one thing in common, which is to take the final model effect as the goal of feature selection without considering the interpretability of the model. However, for some machine learning or data mining fields that require high feature interpretability, traditional feature selection methods cannot screen out high-quality features. Summary of the invention
[0004] Based on this, it is necessary to provide a feature processing method, apparatus, computer-readable storage medium and computer device to address the technical problem that traditional feature selection methods cannot mine high-quality features for training interpretable models.
[0005] A feature processing method, comprising:
[0006] Obtain feature vectors corresponding to different candidate features and corresponding to the sample user sequence;
[0007] Clustering the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features to obtain at least one class;
[0008] For each candidate feature, determine the intra-class collinearity parameter when fitting the feature vector corresponding to each candidate feature through the feature vector in the class to which it belongs;
[0009] For each candidate feature, determining an inter-class collinearity parameter when fitting a feature vector corresponding to each candidate feature through a feature vector outside the class to which it belongs;
[0010] From the candidate features included in each category, the target features whose differences between the corresponding intra-class collinearity parameters and inter-class collinearity parameters meet the collinearity difference conditions are screened out.
[0011] A feature processing device, comprising:
[0012] An acquisition module, used to acquire feature vectors corresponding to different candidate features and corresponding to the sample user sequence;
[0013] A clustering module, used for clustering the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features, to obtain at least one class;
[0014] A determination module, used for determining, for each candidate feature, a collinearity parameter within a class when fitting a feature vector corresponding to each candidate feature through a feature vector within the class to which it belongs;
[0015] The determination module is used to determine, for each candidate feature, an inter-class collinearity parameter when fitting a feature vector corresponding to each candidate feature through a feature vector outside the class to which it belongs;
[0016] The screening module is used to screen out target features whose differences between the corresponding intra-class collinearity parameters and the inter-class collinearity parameters meet the collinearity difference conditions from the candidate features included in each class.
[0017] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0018] Obtain feature vectors corresponding to different candidate features and corresponding to the sample user sequence;
[0019] Clustering the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features to obtain at least one class;
[0020] For each candidate feature, determine the intra-class collinearity parameter when fitting the feature vector corresponding to each candidate feature through the feature vector in the class to which it belongs;
[0021] For each candidate feature, determining an inter-class collinearity parameter when fitting a feature vector corresponding to each candidate feature through a feature vector outside the class to which it belongs;
[0022] From the candidate features included in each category, the target features whose differences between the corresponding intra-class collinearity parameters and inter-class collinearity parameters meet the collinearity difference conditions are screened out.
[0023] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0024] Obtain feature vectors corresponding to different candidate features and corresponding to the sample user sequence;
[0025] Clustering the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features to obtain at least one class;
[0026] For each candidate feature, determine the intra-class collinearity parameter when fitting the feature vector corresponding to each candidate feature through the feature vector in the class to which it belongs;
[0027] For each candidate feature, determining an inter-class collinearity parameter when fitting a feature vector corresponding to each candidate feature through a feature vector outside the class to which it belongs;
[0028] From the candidate features included in each category, the target features whose differences between the corresponding intra-class collinearity parameters and inter-class collinearity parameters meet the collinearity difference conditions are screened out.
[0029] The feature processing method, device, computer-readable storage medium and computer equipment described above obtain feature vectors corresponding to different candidate features and corresponding to the sample user sequence, and cluster the corresponding candidate features according to the feature vectors corresponding to each candidate feature to obtain at least one class. In this way, candidate features with commonality can be clustered into one class. For each candidate feature, the intra-class collinearity parameters when fitting the feature vector corresponding to each candidate feature through the feature vector within the class to which it belongs, and the inter-class collinearity parameters when fitting the feature vector corresponding to each candidate feature through the feature vector outside the class to which it belongs are determined. Then, from the candidate features included in each class, the target features whose differences between the corresponding intra-class collinearity parameters and the inter-class collinearity parameters meet the collinearity difference conditions are screened out. In this way, from a class of candidate features with commonality, target features that are representative within the class and discriminative between classes can be screened out as input features for subsequent training of machine learning models. In this way, by adopting the delinear feature screening method, representative target features can be selected from a class of common candidate features for modeling. That is, from the high-dimensional candidate features, a high-quality feature subset that is most descriptive of the target can be screened out, and the screened feature subset can be used to train a stable and interpretable machine learning model. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 An application environment diagram of a feature processing method in an embodiment;
[0031] Figure 2 is a flow chart of a feature processing method in one embodiment;
[0032] Figure 3 A schematic flow chart of a step of obtaining feature vectors corresponding to different candidate features and corresponding to a sample user sequence in one embodiment;
[0033] Figure 4A schematic diagram of a flow chart of the steps of pushing promotion information to target users in one embodiment;
[0034] Figure 5 A schematic diagram of the principle of constructing a credit score card in one embodiment;
[0035] Figure 6 A schematic diagram of a feature screening process in one embodiment;
[0036] Figure 7 is a flow chart of a feature processing method in one embodiment;
[0037] Figure 8 is a structural block diagram of a feature processing device in one embodiment;
[0038] Fig. 9 is a structural block diagram of a feature processing device in another embodiment;
[0039] Fig.10 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0041] Figure 1 FIG. 1 is an application environment diagram of a feature processing method in an embodiment. Figure 1 , the feature processing method is applied to a feature processing system. The feature processing system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected via a network. The terminal 110 may be a desktop terminal or a mobile terminal, and the mobile terminal may be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The server 120 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0042] In one embodiment, the feature processing method can be specifically applied to the terminal 110 or the server 120. For example, the terminal 110 can directly obtain the feature vector corresponding to the candidate feature and execute the feature processing method. Alternatively, the server 120 can obtain the candidate sample user data sent by the terminal 110, and then calculate the feature vectors corresponding to each of the candidate features according to the candidate sample user data, so as to execute the feature processing method.
[0043] like Figure 2 As shown, in one embodiment, a feature processing method is provided. This embodiment mainly applies this method to the above Figure 1The terminal 110 or the server 120 in FIG. 1 is used as an example to illustrate (wherein the terminal 110 or the server 120 can be referred to as a computer device). Figure 2 , the feature processing method specifically includes the following steps:
[0044] S202, obtaining feature vectors corresponding to different candidate features and corresponding to the sample user sequence.
[0045] Among them, candidate features are a collection of user features, which can be used as candidate features for target features. User features are characteristics of users, which may specifically include user attributes and user behavior features. User attributes are a characteristic inherent to users, such as the user's age, gender, native place, or place of residence; user behavior features are characteristics obtained by summarizing user behavior data, such as the device model used by the user to log in to the account, the operating system corresponding to the device, the corresponding network identifier, and the user's reading activity, game activity, payment activity, payment activity, etc. In one embodiment, candidate features can be used as candidate features for features used to train machine learning models.
[0046] The sample user sequence is a sequence composed of more than one sample users in a certain order. The certain order may be the order of the labels corresponding to the sample users or other specified order. A feature vector is a set of vector data used to represent a feature.
[0047] Specifically, the computer device may obtain feature vectors corresponding to different candidate features and corresponding to the sample user sequence from a local or other computer device. In one embodiment, the number of dimensions of the feature vector is the same as the number of sample users, which can be understood as each sample user corresponding to a dimension of a feature vector. The direction of the feature vector corresponding to each candidate feature corresponds to the sequence order of the sample user sequence. In other words, for feature vectors corresponding to different candidate features, the values under the same dimension correspond to the same sample user.
[0048] In one embodiment, step S202, i.e., the step of obtaining feature vectors corresponding to different candidate features and corresponding to the sample user sequence, specifically includes the following steps:
[0049] S302, obtaining candidate sample user data corresponding to more than one sample user respectively; the candidate sample user data includes user feature data corresponding to different candidate features respectively, and corresponding category labels.
[0050] Among them, the candidate sample user data is the user data corresponding to the sample user under the dimension of the candidate feature, which may specifically include the user feature data of the sample user and the category label corresponding to the sample user. Among them, the user feature data includes the user's age data, gender data, payment activity data, or payment activity data. The category label may specifically include a response label and an unresponse label, wherein the response label refers to the label of the sample user's response to a certain behavior; the unresponse label is the label of the sample user's unresponse to a certain behavior. For example, when an advertisement is pushed to a user, the user clicks on the advertisement, which can be called the user's response to the behavior, then the category label corresponding to the user is the response label, which can be represented by the number 1. Correspondingly, the user's failure to click on the advertisement is called the user's failure to respond to the behavior, then the category label corresponding to the user is the unresponse label, which can be represented by the number 0.
[0051] For example, the candidate sample user data corresponding to the sample user, for example, user 1 is 26 years old, male, the model of the login device for a certain application is Huawei P20, the corresponding operating system is Android, the payment activity is high, the collection activity is high, and the user clicks on the advertisement. Then, age, gender, login device model, login device operating system, payment activity, and collection activity are different candidate features, and 26 years old, male, Huawei P20, Android system, high, and high are the user feature data corresponding to different candidate features. The number "1" corresponding to "user clicks on the advertisement" is the corresponding category label of user 1.
[0052] Specifically, the computer device may obtain candidate sample user data corresponding to more than one sample user from a local or other computer device. In one embodiment, the computer device may obtain user data provided by multiple data source platforms, align the user data provided by the multiple data source platforms according to the user identifier, and filter out user feature data corresponding to different candidate features and corresponding category labels.
[0053] S304: For each sample user, determine feature code values corresponding to different candidate features according to corresponding user feature data and category labels.
[0054] Specifically, for the user feature data corresponding to each sample user under the dimensions of different candidate features, the computer device can encode the user feature data according to the category label corresponding to the sample user to obtain the corresponding feature encoding value. In this way, by encoding, the computer device can convert the user feature data corresponding to the sample user and corresponding to different candidate features from string data to vector data that is easy to calculate.
[0055] In one embodiment, the computer device may encode the user feature data using a WOE (Weight of Evidence) method to obtain a corresponding feature encoding value.
[0056] In one embodiment, step S304 specifically includes the following steps: for each candidate feature, segment each candidate feature according to the data range corresponding to each candidate feature to obtain candidate feature sub-segments; determine the feature coding values corresponding to each candidate feature sub-segment according to the number of sample users whose user feature data is within the data range of each candidate feature sub-segment, and the corresponding category labels; for each sample user, use the feature coding values corresponding to the candidate feature sub-segments corresponding to the candidate sample user data corresponding to different candidate features as the feature coding values corresponding to the different candidate features.
[0057] Specifically, the computer device can segment each candidate feature according to a preset segmentation rule to obtain a corresponding candidate feature sub-segment. The preset segmentation rule can be segmented manually based on experience according to the data range of each candidate feature sub-segment, or segmented by a preset segmentation algorithm (such as an algorithm based on a decision tree), so that the division of the candidate feature sub-segments is more optimized.
[0058] For example, for the candidate feature "age", the data range corresponding to the candidate feature is determined to be 10 to 50 years old based on the user feature data corresponding to the sample user. Then, the computer device can divide "age" into the following sub-segments (also called groups) according to the preset rules: 10 to 18 years old is age group A; 19 to 25 years old is age group B; 26 to 35 years old is age group C; 35 to 50 years old is age group D. For another example, for the candidate feature "gender", the user feature data corresponding to the sample user is male or female, and the computer device can divide "gender" into the following sub-segments (also called groups) according to the preset rules: male is gender group A; female is gender group B.
[0059] Furthermore, the computer device may calculate the feature coding value corresponding to the candidate feature sub-segment in the following manner: when the category label corresponding to the sample user is a response label, the corresponding sample user may be referred to as a response user; when the category label corresponding to the sample user is a non-response label, the corresponding sample user may be referred to as a non-response user. For each candidate feature sub-segment, the computer device may calculate a first ratio of the number of responding users corresponding to each candidate feature sub-segment to the number of all responding users, and a second ratio of the number of non-responding users corresponding to each candidate feature sub-segment to the number of all non-responding users. The quotient of the first ratio and the second ratio is used as the corresponding feature coding value, or the value obtained by taking the logarithm of the quotient of the first ratio and the second ratio is used as the corresponding feature coding value.
[0060] In one embodiment, the computer device may calculate the feature code value corresponding to each candidate feature sub-segment by the following formula: Among them, i is the candidate feature sub-segment i; x i is the user feature data within the data range of the candidate feature sub-segment i; P(x i ) is the first ratio of the number of responding users corresponding to the candidate feature sub-segment to the number of all responding users; Q(x i ) is the second ratio of the number of non-responding users corresponding to the candidate feature sub-segment to the number of all non-responding users. log is a logarithm operation.
[0061] Furthermore, for each sample user, the computer device may determine the candidate feature sub-segment corresponding to the candidate sample user data corresponding to each candidate feature, and use the feature coding value corresponding to the candidate feature sub-segment as the feature coding value of the sample user in the dimension of the candidate feature. For example, when the computer device calculates that the feature coding value corresponding to age group A (10-18 years old) is WOE_A (where WOE_A is the corresponding calculated value), then when the age of sample user 1 is 15 years old, 15 years old just falls within the range of age group A, then the feature coding value corresponding to sample user 1 in the age dimension is WOE_A.
[0062] In the above embodiment, the feature coding values corresponding to each candidate feature sub-segment are determined according to the number of sample users whose user feature data is within the data range of each candidate feature sub-segment and the corresponding category label. For each sample user, the feature coding values corresponding to the candidate feature sub-segments corresponding to the candidate sample user data corresponding to different candidate features are used as the feature coding values corresponding to the different candidate features, so that the candidate sample user data in the string format can be quickly and accurately converted into the feature coding values in the floating point format, and the data characteristics of the candidate sample user data can be fully mined, and the data that cannot be calculated can be converted into data that can be measured, which greatly improves the convenience and accuracy of subsequent data processing.
[0063] S306 , for each candidate feature, concatenate the feature code value corresponding to each sample user according to the arrangement order of the sample users to obtain a feature vector corresponding to the sample user sequence.
[0064] Specifically, after the computer device calculates the feature coding values of each candidate feature corresponding to each sample user, for each candidate feature, the feature coding values corresponding to each sample user can be concatenated according to the arrangement order of the sample users to obtain a feature vector corresponding to the sample user sequence. That is, the value of each vector dimension in the feature vector corresponding to the candidate feature is equal to the feature coding value of the corresponding sample user under the dimension of the candidate feature.
[0065] In the above embodiment, for each sample user, the feature coding values corresponding to different candidate features are determined according to the corresponding user feature data and category labels, and then for each candidate feature, the feature coding values corresponding to each sample user are concatenated according to the arrangement order of the sample users to obtain a feature vector corresponding to the sample user sequence. In this way, a feature vector that can accurately characterize the candidate category can be obtained based on the candidate sample user data, which is convenient for subsequent calculations.
[0066] S204: Clustering the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features to obtain at least one class.
[0067] Among them, clustering is the process of dividing more than one data objects into multiple classes consisting of similar data objects. The class generated by clustering is a collection of a group of data objects. Data objects in the same class are similar to each other, and data objects in different classes are different from each other.
[0068] Specifically, the computer device can perform clustering processing on the corresponding candidate features according to the feature vectors corresponding to each candidate feature, and cluster similar candidate features into one class. Among them, the clustering algorithm used for clustering the candidate features can be specifically a K-means clustering algorithm, a mean shift clustering algorithm, or a density-based clustering method, etc., which is not limited here. Taking the K-means clustering algorithm as an example, the computer device can initially randomly group the candidate features and randomly initialize the center points corresponding to each group. Among them, the center point is the point with the same distance as each feature vector. Further calculate the distance from each feature vector to the center point, and the feature vector is divided into which class it is closest to. Repeat the calculation of the center point in each class as the new center point. Repeat the above steps and iteratively calculate until the center point of each class is stable after each iteration. In this way, one or more classes can be obtained after the iteration is stable.
[0069] S206: For each candidate feature, determine the intra-class collinearity parameter when fitting the feature vector corresponding to each candidate feature through the feature vector in the class to which it belongs.
[0070] The intra-class collinearity parameter is a parameter reflecting the collinearity between the candidate feature and the intra-class candidate feature in the class to which it belongs. Specifically, the computer device can traverse each candidate feature in each class, and for each candidate feature, the corresponding intra-class collinearity parameter is calculated in the following manner: determine the class to which the candidate feature belongs, fit the candidate feature through other candidate features in the class except the candidate feature, and calculate the intra-class collinearity parameter corresponding to the candidate feature according to the degree of fitting.
[0071] In one embodiment, the larger the intra-class collinearity parameter is, the better the degree of fit when the feature vector corresponding to the candidate feature is fitted by the feature vector in the class to which the candidate feature belongs, that is, the stronger the collinearity between the candidate feature and other candidate features in the class to which it belongs. Of course, the relationship between the size of the intra-class collinearity parameter and the corresponding collinearity strength may also be negatively correlated, which is not limited here.
[0072] In one embodiment, step S206, that is, for each candidate feature, the step of determining the intra-class collinearity parameter when fitting the feature vector corresponding to each candidate feature through the feature vector within the class to which it belongs specifically includes the following steps: traversing each candidate feature included in each class respectively; determining the intra-class candidate features other than the currently traversed candidate feature in the class to which the currently traversed candidate feature belongs; performing linear fitting on the feature vector corresponding to the currently traversed candidate feature through the feature vector corresponding to the intra-class candidate feature to obtain a corresponding intra-class fitting function; determining the intra-class collinearity parameter corresponding to the intra-class fitting function and used to characterize the degree of fitting.
[0073] Specifically, the computer device may traverse each candidate feature included in each class, and determine the intra-class candidate features other than the currently traversed candidate feature in the class to which the currently traversed candidate feature belongs. The feature vector corresponding to the intra-class candidate feature is linearly fitted to the feature vector corresponding to the currently traversed candidate feature to obtain a corresponding intra-class fitting function. The computer device may determine an intra-class collinearity parameter corresponding to the intra-class fitting function and used to characterize the degree of fitting.
[0074] In one embodiment, the computer device may use a least squares linear regression algorithm or other regression algorithms to perform a linear fitting operation. Linear fitting is performed on the feature vector corresponding to the currently traversed candidate feature, and the corresponding intra-class fitting function may be expressed by the following formula:
[0075] x i (k) =∑ l≠i x l (k) *w l +w0;
[0076] Among them, x i (k) is the feature vector of the i-th candidate feature in the k-th class; x l (k) is the feature vector of the lth candidate feature in the kth class; w l is the corresponding coefficient; w0 is the constant term; ∑ l≠i x l (k) *w lIt is an operation of multiplying the feature vectors of other candidate features in the kth class except the i-th candidate feature by the corresponding coefficients and then summing them.
[0077] Furthermore, the computer device can determine the corresponding determination coefficient R according to the intra-class fitting function. 2 , which can also be called goodness of fit. 2 is an indicator of the degree of linear fit, R 2 The size can reflect the degree of fit between the estimated value of the trend line and the corresponding actual data. The higher the degree of fit, the higher the reliability of the trend line. 2 The value range is generally between 0 and 1. 2 When it is equal to 1 or close to 1, the degree of fit is the highest, otherwise the degree of fit is low. A high degree of fit indicates that the collinearity between the candidate feature and the candidate features within the class is strong.
[0078] In statistics, R 2 The calculation method of is as follows: Let y be the value to be fitted (that is, the eigenvector to be fitted), and its mean is The fitted value is y'; then the total sum of squares Regression sum of squares Residual sum of squares And SST=SSR+SSE. Then
[0079] When the computer device calculates R according to the in-class fitting function 2 After that, the corresponding intra-class collinearity parameter for characterizing the degree of fit can be determined. In one embodiment, the intra-class collinearity parameter is positively correlated with the coefficient of determination. In one embodiment, the computer device can calculate the variance inflation factor within the class according to the following formula: And the variance inflation factor VIF within the class in as the intra-class collinearity parameter.
[0080] In the above embodiment, the feature vector corresponding to the candidate feature in the class to which the currently traversed candidate feature belongs is linearly fitted to obtain a corresponding intra-class fitting function, and then the intra-class collinearity parameter corresponding to the intra-class fitting function and used to characterize the degree of fitting can be determined. In this way, the intra-class collinearity corresponding to each candidate feature can be conveniently and accurately determined.
[0081] S208 , for each candidate feature, determining an inter-class collinearity parameter when fitting a feature vector corresponding to each candidate feature through a feature vector outside the class to which it belongs.
[0082] Among them, the inter-class collinearity parameter is a parameter reflecting the collinearity between the candidate feature and the candidate features outside the class to which it belongs. Specifically, the computer device can traverse each candidate feature in each class, and for each candidate feature, the corresponding inter-class collinearity parameter is calculated in the following manner: determine the class to which the candidate feature belongs, fit the feature vector corresponding to the candidate feature through the feature vector corresponding to the candidate feature included in the different class different from the class, and calculate the inter-class collinearity parameter corresponding to the candidate feature according to the degree of fitting.
[0083] In one embodiment, for each candidate feature, the computer device may fit the candidate feature through all other candidate features except the class to which the candidate feature belongs, thereby calculating the inter-class collinearity parameter of the candidate feature. Sometimes, in order to improve the efficiency of calculation, the computer device may also determine a heterogeneous class different from the class to which the candidate feature belongs, select a most representative candidate feature from each heterogeneous class (for example, the candidate parameter corresponding to the maximum value of the intra-class collinearity parameter in the class, or the cluster center feature of each heterogeneous class, etc.), fit the candidate feature through the most representative candidate feature in each heterogeneous class, thereby calculating the inter-class collinearity parameter of the candidate feature. Alternatively, the computer device may also determine the closest heterogeneous class among the heterogeneous classes different from the class to which the candidate feature belongs, fit the candidate feature according to the candidate features included in the closest heterogeneous class, thereby calculating the inter-class collinearity parameter of the candidate feature.
[0084] In one embodiment, for each candidate feature, the computer device determines the corresponding inter-class fitting function by fitting the feature vector corresponding to each candidate feature with the feature vector outside the class to which the candidate feature belongs. Then, the inter-class collinearity parameter corresponding to the candidate feature can be calculated according to the obtained inter-class fitting function using a calculation method corresponding to intra-class collinearity. That is, according to the inter-class fitting function, the corresponding determination coefficient R is determined. 2 , and then calculate the variance inflation factor between classes according to the following formula The variance inflation factor VIF between classes out As the inter-class collinearity parameter corresponding to the candidate feature.
[0085] In one embodiment, the larger the inter-class collinearity parameter is, the better the degree of fit when the feature vector corresponding to the candidate feature is fitted by the feature vector corresponding to the different class from the class, that is, the stronger the collinearity between the candidate feature and other candidate features in the different class is. Of course, the relationship between the size of the inter-class collinearity parameter and the corresponding collinearity strength can also be negatively correlated, which is not limited here.
[0086] S210, selecting target features whose differences between corresponding intra-class collinearity parameters and inter-class collinearity parameters meet the collinearity difference condition from the candidate features included in each class.
[0087] Specifically, for each candidate feature in each category, after the computer device calculates the intra-class collinearity parameter and the inter-class collinearity parameter corresponding to each candidate feature, the difference between the intra-class collinearity parameter and the inter-class collinearity parameter is determined, and the target features whose differences meet the collinearity difference conditions are screened out from the candidate features included in each category.
[0088] Among them, the difference between the intra-class collinearity parameter and the inter-class collinearity parameter can be specifically measured by the difference or ratio between the intra-class collinearity parameter and the inter-class collinearity parameter. Accordingly, the target feature that meets the collinearity difference condition must be a candidate feature with a large difference between the intra-class collinearity parameter and the inter-class collinearity parameter. When the difference between the intra-class collinearity parameter and the inter-class collinearity parameter is measured by the difference between the intra-class collinearity parameter and the inter-class collinearity parameter, the collinearity difference condition can specifically be that the difference reaches a preset threshold, or the difference is the maximum value among the differences corresponding to the candidate features included in the class. When the difference between the intra-class collinearity parameter and the inter-class collinearity parameter is measured by the ratio between the intra-class collinearity parameter and the inter-class collinearity parameter, the collinearity difference condition can specifically be that the ratio reaches a preset threshold, or the ratio is the extreme value (maximum value or minimum value) among the ratios corresponding to the candidate features included in the class.
[0089] In one embodiment, for each class, the computer device may screen out the target feature from the candidate features included in each class. The screened target feature has a smaller inter-class collinearity parameter and a larger intra-class collinearity parameter, that is, the target feature has a stronger collinearity with the candidate features within the class, and a weaker collinearity with the candidate features outside the class.
[0090] The above-mentioned feature processing method obtains feature vectors corresponding to different candidate features and corresponding to the sample user sequence, and clusters the corresponding candidate features according to the feature vectors corresponding to each candidate feature to obtain at least one class. In this way, candidate features with commonality can be clustered into one class. For each candidate feature, determine the intra-class collinearity parameters when fitting the feature vector corresponding to each candidate feature through the feature vector within the class to which it belongs, and determine the inter-class collinearity parameters when fitting the feature vector corresponding to each candidate feature through the feature vector outside the class to which it belongs. Then, from the candidate features included in each class, select the target features whose differences between the corresponding intra-class collinearity parameters and inter-class collinearity parameters meet the collinearity difference conditions. In this way, from a class of candidate features with commonality, target features that are representative within the class and discriminative between classes can be selected as input features for subsequent training of machine learning models. In this way, by adopting the delinear feature screening method, representative target features can be selected from a class of common candidate features for modeling. That is, from the high-dimensional candidate features, a high-quality feature subset that is most descriptive of the target can be screened out, and the screened feature subset can be used to train a stable and interpretable machine learning model.
[0091] In one embodiment, step S208, that is, for each candidate feature, determining the inter-class collinearity parameter when fitting the feature vector corresponding to each candidate feature through the feature vector outside the class to which it belongs, specifically includes the following steps: traversing each candidate feature included in each class respectively; determining the heterogeneous classes that are different from the class to which the currently traversed candidate feature belongs; determining the distance between the class to which the currently traversed candidate feature belongs and each heterogeneous class; obtaining the heterogeneous classes corresponding to the distances that are less than or equal to the threshold after ranking in descending order; linearly fitting the feature vector corresponding to the currently traversed candidate feature through the feature vector corresponding to the obtained candidate feature included in the heterogeneous class to obtain a corresponding inter-class fitting function; determining the inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting.
[0092] Specifically, the computer device may traverse each candidate feature included in each category respectively, and determine the heterogeneous class different from the class to which the candidate feature currently traversed belongs. Among them, the heterogeneous class different from the class to which the candidate feature currently traversed belongs refers to other classes except the class to which the candidate feature currently traversed belongs. The computer device may calculate the distance between the class to which the candidate feature currently traversed belongs and each heterogeneous class according to the feature vectors of the candidate features included in each category. Sort the distances from short to long, and take the heterogeneous class corresponding to the first or first N (N is a preset threshold) with the shortest distance. Through the feature vectors corresponding to each candidate feature in the heterogeneous class corresponding to the first or first N with the shortest distance in the class, the feature vector corresponding to the candidate feature currently traversed is linearly fitted to obtain the corresponding inter-class fitting function. The computer device may determine the inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting. In this way, each candidate feature in a different class corresponding to the previous one or the top N with the shortest distance to the class can be used as a representative of the candidate features outside the class to which the traversed candidate features belong, which greatly reduces the calculation of the inter-class collinearity parameter.
[0093] In one embodiment, the distance between classes can be calculated by the feature vectors corresponding to the candidate features included in each class. The computer device can calculate the cluster center points of each class based on the feature vectors corresponding to the candidate features included in each class, and use the distance between the cluster center points as the distance between classes. Alternatively, the computer device can also directly calculate the Euclidean distance between two classes based on the feature vectors corresponding to the candidate features included in each class. Among them, the "distance" mentioned in the above embodiment, when it involves the "distance" obtained by vector calculation, can specifically be the Euclidean distance or the vector cosine distance, etc.
[0094] In one embodiment, the computer device may use a least squares linear regression algorithm or other regression algorithms to perform a linear fitting operation. Linear fitting is performed on the feature vector corresponding to the currently traversed candidate feature, and the corresponding inter-class fitting function may be expressed by the following formula:
[0095] x i (k) =∑ l x l (k1) *w l +w0;
[0096] Among them, x i (k) is the feature vector of the i-th candidate feature in the k-th class; x l (k1) is the feature vector of the lth candidate feature in the k1th class; w l is the corresponding coefficient; w0 is the constant term. l x l(k1) *w l The feature vectors of each candidate feature in the k1th class are multiplied by the corresponding coefficients and then summed. The k1th class is the class closest to the kth class.
[0097] Furthermore, the computer device can determine the corresponding determination coefficient R according to the inter-class fitting function. 2 , which can also be called goodness of fit. 2 is an indicator of the degree of linear fit, R 2 The size can reflect the degree of fit between the estimated value of the trend line and the corresponding actual data. The higher the degree of fit, the higher the reliability of the trend line. 2 The value range is generally between 0 and 1. 2 When it is equal to 1 or close to 1, the degree of fit is the highest, otherwise the degree of fit is low. A high degree of fit indicates that the collinearity between the candidate feature and the candidate features within the class is strong.
[0098] When the computer device calculates R based on the inter-class fitting function 2 After that, the corresponding inter-class collinearity parameter for characterizing the degree of fit can be determined. In one embodiment, the inter-class collinearity parameter is positively correlated with the coefficient of determination. In one embodiment, the computer device can calculate the variance inflation factor between classes according to the following formula: The variance inflation factor VIF between classes out as the inter-class collinearity parameter.
[0099] In the above embodiment, the first few heterogeneous classes with the shortest distance to the class to which the currently traversed candidate feature belongs are obtained, and then the feature vectors corresponding to the currently traversed candidate feature are linearly fitted through the feature vectors corresponding to the candidate features included in the obtained heterogeneous classes, so as to obtain the corresponding inter-class fitting function, and then the inter-class collinearity parameters corresponding to the candidate feature are calculated according to the inter-class fitting function. In this way, the inter-class collinearity corresponding to each candidate feature can be conveniently and accurately determined.
[0100] In one embodiment, step S208, that is, for each candidate feature, the step of determining the inter-class collinearity parameter when fitting the feature vector corresponding to each candidate feature through the feature vector outside the class to which it belongs, specifically includes the following steps: traversing each candidate feature included in each class respectively; determining a different class different from the class to which the currently traversed candidate feature belongs; calculating the corresponding cluster center vector of each different class according to the feature vector corresponding to the candidate feature included in each different class; performing linear fitting on the feature vector corresponding to the currently traversed candidate feature through the cluster center vector to obtain the corresponding inter-class fitting function; determining the inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting.
[0101] Specifically, the computer device can traverse each candidate feature included in each class respectively, and determine the heterogeneous class that is different from the class to which the currently traversed candidate feature belongs. Among them, the heterogeneous class that is different from the class to which the currently traversed candidate feature belongs refers to other classes except the class to which the currently traversed candidate feature belongs. The computer device can calculate the cluster center vector corresponding to each heterogeneous class based on the feature vector of the candidate feature included in each heterogeneous class. Through the cluster center vector corresponding to each heterogeneous class, the feature vector corresponding to the currently traversed candidate feature is linearly fitted to obtain the corresponding inter-class fitting function. The computer device can determine the inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting. In this way, the cluster center vector of each heterogeneous class can be used as a representative of the candidate feature outside the class to which the traversed candidate feature belongs, which greatly reduces the calculation of the inter-class collinearity parameter.
[0102] The calculation method of the cluster center vector may correspond to the clustering algorithm. For example, when the computer device uses the K-means clustering algorithm to cluster the candidate features, when the clustering is completed, the cluster center points of the corresponding categories are stable cluster center points after iterative calculation, and the feature vector of the cluster center point is also the cluster center vector. Alternatively, the computer device may also comprehensively determine the cluster center vector by calculating the relationship between the cluster density and the distance between the candidate features in each category.
[0103] In one embodiment, the computer device may determine the corresponding determination coefficient R according to the inter-class fitting function. 2 , which can also be called goodness of fit. 2 is an indicator of the degree of linear fit, R 2 The size can reflect the degree of fit between the estimated value of the trend line and the corresponding actual data. The higher the degree of fit, the higher the reliability of the trend line.
[0104] When the computer device calculates R based on the inter-class fitting function 2 After that, the corresponding inter-class collinearity parameter for characterizing the degree of fit can be determined. In one embodiment, the inter-class collinearity parameter is positively correlated with the coefficient of determination. In one embodiment, the computer device can calculate the variance inflation factor between classes according to the following formula: The variance inflation factor VIF between classes out as the inter-class collinearity parameter.
[0105] In the above embodiment, different classes different from the class to which the candidate feature currently traversed belongs are determined, and the feature vector corresponding to the candidate feature currently traversed is linearly fitted through the cluster center vectors corresponding to each different class, thereby obtaining the corresponding inter-class fitting function, and then calculating the inter-class collinearity parameter corresponding to the candidate feature according to the inter-class fitting function. In this way, the inter-class collinearity corresponding to each candidate feature can be conveniently and accurately determined.
[0106] In one embodiment, step S210, that is, the step of selecting target features whose differences between corresponding intra-class collinearity parameters and inter-class collinearity parameters meet the collinearity difference condition from the candidate features included in each category, specifically includes the following steps: determining an objective function for maximizing the difference between intra-class collinearity parameters and inter-class collinearity parameters corresponding to the candidate features; selecting target features that make the value of the corresponding objective function the maximum or minimum value from the candidate features included in each category.
[0107] Among them, the objective function is to use design variables to represent the target form pursued, so the objective function is a function of the design variables, which is a scalar. In this embodiment, the design variables can specifically be intra-class collinearity parameters and inter-class collinearity parameters. The objective function is a function used to determine the maximum difference between the intra-class collinearity parameters and the inter-class collinearity parameters. The process of establishing the objective function is the process of finding the relationship between the design variables and the target. The relationship between the objective function and the design variables can be represented by a curve, a surface or a hypersurface.
[0108] In one embodiment, assuming that VIF in represents the intra-class collinearity parameter, VIF out represents the inter-class collinearity parameter, and the objective function can be specifically expressed as y=f(VIF in ,VIF out ), for example, it can be This form, or y = VIF in -VIF out Such a form.
[0109] Furthermore, the computer device can calculate the value of the corresponding objective function according to the intra-class collinearity parameter and the inter-class collinearity parameter corresponding to each candidate feature, and sort the candidate features in each class in descending order according to the value of the objective function. The candidate feature ranked first or last in each class is taken as the target feature of the class.
[0110] In one embodiment, when the objective function is In the form of, in each class, the computer device can sort the candidate features from small to large according to the value of the objective function corresponding to each candidate feature, and take the candidate feature corresponding to the minimum value of the objective function as the target feature representing the class. That is, the candidate features with larger intra-class collinearity parameters and smaller inter-class collinearity parameters are selected as the target features. It can be understood that when the objective function is In the form of, within each class, the computer device can sort the candidate features from small to large according to the value of the objective function corresponding to each candidate feature, and take the candidate feature corresponding to the maximum value of the objective function as the target feature representing the class. Similarly, when the objective function is y=VIF in -VIF out In this form, within each class, the computer device takes the candidate feature corresponding to the maximum value of the objective function as the target feature representing the class to which it belongs.
[0111] In the above embodiment, an objective function for maximizing the difference between the intra-class collinearity parameter and the inter-class collinearity parameter corresponding to the candidate features is determined, and then the target features that make the value of the corresponding objective function the maximum or minimum value are screened out from the candidate features included in each category. The target features in each category can be quickly and accurately screened out through the objective function.
[0112] In one embodiment, the feature processing method also includes the step of training a machine learning model using target sample user data corresponding to the target feature, which step specifically includes: obtaining target sample user data corresponding to the sample user; the target sample user data includes user feature data corresponding to the target feature, and corresponding category labels; based on the user feature data corresponding to the target feature, and the corresponding category labels, training a machine learning model for performing business evaluation on the user.
[0113] Specifically, the computer device may filter out target sample user data from the candidate sample user data. The filtered target sample user data includes user feature data corresponding to the target feature and a corresponding category label. Furthermore, the computer device may train a machine learning model for business evaluation of the user based on the user feature data corresponding to the target feature and the corresponding category label. The machine learning model may specifically be a logistic regression model.
[0114] Among them, according to the user feature data corresponding to the target feature and the corresponding category label, the steps of training the machine learning model are specifically as follows: inputting the user feature data corresponding to the target feature into the machine learning model to obtain an intermediate result, and adjusting the model parameters in the direction of reducing the difference according to the difference between the intermediate result and the corresponding category label, until the training is stopped when the training stop condition is reached. Among them, the training stop condition is the condition for ending the model training. The training stop condition can be reaching a preset number of iterations, or the performance index of the machine learning model after adjusting the model parameters reaches a preset index.
[0115] In one embodiment, the machine learning model is used to perform business evaluation on users. That is, the probability of a user responding to a certain behavior can be predicted based on the user's user feature data. In one embodiment, the category labels corresponding to the sample users specifically include response labels (indicating that the user responds to a certain behavior, such as clicking on an advertisement or purchasing a product, etc., which can be set to 1) and non-response labels (indicating that the user does not respond to a certain behavior, such as not clicking on an advertisement or not purchasing a product, etc., which can be set to 0). After the machine learning model is trained with the user feature data corresponding to the target feature and the corresponding category labels, the machine learning model can acquire the ability to perform business evaluation on users. For example, after the user feature data corresponding to the user is input into the trained machine learning model, the value of predicting the user's behavior can be output by the machine learning model, specifically in the range of 0 to 1. This value can represent the probability value of the user responding to a certain behavior, which can be used to perform business evaluation on the user.
[0116] In the above embodiment, the user feature data corresponding to the target feature obtained after the collinearity removal process is used as training data to train the machine learning model, so that a model with stable model parameters and interpretability can be trained.
[0117] In one embodiment, the feature processing method further includes the step of pushing promotion information to the target user, which specifically includes the following steps:
[0118] S402, obtaining user feature data to be processed corresponding to the target feature and the target user.
[0119] Specifically, the computer device may obtain the user feature data to be processed corresponding to the target feature and the target user from the local or other computer devices. In one embodiment, the computer device obtains the user feature data of the target user in the dimensions of different candidate features, and then selects the user feature data of each target user in the target feature dimension from the user feature data as the user feature data to be processed to be input into the model.
[0120] S404: Input the user feature data to be processed into the trained machine learning model for processing to obtain a business evaluation score corresponding to the target user.
[0121] Specifically, the computer device may input the to-be-processed user feature data into a trained machine learning model for processing, and output a business evaluation score for business evaluation of the target user through the trained machine learning model.
[0122] In one embodiment, the trained machine learning model can output a probability value for predicting the target user's response to a certain behavior, and then convert the probability value into a corresponding business evaluation score based on the conversion relationship between the probability value and the score.
[0123] For example, a trained machine learning model can be used to score a user's credit. First, the trained machine learning model processes the user's feature data and outputs the probability value corresponding to the user. The larger the probability value, the higher the possibility that the user is trustworthy. The probability value is then converted into a corresponding credit score. Among them, the probability value and the credit score are positively correlated.
[0124] S406: Push corresponding promotion information to the terminal corresponding to the target user whose service evaluation score reaches the preset score.
[0125] Among them, promotional information is the online communication medium of the promotion object, and the promotional information can be text, pictures, videos, or link addresses. Computer devices can use text description, picture display, or video presentation to show the object to be promoted to the target user. The promotion object can be, for example, an application to be downloaded, a product to be purchased, or an invitation for a specific behavior.
[0126] Specifically, the computer device may push corresponding promotion information to the terminal corresponding to the target user whose business evaluation score reaches the preset score. In one embodiment, the computer device may set the corresponding preset score according to the actual business situation corresponding to the source of the promotion information to determine the target user.
[0127] In one embodiment, the computer device may collect feedback from target users after receiving promotional information, and analyze the feedback to adjust the weights corresponding to the corresponding target features in the machine learning model.
[0128] In a specific application scenario, taking the risk control scenario of loan account opening as an example, the computer device can obtain the user feature data of the sample user under the target feature dimension and the corresponding category label from the data source platform. Among them, the data source platform includes user feature data from multiple sources. Through the user feature data corresponding to the target feature and the corresponding category label, the machine learning model is trained to obtain a machine learning model that is interpretable at the development layer and can accurately estimate the user's overdue risk.
[0129] Furthermore, after the model is trained, the computer device can input the user feature data of the target user under the dimension of the target feature into the trained machine learning model. The target user is credit-scored by the trained machine learning model. That is, based on the distribution of the user's credit score and the fund preparation, high-scoring users are selected to send loan account opening invitations.
[0130] Furthermore, the computer equipment can collect the loan status and default status of the loan accounts opened by the users, analyze the user characteristic data corresponding to the defaulting users, and propose optimization and improvement strategies. For example, the business evaluation score of the target user output by the machine learning model shows a significant positive correlation with age. However, when a 70-year-old user received a push invitation to open a loan account, he opened a loan business, but did not repay the loan as agreed in the end. According to this situation, the staff can adjust the weight corresponding to the age dimension, or retrain the machine learning model to reduce the correlation between the user's age and the corresponding business evaluation score.
[0131] In the above embodiment, the target users are scored through the trained machine learning model to obtain the corresponding business evaluation score, and the corresponding promotion information is pushed to the terminal corresponding to the target user whose business evaluation score reaches the preset score. This can achieve targeted information promotion, avoid invalid promotion, and greatly improve the effectiveness of information promotion.
[0132] In traditional business evaluation of users, existing open source tools are usually used to build distributed high-performance big data storage and computing platforms to mine user characteristics from a large amount of user data. For example, various user characteristics such as age and education level are extracted from user information and daily behavior. When splicing high-dimensional features, a large amount of calculations are performed to estimate user behavior. User behavior, such as whether the user clicks on an advertisement, purchases a product, or has overdue loan behavior, etc.
[0133] For the financial sector, reference Figure 5 , Figure 5 FIG. 2 shows a schematic diagram of the principle of constructing a credit score card in one embodiment. Figure 5As shown in the figure, lending institutions collect data from users during a certain period of time before applying for loans (also known as the observation period), such as the user's age, gender, login location, login device, reading activity, game activity, payment activity, and collection activity. Then obtain the user's repayment performance after borrowing, such as the maximum number of overdue months, whether it is the first invitation, etc. The collected data and repayment performance are used as samples, and a model is established through machine learning methods such as linear regression and decision trees to obtain a credit score card, which is used to estimate the default probability of users who apply for the same product in the future, as a basis for deciding whether to lend to them.
[0134] Although the above-mentioned method of big data mining can predict user behavior to a certain extent, the established model has the problem of being difficult to explain. This is mainly due to the surge in data dimensions caused by the information explosion in the Internet era. Internet companies can collect user information from all aspects. Aggregating these user features will result in very high-dimensional user features. If there is strong collinearity between high-dimensional features, the coefficients in the final model will be unstable, the model's interpretability will be poor, and it will be difficult to troubleshoot and locate abnormal problems.
[0135] The feature processing method in this application selects features with weak collinearity from high-dimensional features as input features. The machine learning model trained with user data corresponding to the selected features is interpretable and can accurately predict user behavior. Figure 6 , Figure 6 FIG. 1 is a flow chart of feature screening in one embodiment. Figure 6 The example in the following describes the scheme of this application in detail:
[0136] First, obtain candidate features corresponding to the sample users, specifically including feature 1, feature 2, feature 3, feature 4, feature 5 and feature 6. After clustering the candidate features, class 1, class 2, and class 3 are obtained. Among them, class 1 includes feature 1, feature 3, and feature 4; class 2 includes feature 2 and feature 5; class 3 includes feature 6. Further, the computer device can respectively fit each feature using the least squares linear regression algorithm to calculate the intra-class VIF (Variance Inflation Factor) and inter-class VIF of each feature. Among them, the fitting method, for example, can fit feature 1 by the following formula: feature1 = w1*feature3+w2*feature4+b. Among them, w1 and w2 are corresponding coefficients, b is a constant; feature1 is the feature vector corresponding to feature 1; feature3 is the feature vector corresponding to feature 3; feature4 is the feature vector corresponding to feature 4. The variance inflation factor used to characterize the degree of fitting is calculated using the following formula:
[0137]
[0138] Furthermore, the computer device can take the most representative feature within each class and the most distinguishing feature between classes as the feature of the class. That is, the larger the VIF within the class, the better, and the smaller the VIF between classes, the better. Specifically, the target feature can be screened out by the ratio of the VIF between classes to the VIF within the class. Among them: The computer device may select the feature with the smallest VIF_ratio in each category as the target feature of that category.
[0139] refer to Figure 7 In a specific embodiment, the feature processing method specifically includes the following steps:
[0140] S702, obtaining candidate sample user data corresponding to each of more than one sample user; the candidate sample user data includes user feature data corresponding to different candidate features, and corresponding category labels.
[0141] S704 , for each candidate feature, segment each candidate feature according to the data range corresponding to each candidate feature to obtain candidate feature sub-segments.
[0142] S706 , determining the feature coding values corresponding to each candidate feature subsegment respectively according to the number of sample users whose user feature data is within the data range of each candidate feature subsegment and the corresponding category label.
[0143] S708: For each sample user, the feature coding values corresponding to the candidate feature sub-segments corresponding to the candidate sample user data corresponding to different candidate features are used as feature coding values corresponding to the different candidate features.
[0144] S710, for each candidate feature, concatenate the feature code value corresponding to each sample user according to the arrangement order of the sample users to obtain a feature vector corresponding to the sample user sequence.
[0145] S712: Cluster the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features to obtain at least one class.
[0146] S714, traverse each candidate feature included in each category respectively.
[0147] S716: Determine the candidate features in the class to which the currently traversed candidate feature belongs, except for the currently traversed candidate feature.
[0148] S718, performing linear fitting on the feature vector corresponding to the candidate feature currently traversed through the feature vector corresponding to the candidate feature within the class, to obtain a corresponding fitting function within the class.
[0149] S720: Determine an intra-class collinearity parameter corresponding to the intra-class fitting function and used to characterize the degree of fitting.
[0150] S722, determining a different class from the class to which the currently traversed candidate feature belongs.
[0151] S724, calculating the cluster center vector corresponding to each heterogeneous class according to the feature vectors corresponding to the candidate features included in each heterogeneous class.
[0152] S726, performing linear fitting on the feature vector corresponding to the currently traversed candidate feature through the cluster center vector to obtain a corresponding inter-class fitting function.
[0153] S728, determining an inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting.
[0154] S730: Determine an objective function for maximizing the difference between the intra-class collinearity parameter and the inter-class collinearity parameter corresponding to the candidate feature.
[0155] S732, select target features that make the value of the corresponding target function the maximum value or the minimum value from the candidate features included in each category.
[0156] S734, obtaining target sample user data corresponding to the sample user; the target sample user data includes user feature data corresponding to the target feature and a corresponding category label.
[0157] S736: Training a machine learning model for business evaluation of users based on the user feature data corresponding to the target feature and the corresponding category label.
[0158] S738, obtaining the to-be-processed user characteristic data corresponding to the target characteristic and the target user.
[0159] S740: Input the user feature data to be processed into the trained machine learning model for processing to obtain a business evaluation score corresponding to the target user.
[0160] S742, push corresponding promotion information to the terminal corresponding to the target user whose business evaluation score reaches the preset score.
[0161] The above-mentioned feature processing method obtains feature vectors corresponding to different candidate features and corresponding to the sample user sequence, and clusters the corresponding candidate features according to the feature vectors corresponding to each candidate feature to obtain at least one class. In this way, candidate features with commonality can be clustered into one class. For each candidate feature, determine the intra-class collinearity parameters when fitting the feature vector corresponding to each candidate feature through the feature vector within the class to which it belongs, and determine the inter-class collinearity parameters when fitting the feature vector corresponding to each candidate feature through the feature vector outside the class to which it belongs. Then, from the candidate features included in each class, select the target features whose differences between the corresponding intra-class collinearity parameters and inter-class collinearity parameters meet the collinearity difference conditions. In this way, from a class of candidate features with commonality, target features that are representative within the class and discriminative between classes can be selected as input features for subsequent training of machine learning models. In this way, by adopting the delinear feature screening method, representative target features can be selected from a class of common candidate features for modeling. That is, from the high-dimensional candidate features, a high-quality feature subset that is most descriptive of the target can be screened out. The screened feature subset can be used to train a stable and highly interpretable machine learning model.
[0162] Figure 7 FIG. 1 is a flow chart of a feature processing method in one embodiment. It should be understood that although Figure 7 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 7 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0163] like Figure 8 As shown, in one embodiment, a feature processing device 800 is provided, including an acquisition module 801 , a clustering module 802 , a determination module 803 and a screening module 804 .
[0164] The acquisition module 801 is used to acquire feature vectors corresponding to different candidate features and corresponding to the sample user sequence.
[0165] The clustering module 802 is used to cluster the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features to obtain at least one class.
[0166] The determination module 803 is used to determine, for each candidate feature, an intra-class collinearity parameter when fitting the feature vector corresponding to each candidate feature through the feature vector in the class to which it belongs.
[0167] The determination module 803 is used to determine, for each candidate feature, an inter-class collinearity parameter when fitting a feature vector corresponding to each candidate feature through a feature vector outside the class to which it belongs.
[0168] The screening module 804 is used to screen out target features whose differences between the corresponding intra-class collinearity parameters and the inter-class collinearity parameters meet the collinearity difference condition from the candidate features included in each class.
[0169] In one embodiment, the acquisition module 801 includes a feature code value determination module 8011 and a splicing module 8012, wherein:
[0170] The feature coding value determination module 8011 is used to obtain candidate sample user data corresponding to more than one sample user; the candidate sample user data includes user feature data corresponding to different candidate features, and corresponding category labels; for each sample user, the feature coding values corresponding to different candidate features are determined according to the corresponding user feature data and category labels.
[0171] The concatenation module 8012 is used to concatenate the feature coding values corresponding to each sample user according to the arrangement order of the sample users for each candidate feature, so as to obtain a feature vector corresponding to the sample user sequence.
[0172] In one embodiment, the feature coding value determination module 8011 is also used to segment each candidate feature according to the data range corresponding to each candidate feature to obtain candidate feature sub-segments; determine the feature coding values corresponding to each candidate feature sub-segment according to the number of sample users whose user feature data is within the data range of each candidate feature sub-segment, and the corresponding category labels; for each sample user, the feature coding values corresponding to the candidate feature sub-segments corresponding to the candidate sample user data corresponding to different candidate features are used as the feature coding values corresponding to the different candidate features.
[0173] In one embodiment, the determination module 803 is also used to traverse each candidate feature included in each category respectively; determine the intra-class candidate features other than the currently traversed candidate feature in the class to which the currently traversed candidate feature belongs; perform linear fitting on the feature vector corresponding to the currently traversed candidate feature through the feature vector corresponding to the intra-class candidate feature to obtain a corresponding intra-class fitting function; determine the intra-class collinearity parameter corresponding to the intra-class fitting function and used to characterize the degree of fitting.
[0174] In one embodiment, the determination module 803 is also used to traverse each candidate feature included in each class respectively; determine the heterogeneous classes that are different from the class to which the currently traversed candidate feature belongs; determine the distances between the class to which the currently traversed candidate feature belongs and each heterogeneous class; obtain the heterogeneous classes corresponding to the distances that are ranked in descending order and are less than or equal to the threshold; perform linear fitting on the feature vectors corresponding to the currently traversed candidate features by obtaining the feature vectors corresponding to the candidate features included in the heterogeneous classes to obtain the corresponding inter-class fitting function; determine the inter-class collinearity parameter that corresponds to the inter-class fitting function and is used to characterize the degree of fitting.
[0175] In one embodiment, the determination module 803 is also used to traverse each candidate feature included in each class respectively; determine a heterogeneous class that is different from the class to which the currently traversed candidate feature belongs; calculate the corresponding cluster center vector of each heterogeneous class according to the feature vector corresponding to the candidate feature included in each heterogeneous class; perform linear fitting on the feature vector corresponding to the currently traversed candidate feature through the cluster center vector to obtain the corresponding inter-class fitting function; determine the inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting.
[0176] In one embodiment, the screening module 804 is also used to determine the objective function for maximizing the difference between the intra-class collinearity parameter and the inter-class collinearity parameter corresponding to the candidate feature; and to screen out the target features that make the value of the corresponding objective function the maximum or minimum value from the candidate features included in each category. In one embodiment, the feature processing device 800 also includes a model training module 805, wherein: the acquisition module 801 is also used to acquire target sample user data corresponding to the sample user; the target sample user data includes user feature data corresponding to the target feature, and the corresponding category label. The model training module 805 is also used to train a machine learning model for business evaluation of users based on the user feature data corresponding to the target feature, and the corresponding category label.
[0177] refer to Fig. 9 In one embodiment, the feature processing device 800 further includes a data processing module 806 and a push module 807, wherein: the acquisition module 801 is also used to acquire the user feature data to be processed corresponding to the target feature and the target user. The data processing module 806 is used to input the user feature data to be processed into the trained machine learning model for processing to obtain the business evaluation score corresponding to the target user. The push module 807 is used to push the corresponding promotion information to the terminal corresponding to the target user whose business evaluation score reaches the preset score.
[0178] The feature processing device obtains feature vectors corresponding to different candidate features and corresponding to the sample user sequence, and clusters the corresponding candidate features according to the feature vectors corresponding to each candidate feature to obtain at least one class. In this way, candidate features with commonality can be clustered into one class. For each candidate feature, the intra-class collinearity parameters when fitting the feature vector corresponding to each candidate feature through the feature vector within the class to which it belongs, and the inter-class collinearity parameters when fitting the feature vector corresponding to each candidate feature through the feature vector outside the class to which it belongs are determined. Then, from the candidate features included in each class, the target features whose differences between the corresponding intra-class collinearity parameters and the inter-class collinearity parameters meet the collinearity difference conditions are screened out. In this way, from a class of candidate features with commonality, target features that are representative within the class and discriminative between classes can be screened out as input features for subsequent training of machine learning models. In this way, by adopting the delinear feature screening method, representative target features can be selected from a class of common candidate features for modeling. That is, from the high-dimensional candidate features, a high-quality feature subset that is most descriptive of the target can be screened out. The screened feature subset can be used to train a stable and highly interpretable machine learning model.
[0179] Fig.10 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The terminal 110 or the server 120 in FIG. Fig.10 As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which, when executed by the processor, enables the processor to implement the feature processing method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute the feature processing method.
[0180] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0181] In one embodiment, the feature processing device provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.10 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the feature processing device, for example, Figure 8The acquisition module, clustering module, determination module and screening module shown in the figure. The computer program composed of each program module enables the processor to execute the steps in the feature processing method of each embodiment of the present application described in this specification.
[0182] For example, Fig.10 The computer device shown can be Figure 8 The acquisition module in the feature processing device shown executes step S202. The computer device may execute step S204 through the clustering module. The computer device may execute steps S206 and S208 through the determination module. The computer device may execute step S210 through the screening module.
[0183] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned feature processing method. The steps of the feature processing method here may be the steps in the feature processing method of each of the above-mentioned embodiments.
[0184] In one embodiment, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the above-mentioned feature processing method. The steps of the feature processing method here can be the steps in the feature processing method of each of the above-mentioned embodiments.
[0185] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0186] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0187] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0188] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A feature processing method, characterized in that: The method comprises: Obtaining a category label corresponding to each sample user among more than one sample users, and user feature data corresponding to each sample user under dimensions of different candidate features; For each sample user, determine the feature coding values corresponding to different candidate features according to the corresponding user feature data and category labels; For each candidate feature, the feature code value corresponding to each sample user is concatenated according to the arrangement order of the sample users to obtain a feature vector corresponding to the sample user sequence; Clustering the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features to obtain at least one class; For each candidate feature, determine the class to which the targeted candidate feature belongs, fit the feature vector of the targeted candidate feature through the feature vectors of other candidate features in the class except the targeted candidate feature, and calculate the intra-class collinearity parameter corresponding to the targeted candidate feature according to the degree of fitting; For each candidate feature, the feature vector of the candidate feature is fitted through the feature vector of the candidate feature in a class different from the class to which it belongs, and the inter-class collinearity parameter corresponding to the candidate feature vector is calculated according to the degree of fitting; Determine an objective function for maximizing the difference between the intra-class collinearity parameter and the inter-class collinearity parameter corresponding to the candidate features, and select target features that make the value of the corresponding objective function the maximum value or the minimum value from the candidate features included in each class.
2. The method according to claim 1, characterized in that For each sample user, determining feature code values corresponding to different candidate features according to corresponding user feature data and category labels includes: For each candidate feature, segment each candidate feature according to the data range corresponding to each candidate feature to obtain candidate feature sub-segments; Determine the feature code value corresponding to each candidate feature subsegment according to the number of sample users whose user feature data is within the data range of each candidate feature subsegment and the corresponding category label; For each sample user, the feature coding values corresponding to the candidate feature sub-segments corresponding to the candidate sample user data corresponding to different candidate features are used as the feature coding values corresponding to the different candidate features.
3. The method according to claim 1, characterized in that For each candidate feature, determining the class to which the targeted candidate feature belongs, fitting the feature vector of the targeted candidate feature through the feature vectors of other candidate features in the class except the targeted candidate feature, and calculating the intra-class collinearity parameter corresponding to the targeted candidate feature according to the degree of fitting, including: Traverse each candidate feature included in each category separately; Determine, in the class to which the currently traversed candidate feature belongs, candidate features within the class other than the currently traversed candidate feature; By using the feature vector corresponding to the candidate feature within the class, linear fitting is performed on the feature vector corresponding to the candidate feature currently traversed to obtain a corresponding intra-class fitting function; An intra-class collinearity parameter corresponding to the intra-class fitting function and used to characterize the degree of fitting is determined.
4. The method according to claim 1, characterized in that: For each candidate feature, the feature vector of the candidate feature is fitted by the feature vector of the candidate feature in a class different from the class to which it belongs, and the inter-class collinearity parameter corresponding to the candidate feature vector is calculated according to the degree of fitting, including: Traverse each candidate feature included in each category separately; Determine the different classes that are different from the class to which the candidate features currently traversed belong; Determine the distance between the class to which the candidate feature currently traversed belongs and each of the heterogeneous classes; Obtain the outliers corresponding to the distances whose ranking is less than or equal to the threshold after the distances are ranked in descending order; By obtaining the feature vectors corresponding to the candidate features included in the heterogeneous class, linear fitting is performed on the feature vectors corresponding to the candidate features currently traversed to obtain a corresponding inter-class fitting function; An inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting is determined.
5. The method according to claim 1, characterized in that For each candidate feature, the feature vector of the candidate feature is fitted by the feature vector of the candidate feature in a class different from the class to which it belongs, and the inter-class collinearity parameter corresponding to the candidate feature vector is calculated according to the degree of fitting, including: Traverse each candidate feature included in each category separately; Determine the different classes that are different from the class to which the candidate features currently traversed belong; Calculating the cluster center vector corresponding to each of the heterogeneous classes according to the feature vectors corresponding to the candidate features included in each of the heterogeneous classes; By using the cluster center vector, linear fitting is performed on the feature vector corresponding to the candidate feature currently traversed to obtain a corresponding inter-class fitting function; An inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting is determined.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Acquire target sample user data corresponding to the sample user; the target sample user data includes user feature data corresponding to the target feature and a corresponding category label; Based on the user feature data corresponding to the target feature and the corresponding category label, a machine learning model for performing business evaluation on the user is trained.
7. The method according to claim 6, characterized in that The method further comprises: Acquire user feature data to be processed corresponding to the target feature and the target user; Inputting the user feature data to be processed into a trained machine learning model for processing to obtain a business evaluation score corresponding to the target user; The corresponding promotion information is pushed to the terminal corresponding to the target user whose business evaluation score reaches the preset score.
8. A feature processing device, characterized in that: The device comprises: A feature code value determination module is used to obtain a category label corresponding to each sample user among more than one sample users, and user feature data corresponding to each sample user under the dimensions of different candidate features; for each sample user, determine feature code values corresponding to different candidate features respectively according to the corresponding user feature data and category label; A concatenation module, configured to concatenate, for each candidate feature, the feature code value corresponding to each sample user according to the arrangement order of the sample users, to obtain a feature vector corresponding to the sample user sequence; A clustering module, used for clustering the corresponding candidate features according to the feature vectors respectively corresponding to the candidate features, to obtain at least one class; A determination module is used to determine, for each candidate feature, the class to which the targeted candidate feature belongs, fit the feature vectors of other candidate features except the targeted candidate feature in the intra-class collinearity parameters when the feature vector corresponding to each candidate feature is fitted by the feature vector in the class to which it belongs, fit the feature vector of the targeted candidate feature, and calculate the intra-class collinearity parameters corresponding to the targeted candidate feature according to the degree of fitting; The determination module is used to fit the feature vector of the targeted candidate feature through the feature vector of the candidate feature in a class different from the class to which it belongs, and calculate the inter-class collinearity parameter corresponding to the targeted candidate feature vector according to the degree of fitting; The screening module is used to determine the objective function for maximizing the difference between the intra-class collinearity parameter and the inter-class collinearity parameter corresponding to the candidate features, and to screen out the target features that make the value of the corresponding objective function the maximum or minimum value from the candidate features included in each class.
9. The device according to claim 8, characterized in that The feature coding value determination module is also used to: for each candidate feature, segment each candidate feature according to the data range corresponding to each candidate feature to obtain candidate feature sub-segments; determine the feature coding values corresponding to each candidate feature sub-segment according to the number of sample users whose user feature data is within the data range of each candidate feature sub-segment, and the corresponding category labels; for each sample user, use the feature coding values corresponding to the candidate feature sub-segments corresponding to the candidate sample user data corresponding to different candidate features as the feature coding values corresponding to the different candidate features.
10. The device according to claim 8, characterized in that The determination module is also used to traverse each candidate feature included in each category respectively; determine the intra-class candidate features other than the currently traversed candidate feature in the class to which the currently traversed candidate feature belongs; perform linear fitting on the feature vector corresponding to the currently traversed candidate feature through the feature vector corresponding to the intra-class candidate feature to obtain a corresponding intra-class fitting function; determine the intra-class collinearity parameter corresponding to the intra-class fitting function and used to characterize the degree of fitting.
11. The device according to claim 8, characterized in that The determination module is also used to traverse each candidate feature included in each class respectively; determine the heterogeneous classes that are different from the class to which the candidate feature currently traversed belongs; determine the distances between the class to which the candidate feature currently traversed belongs and each of the heterogeneous classes; obtain the heterogeneous classes corresponding to the distances whose ranking is less than or equal to the threshold after ranking in descending order; perform linear fitting on the feature vectors corresponding to the candidate features included in the obtained heterogeneous classes to obtain the corresponding inter-class fitting function; determine the inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting.
12. The device according to claim 8, characterized in that The determination module is also used to traverse each candidate feature included in each class respectively; determine a different class that is different from the class to which the currently traversed candidate feature belongs; calculate the corresponding cluster center vector of each heterogeneous class according to the feature vector corresponding to the candidate feature included in each heterogeneous class; perform linear fitting on the feature vector corresponding to the currently traversed candidate feature through the cluster center vector to obtain a corresponding inter-class fitting function; determine an inter-class collinearity parameter corresponding to the inter-class fitting function and used to characterize the degree of fitting.
13. The device according to any one of claims 8 to 12, characterized in that The device also includes a model training module, which is used to obtain target sample user data corresponding to the sample users; the target sample user data includes user feature data corresponding to the target feature, and corresponding category labels; based on the user feature data corresponding to the target feature, and the corresponding category labels, a machine learning model for performing business evaluation on the user is trained.
14. The device according to claim 13, characterized in that The device also includes a data processing module and a push module, wherein: The acquisition module is further used to acquire the to-be-processed user characteristic data corresponding to the target characteristic and the target user; The data processing module is used to input the user feature data to be processed into a trained machine learning model for processing to obtain a business evaluation score corresponding to the target user; The push module is used to push corresponding promotion information to the terminal corresponding to the target user whose business evaluation score reaches a preset score.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
16. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
