Sample model training method, sample generation method, device, equipment and medium

By using the tree model in DeepFM model training to build an initial forest model, and performing stability screening and LR regularization screening, an effective and target forest model is formed, which solves the problem of high dimensionality of model training samples and improves training efficiency and accuracy.

CN111581877BActive Publication Date: 2025-01-21CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010218666.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-25
Publication Date
2025-01-21
Estimated Expiration
2040-03-25

AI Technical Summary

Technical Problem

During the DeepFM model training process, the model training samples have a high dimension, resulting in a large consumption of system resources and a long training time, and is prone to overfitting, affecting the stability and accuracy of the model.

Method used

By building an initial forest model based on the tree model, performing stability screening and LR regularization screening, the effective and target leaf nodes are determined, an effective and target forest model is formed, and the dimensionality of high-order combination features is reduced.

Benefits of technology

It reduces the system resource consumption required for DeepFM model training, shortens the training time, reduces the risk of over-fitting, and improves the accuracy and stability of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111581877B_ABST
    Figure CN111581877B_ABST
Patent Text Reader

Abstract

The present invention discloses a sample model training method, a sample generation method, a device, an equipment and a medium. The method comprises: obtaining original training data, the original training data comprises a sample label and feature data corresponding to at least two sample features; inputting the original training data into an initial forest model constructed based on a tree model to obtain original high-order combination features; performing stability screening based on the sample label and the original high-order combination features, determining effective leaf nodes, pruning the initial forest model based on the effective leaf nodes, and obtaining an effective forest model; inputting the original training data into an effective forest model to obtain effective high-order combination features; performing LR regularization screening based on the sample label and the effective high-order combination features, determining target leaf nodes, pruning the effective forest model based on the target leaf nodes, and obtaining a target forest model. The output model training sample dimension of the target forest model is high, which can ensure the timeliness and accuracy of model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a sample model training method, a sample generation method, a device, a equipment and a medium. Background Art

[0002] Since the DeepFM algorithm effectively combines the advantages of factor decomposition machines and neural networks in feature learning, it can extract low-order combined features and high-order combined features at the same time, making it widely used in different fields. For example, user portrait data formed by user access to the system or other scenarios can be used as model training samples, and the model training samples can be input into the DeepFM model for model training, and the model parameters of the DeepFM model can be updated to build a user portrait analysis model based on DeepFM, so that the user portrait analysis model can extract low-order combined features and high-order combined features at the same time, making its analysis results more accurate.

[0003] During the DeepFM model training process, each model training sample includes at least two data domains corresponding to sample features. The values ​​in each data domain are encoded using One-Hot coding, and the size of each data domain is determined based on the feature data of the sample feature. As an example, for the sample feature of age, the age value can be converted into binary to obtain the corresponding One-Hot coding. At this time, the size of the data domain of the sample feature of age is the length of the One-Hot coding corresponding to the maximum age. For another example, for the sample feature of age, the One-Hot coding can be determined based on the preset age groups. At this time, the size of the data domain of the sample feature of age is the number of age groups. For the sample feature of city, the size of the data domain of the sample feature of city is the number of pre-set feature data.

[0004] In the current DeepFM model training process, each model training sample includes at least two data domains, and the size of each data domain is determined according to the feature data of the sample feature. When the feature data corresponding to the sample feature has a large time span, a high degree of discreteness, or poor stability, the size of the data domain of the sample feature is large, so that the dimension of the formed model training sample is high. When the model training sample is input into the DeepFM model for training, the model training process requires more system resources and a longer training time. Moreover, due to the high dimension of the model training sample, overfitting is prone to occur, resulting in the inability to learn a stable DeepFM model or the output accuracy of the trained DeepFM model is low. Summary of the invention

[0005] Embodiments of the present invention provide a sample model training method, a sample generation method, an apparatus, a device and a medium to solve the problem that the model training samples obtained by the current DeepFM model training have a high dimension, resulting in more system resources required for model training, a longer training time and lower recognition accuracy of the trained model.

[0006] An embodiment of the present invention provides a sample model training method, comprising:

[0007] Acquire original training data, where the original training data includes a sample label and feature data corresponding to at least two sample features;

[0008] Inputting the original training data into an initial forest model constructed based on a tree model, obtaining original high-order combined features in a One-Hot encoding form corresponding to the original training data, wherein the initial forest model includes at least two feature trees arranged in sequence, each of which corresponds to one of the sample features and includes at least two initial leaf nodes;

[0009] Perform stability screening based on the sample labels and the original high-order combined features to determine valid leaf nodes, and prune the initial leaf nodes of the initial forest model based on the valid leaf nodes to obtain a valid forest model;

[0010] Inputting the original training data into the effective forest model to obtain effective high-order combination features in the form of One-Hot encoding corresponding to the original training data;

[0011] LR regularization screening is performed based on the sample labels and the effective high-order combined features to determine the target leaf nodes, and the effective leaf nodes in the effective forest model are pruned based on the target leaf nodes to obtain the target forest model.

[0012] An embodiment of the present invention provides a sample model training device, comprising:

[0013] An original training data acquisition module, used to acquire original training data, wherein the original training data includes a sample label and feature data corresponding to at least two sample features;

[0014] An original high-order combined feature acquisition module is used to input the original training data into an initial forest model constructed based on a tree model to obtain original high-order combined features in a One-Hot encoding form corresponding to the original training data, wherein the initial forest model includes at least two feature trees arranged in sequence, each of which corresponds to one of the sample features and includes at least two initial leaf nodes;

[0015] An effective forest model acquisition module, used to perform stability screening based on the sample labels and the original high-order combined features, determine effective leaf nodes, and prune the initial leaf nodes of the initial forest model based on the effective leaf nodes to obtain an effective forest model;

[0016] An effective high-order combined feature acquisition module, used to input the original training data into the effective forest model to obtain effective high-order combined features in the form of One-Hot encoding corresponding to the original training data;

[0017] The target forest model acquisition module is used to perform LR regularization screening based on the sample labels and the effective high-order combined features, determine the target leaf nodes, prune the effective leaf nodes in the effective forest model based on the target leaf nodes, and obtain the target forest model.

[0018] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned sample model training method when executing the computer program.

[0019] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the sample model training method is implemented.

[0020] An embodiment of the present invention provides a sample generation method, including:

[0021] Acquire data to be processed, wherein the data to be processed includes feature data corresponding to at least two sample features;

[0022] The feature data corresponding to at least two sample features are input into the target forest model determined by the above-mentioned sample model training method, and the target high-order combined features in the form of One-Hot encoding output by the target forest model are determined as the model training samples of the DeepFM model.

[0023] An embodiment of the present invention provides a sample generation device, including:

[0024] A module for acquiring data to be processed, used to acquire data to be processed, wherein the data to be processed includes feature data corresponding to at least two sample features;

[0025] The model training sample acquisition module is used to input the feature data corresponding to at least two sample features into the target forest model determined by the above-mentioned sample model training method, and determine the target high-order combined features in the One-Hot encoding form output by the target forest model as the model training samples of the DeepFM model.

[0026] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the sample generation method when executing the computer program.

[0027] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the sample generation method is implemented.

[0028] In the above-mentioned sample model training method, device, equipment and medium, the target forest model obtained by training can realize the conversion of feature data of at least two sample features in the original training data into high-order combined features in the form of One-Hot encoding including at least two data domains, so that it can be input into the DeepFM model for model training; moreover, since the target forest model is a forest model determined by stability screening and LR regularization screening of the initial leaf nodes in the initial forest model, after secondary screening and dimensionality reduction, the dimension of the formed high-order combined features is lower, so that when it is output to the DeepFM model for model training, the system resources occupied by the training process can be saved and the training time can be shortened; moreover, the target leaf nodes in the target forest model match the model training purpose of the DeepFM model, and the leaf nodes with lower stability are filtered, so as to reduce the overfitting phenomenon of the model training samples output by the target forest model during the DeepFM model training process, save the system resources occupied by the model training process, and help to improve the accuracy of the model training samples in training the DeepFM model.

[0029] In the above-mentioned sample generation method, device, equipment and medium, the target forest model determined by the above-mentioned embodiment is used to convert the feature data of at least two sample features of the processed data into high-order combined features in the form of One-Hot encoding including at least two data domains, so that it forms a model training sample that can be input into the DeepFM model for model training; and, since the target forest model is a forest model determined by stability screening and LR regularization screening of the initial leaf nodes in the initial forest model, after secondary screening and dimensionality reduction, the dimension of the formed high-order combined features is lower, so that when the model training samples output by it are input into the DeepFM model for model training, the system resources occupied by the training process can be saved and the training time can be shortened; and, the target leaf nodes in the target forest model match the model training purpose of the DeepFM model, and the leaf nodes with lower stability are filtered, so as to reduce the overfitting phenomenon of the model training samples output by the target forest model during the DeepFM model training process, save the system resources occupied by the model training process, and help to improve the accuracy of the DeepFM model training by the model training samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0031] Figure 1 is a schematic diagram of a computer device in one embodiment of the present invention;

[0032] Figure 2 is a flow chart of a sample model training method in one embodiment of the present invention;

[0033] Figure 3 is another flow chart of a sample model training method according to an embodiment of the present invention;

[0034] Figure 4 is a schematic diagram of a feature tree in an initial forest model in one embodiment of the present invention;

[0035] Figure 5 is another flow chart of a sample model training method according to an embodiment of the present invention;

[0036] Figure 6 is another flow chart of a sample model training method according to an embodiment of the present invention;

[0037] Figure 7 is another flow chart of a sample generation method according to an embodiment of the present invention;

[0038] Figure 8 is a schematic diagram of a sample model training device in one embodiment of the present invention;

[0039] Fig. 9 is a schematic diagram of a sample generating device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] The sample model training method provided by the embodiment of the present invention can be applied as follows: Figure 1The computer device shown may be a server. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used or generated during the execution of the sample model training method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a sample model training method is implemented.

[0042] In one embodiment, if Figure 2 As shown, a sample model training method is provided, and the sample model training method is applied in Figure 1 Taking the computer device in the example as an example, the sample model training method specifically includes the following steps:

[0043] S201: Acquire original training data, where the original training data includes a sample label and feature data corresponding to at least two sample features.

[0044] Among them, the original training data refers to the unprocessed data used to train the sample model. The sample label is a pre-labeled label used to reflect the purpose of sample model training. For example, when training a user portrait analysis model based on DeepFM to evaluate user access to the system, if the purpose of model training is to analyze whether the user accesses the system, the sample labels corresponding to the original training data are labeled as access or non-access according to the actual situation, and the sample labels are set to 1 or 0 respectively; if the purpose of model training is to analyze whether the user intends to purchase a specific product, the sample labels corresponding to the original training data are labeled as purchase and non-purchase according to the actual situation, and the sample labels are set to 1 or 0 respectively; if the purpose of model training is to analyze the performance of the user, the sample labels corresponding to the original training data are labeled as high performance and low performance according to the actual situation, and the sample labels are set to 1 or 0 respectively.

[0045] Sample features refer to feature dimensions in the original training data. Feature data refers to specific values ​​or specific information corresponding to sample features in the original training data. As an example, when training a user portrait analysis model, the corresponding original training data may include age, gender, income, education level, and other sample features. Accordingly, the feature data corresponding to the sample features are specific values ​​or specific information of age, gender, income, education level, and other sample features. For example, at least two sample features and their corresponding feature data may be stored in key-value format, such as age-30, gender-male, income-10,000, education level-bachelor's degree, etc.

[0046] S202: Input the original training data into the initial forest model constructed based on the tree model to obtain the original high-order combined features in the One-Hot encoding form corresponding to the original training data. The initial forest model includes at least two feature trees arranged in sequence, each feature tree corresponds to a sample feature and includes at least two initial leaf nodes.

[0047] Among them, the initial forest model built based on the tree model refers to a forest model built using XGBOOST, LightGBM or other tree models and containing at least two feature trees arranged in sequence. Each feature tree corresponds to a sample feature and is a tree used to classify the feature data corresponding to the sample feature. In the initial forest model, the leaf nodes in each feature tree are the initial leaf nodes. The original high-order combined features are the output results after the original training data is input into the initial forest model.

[0048] Specifically, if the initial forest model constructed based on the tree model includes feature tree, Feature Tree The corresponding initial leaf node is Then the number of initial leaf nodes formed based on the initial forest model is , accordingly, the feature data corresponding to at least two sample features of the original training data are input into the initial forest model for classification, and the value of the initial leaf node corresponding to the feature data corresponding to the sample feature in the initial forest model is determined to be 1, and the values ​​corresponding to the remaining initial leaf nodes are determined to be 0, so as to form the original high-order combination feature in the form of One-Hot encoding corresponding to the original training data, and the original high-order combination feature includes data domains, each data domain corresponds to a sample feature, and the size of each data domain matches the initial leaf node of the feature tree corresponding to the corresponding sample feature, that is, The size of the data field is , the dimension of the original high-order combination feature in the form of One-Hot encoding is .

[0049] S203: Perform stability screening based on sample labels and original high-order combined features to determine valid leaf nodes, and prune the initial leaf nodes of the initial forest model based on the valid leaf nodes to obtain a valid forest model.

[0050] Since the distribution of feature data corresponding to at least two sample features in the original training data may have a large time span, high discreteness or poor stability, if the original high-order combined features output by the initial forest model are directly used as the model training samples of the DeepFM model, it may affect the accuracy and timeliness of the subsequent model training of the DeepFM model. Therefore, it is necessary to perform stability screening based on the sample labels and the original high-order combined features, specifically, the numerical values ​​of the data domain corresponding to the same sample feature in all the original high-order combined features and the sample labels are screened for stability to determine the relatively stable numerical range in the data domain, and the initial leaf nodes corresponding to the initial forest model are determined to be valid leaf nodes based on the numerical range. Then, the initial leaf nodes in the initial forest model are pruned based on the valid leaf nodes, that is, the valid leaf nodes in the initial forest model are retained, and the other initial leaf nodes except the valid leaf nodes are deleted or merged to form an effective forest model. The effective forest model includes at least two effective leaf nodes, so that the high-order combined features formed by the original training data input into the effective forest model have a lower dimension and better stability, thereby avoiding overfitting in the subsequent DeepFM model training process.

[0051] As an example, suppose a sample feature is access time. The feature tree corresponding to the access time in the initial forest model can be divided into time intervals corresponding to 24 hours according to the feature judgment condition. There are 24 initial leaf nodes corresponding to the access time. The dimension of the original high-order combined feature is relatively long, which is not conducive to improving the accuracy and timeliness of subsequent model training. Moreover, for a specific user, the time of accessing the system is relatively fixed. The number of accesses to the system in the time period of 24:00-6:00 is small, or even 0. The number of accesses to the system in other time periods is large, which makes the sample feature of access time have a large time span and is out of date. In the event of high dispersion or poor stability, stability screening is performed based on the content of the sample feature, sample label and access time, in the original high-order combined features. The initial leaf nodes in the initial forest model for the time period of 6:00-24:00 can be determined as valid leaf nodes, and the five initial leaf nodes corresponding to the time period of 24:00-6:00 can be deleted or merged into one valid leaf node. An effective forest model is formed based on the valid leaf nodes, thereby reducing the dimension of the high-order combined features of the input of the effective forest model to ensure the timeliness of the subsequent DeepFM model training process, save the required system resources, and avoid overfitting.

[0052] In this example, if the initial forest model built based on the tree model includes feature tree, Feature Tree The corresponding initial leaf node is After stability screening based on sample labels and original high-order combination features, Feature Tree The corresponding valid leaf nodes are Then the number of valid leaf nodes in the effective forest model is ,in, ≥ , which helps to achieve the first dimensionality reduction of the initial forest model, so that the dimension of the final model training samples is lower, which helps to ensure the accuracy and timeliness of subsequent DeepFM model training and save the system resources required for model training.

[0053] S204: Input the original training data into the effective forest model to obtain effective high-order combination features in the form of One-Hot encoding corresponding to the original training data.

[0054] Among them, the effective high-order combination feature is the output result after the original training data is input into the effective forest model. As an example, the feature data corresponding to at least two sample features of the original training data are input into the effective forest model for classification, and the value of the feature data corresponding to the sample features in the effective leaf node corresponding to the effective forest model is determined to be 1, and the values ​​corresponding to the other effective leaf nodes are determined to be 0, so as to form the effective high-order combination feature in the form of One-Hot encoding corresponding to the original training data. The effective high-order combination feature includes Data domain, The size of the data field is , the dimension of the original high-order combination feature in the form of One-Hot encoding is ,in, ≥ , in order to achieve dimensionality reduction of the original high-order combination features for subsequent analysis and processing, so that the dimension of the final model training samples is lower, which helps to ensure the accuracy and timeliness of subsequent DeepFM model training.

[0055] S205: Perform LR regularization screening based on sample labels and effective high-order combined features to determine target leaf nodes, prune effective leaf nodes in the effective forest model based on the target leaf nodes, and obtain the target forest model.

[0056] Since the effective leaf nodes in the effective forest model may be irrelevant to the model training purpose of the subsequent DeepFM model, and since the model training purpose of the DeepFM model is associated with the sample label, LR regularization screening can be performed based on the sample label and the effective high-order combination features to screen out the leaf nodes that are highly relevant to the model training purpose from all effective leaf nodes and determine them as target leaf nodes. Then, the effective forest model is pruned based on the target leaf nodes, that is, the target leaf nodes in the effective forest model are retained, and the effective leaf nodes other than the target leaf nodes are deleted or merged to form a target forest model. The target forest model is a forest model corresponding to the model training sample for generating the DeepFM model after the model training is completed. The target forest model is a forest model formed by further reducing the dimension of the effective forest model, which can make the model training sample output by the target forest model be a data content corresponding to at least two data domains formed based on all target leaf nodes, which helps to ensure the model training sample output by the target forest model, and effectively reduce the dimension of the model training sample in the accuracy and timeliness of the DeepFM model training, so that it occupies less system resources during the model training process, and avoids the occurrence of overfitting.

[0057] The target forest model trained by the sample model training method provided in this embodiment can realize the conversion of feature data of at least two sample features in the original training data into high-order combined features in the form of One-Hot encoding including at least two data domains, so that it can be input into the DeepFM model for model training; moreover, since the target forest model is a forest model determined by stability screening and LR regularization screening of the initial leaf nodes in the initial forest model, after secondary screening and dimensionality reduction, the dimension of the formed high-order combined features is lower, so that when it is output to the DeepFM model for model training, the system resources occupied by the training process can be saved and the training time can be shortened; moreover, the target leaf nodes in the target forest model match the model training purpose of the DeepFM model, and the leaf nodes with lower stability are filtered, so as to reduce the overfitting phenomenon of the model training samples output by the target forest model during the DeepFM model training process, save the system resources occupied by the model training process, and help to improve the accuracy of the model training samples in training the DeepFM model.

[0058] In one embodiment, if Figure 3 As shown, the original training data is input into the initial forest model built based on the tree model to obtain the original high-order combination features in the form of One-Hot encoding corresponding to the original training data, which specifically includes the following steps:

[0059] S301: Input the feature data corresponding to at least two sample features into the feature tree corresponding to the sample feature for processing respectively to obtain the initial feature corresponding to the sample feature.

[0060] Specifically, the initial forest model based on the tree model includes at least two feature trees arranged in sequence. Each feature tree corresponds to a sample feature and can be used to analyze the feature data corresponding to the sample feature, so as to convert the feature data corresponding to the sample feature into the One-Hot encoding form, which is convenient for forming the model training samples that can be used to input into the DeepFM model for model training. As an example, the feature tree can adopt XGBOOST, LightGBM or other tree models.

[0061] In this example, the feature tree corresponding to each sample feature is a tree formed based on at least one feature judgment condition. By inputting the feature data corresponding to the sample feature into the feature tree corresponding to the sample feature, the initial leaf node corresponding to the feature data is determined by using at least one feature judgment condition, and the value of the initial leaf node corresponding to the feature data is set to 1, while the values of other initial leaf nodes are set to 0, so as to obtain the initial feature in the One-Hot encoding form.

[0062] For example, for the sample feature of gender, the corresponding feature judgment condition can be "whether the gender is male", so as to form 10 indicating male gender and 01 indicating female gender.

[0063] Another example is as Figure 4 shown. Set the sample feature of income as S, and its corresponding feature judgment conditions include "A1: S > 5000", "A2: S > 10000", "A3: S > 15000", "A4: S > 20000", "A5: S > 25000" and "A6: S > 30000" and other 6 feature judgment conditions. Then, based on these 6 feature judgment conditions, 7 initial leaf nodes L1, L2, L3, L4, L5, L6 and L7 are formed. The income range corresponding to each initial leaf node is as follows: L1: S ≤ 5000, L2: 5000 < S ≤ 10000, L3: 10000 < S ≤ 15000, L4: 15000 < S ≤ 20000, L5: 20000 < S ≤ 25000, L6: 25000 < S ≤ 30000 and L7: S > 30000. At this time, if the feature data corresponding to the income in the original training data is 12000, it falls into the initial leaf node L3, then the value of the initial leaf node L3 is set to 1, and the values of other initial leaf nodes are set to 0, forming the initial feature 0000100.

[0064] S302: According to the arrangement order of at least two feature trees, initial features corresponding to at least two sample features are concatenated to obtain original high-order combined features in the form of One-Hot encoding corresponding to the original training data.

[0065] In this example, the initial forest model based on the tree model includes at least two feature trees arranged in sequence, each feature tree corresponds to a sample feature, and the arrangement order between the at least two feature trees reflects the order of the data domain formed by the at least two sample features. Specifically, if the initial forest model constructed based on the tree model includes feature tree, Feature Tree The corresponding initial leaf node is , then according to Determine the arrangement order between at least two feature trees, and determine the expression form of the high-order combination features formed based on the initial forest model: ,in, Represents the data domain, Indicates Feature Tree The initial features of the output are specifically the values ​​of the data domain of the corresponding sample features.

[0066] In one example, if gender is the first sample feature and income is the second sample feature, and the gender in the original training data is male and the income is 12,000, then the first feature tree The initial features formed is 10, the second feature tree The initial features formed is 0000100, the initial features corresponding to at least two sample features are concatenated to form , determined as the original high-order combined features in the One-Hot encoding form corresponding to the original training data.

[0067] In the sample model training method provided in this embodiment, feature data corresponding to at least two sample features can be respectively input into the feature trees corresponding to the sample features for recognition processing to convert the feature data into initial features in One-Hot encoding form; then all the initial features are spliced ​​according to the arrangement order of at least two feature trees, so as to quickly form the original high-order combined features including at least two data domains, and each data domain adopts a numerical value in One-Hot encoding form to facilitate subsequent DeepFM model training.

[0068] In one embodiment, the original training data also includes a time tag, which is information related to the time when the original training data was formed. Figure 5As shown in the figure, stability screening is performed based on sample labels and original high-order combined features to determine valid leaf nodes, which specifically includes the following steps:

[0069] S501: Perform saturation analysis based on the time tag and the original high-order combined features to obtain the saturation analysis result corresponding to each sample feature.

[0070] Among them, saturation analysis is the process of analyzing whether the data is saturated in time distribution from the time dimension to determine whether the data is stable. The saturation analysis result corresponding to each sample feature is used to reflect whether the original high-order combination feature corresponding to a certain sample feature is saturated in time distribution.

[0071] As an example, all original high-order combined features can be grouped based on the time label corresponding to each original high-order combined feature. Since each original high-order combined feature includes sample feature values ​​corresponding to at least two sample features, and each sample feature value corresponds to an initial leaf node, the ratio of the number of each sample feature value corresponding to each initial leaf node to the sum of the number of all sample feature values ​​can be grouped and counted, and then the saturation analysis results of different initial leaf nodes can be determined based on the ratio values ​​calculated for different groups. For example, if a sample feature corresponds to 4 leaf nodes, in the first group, the proportion values ​​corresponding to the 1st to 4th initial leaf nodes are determined to be 0%, 40%, 40% and 20%, in the third group, the proportion values ​​corresponding to the 1st to 4th initial leaf nodes are determined to be 5%, 40%, 35% and 20%, and in the first group, the proportion values ​​corresponding to the 1st to 4th initial leaf nodes are determined to be 20%, 35%, 30% and 15%. The fluctuation size can be determined based on the maximum difference between multiple proportion values. Then, the fluctuation of the proportion value of the first initial leaf node is relatively large, and the fluctuation of the proportion value of the 2nd to 4th initial leaf nodes is relatively small, thereby obtaining the saturation analysis result corresponding to the sample feature.

[0072] In a specific implementation, step S501, i.e., performing saturation analysis based on the time tag and the original high-order combined features to obtain the saturation analysis result corresponding to each sample feature, specifically includes the following steps:

[0073] S5011: Based on the time grouping period, group the original high-order combined features corresponding to the time tags to obtain at least two time feature groups.

[0074] The time grouping period is a pre-set period for time division, which can be a day, week, month, quarter or year. The time feature group is a set of all original high-order combination features for storing time tags in the corresponding time grouping period. In this example, the original high-order combination features can be divided into Time feature groups, ≥2.

[0075] As an example, if the time grouping period is a month, all original high-order combined features can be divided into 12 time feature groups, and the corresponding time feature group can be determined based on the time label of each original high-order combined feature. For example, if a user accesses the system on January 10, the time label recorded in the user portrait data (i.e., the original training data) formed by the user is January 10, and the formed original high-order combined features can be divided into the time feature group corresponding to January.

[0076] S5012: Count the first feature quantity of the original high-order combined features in the time feature group, count the second feature quantity of the original high-order combined features in the initial leaf node corresponding to the same sample feature in the time feature group, and determine the current saturation of each initial leaf node based on the first feature quantity and the second feature quantity.

[0077] Among them, the first feature quantity is The number of all original high-order combined features in the time feature group is set as , making the In each time feature group, the number of original high-order combined features corresponding to all sample features (i.e., all data domains) is In the In the original high-order combined features of the time feature group, each original high-order combined feature includes at least two data domains corresponding to sample features, each data domain corresponds to the initial leaf node in the initial forest model, and the first Among the original high-order combined features of the time feature groups, The number of original high-order combined features corresponding to the initial leaf nodes is determined as the second feature number , For the In the time feature group The number of original high-order combined features corresponding to the initial leaf nodes, , is the number of initial leaf nodes corresponding to any data domain. Based on the first feature number and the second feature number , determine the In the time feature group The current saturation of the initial leaf nodes ,in, Indicates In the time feature group The current saturation of the initial leaf nodes.

[0078] For example, if the time grouping period is monthly, the number of time feature groups formed is , the first feature number of the original high-order combination feature corresponding to the time feature group corresponding to January , the original high-order combination features include data domains, if the size of the first data domain is 4, that is , which corresponds to 4 initial leaf nodes, the contents of the data domain are 1000, 0100, 0010 and 0001 respectively. Then the number of original high-order combination features corresponding to 1000, 0100, 0010 and 0001 is counted respectively. , , and , then the current saturation of the first initial leaf node , the current saturation of the second initial leaf node , the current saturation of the third initial leaf node , the current saturation of the 4th initial leaf node .

[0079] S5013: Calculate the standard deviation of the current saturation of the same initial leaf node in at least two time feature groups to obtain the saturation analysis result corresponding to each sample feature.

[0080] In this example, In each time feature group, the standard deviation of the current saturation corresponding to the same initial leaf node is calculated, that is, the standard deviation calculation formula is used to calculate The current saturation corresponding to the same initial leaf node in each time feature group is calculated to determine the saturation standard deviation corresponding to the initial leaf node, and the saturation standard deviation is determined as the saturation analysis result corresponding to the initial leaf node. Generally speaking, the smaller the saturation standard deviation, the more uniform and stable the time distribution of the initial leaf node in all the original high-order combined features, and the smaller the fluctuation; the larger the saturation standard deviation, the more uneven and unstable the time distribution of the initial leaf node in all the original high-order combined features, and the larger the fluctuation.

[0081] For example, when counting the saturation analysis results of the first initial leaf node, the first... The current saturation of the first initial leaf node in the time feature group is calculated by standard deviation, that is, the standard deviation calculation formula is used to calculate the current saturation of the first initial leaf node in the time feature group. , … Perform standard deviation calculation to obtain the saturation standard deviation of the first initial leaf node... and so on, obtain the saturation standard deviation corresponding to all initial leaf nodes in the initial forest model, and thus obtain the saturation analysis result corresponding to each sample feature.

[0082] S502: Perform importance analysis based on sample labels and original high-order combined features to obtain importance analysis results corresponding to each sample feature.

[0083] Among them, importance analysis is a process used to determine the importance of a certain sample feature on the purpose of model training. The importance analysis result corresponding to each sample feature can be understood as analyzing the degree of influence of a certain sample feature on the purpose of model training. For example, if the purpose of model training is to analyze whether a user accesses the system at a characteristic time (such as early morning) in a user portrait analysis model, it can be analyzed that the user's occupation, a sample feature, has a higher influence on whether the user accesses the system than the gender, a sample feature; for another example, when analyzing whether a user purchases a certain product, it can be analyzed that the user's gender, a sample feature, has a higher influence on whether the user purchases the product than the occupation, a sample feature. Generally speaking, if any sample feature has a higher impact on the model training target, the better its importance analysis result, and the more it is necessary to retain the leaf node corresponding to the corresponding sample feature. Therefore, the original high-order combined features can be analyzed for importance based on the model training purpose determined by the sample label to determine the importance analysis result corresponding to each sample feature.

[0084] In a specific implementation, step S502, i.e., performing importance analysis based on the sample labels and the original high-order combined features to obtain the importance analysis results corresponding to each sample feature, specifically includes the following steps:

[0085] S5021: From the original high-order combined features whose sample labels match the model training purpose, count the number of third features of the original high-order combined features in the initial leaf node corresponding to the same sample feature, and determine the sample feature value with the largest number of third features as the standard feature value corresponding to the sample feature.

[0086] In this example, only the original high-order combination features whose sample labels match the purpose of model training are analyzed to ensure that the target forest model obtained by the final training can more accurately extract model training samples related to the purpose of model training from multiple sample features, which helps to ensure the accuracy and timeliness of subsequent model training. For example, if the purpose of model training is to analyze whether a user intends to buy a certain product, the original high-order combination features whose sample labels are purchased need to be extracted for subsequent analysis, and the original high-order combination features whose sample labels are not purchased need not be extracted for subsequent analysis.

[0087] As an example, the original high-order combined features include Data domain, The size of the data field is , each data field corresponds to a sample feature, The size of the data field With Therefore, step S5021 may specifically include the following steps: first, by counting the number of initial leaf nodes corresponding to the sample features The number of third features of the original high-order combined features in the initial leaf node corresponding to the sample features, that is, the statistical classification in the first The sample features correspond to the The number of third features of the original high-order combined features in the initial leaf nodes For example, if the size of the first data domain is 4, which corresponds to 4 initial leaf nodes, the contents of the data domain are 1000, 0100, 0010 and 0001 respectively, then the first feature number of the sample feature value of the first data domain is 1000. , the first feature number of the sample feature value of the first data domain is 0100 , the first feature number of the sample feature value of the first data domain is 0010 and the first feature quantity whose sample feature value of the first data domain is 0001 Then, the sample feature value with the largest number of the third feature is determined as the standard feature value corresponding to the sample feature, that is, , , and The sample eigenvalue corresponding to the maximum value is determined as the standard eigenvalue. For example, if is the maximum value, then 1000 is determined as the standard feature value of the first sample feature. It can be understood that the standard feature value corresponding to each sample feature is a feature value in the form of 0 / 1.

[0088] S5022: Determine the current correlation coefficient of each sample feature by comparing the sample feature value and the standard feature value corresponding to each sample feature in the original high-order combined feature.

[0089] Among them, the current correlation coefficient refers to the correlation coefficient obtained by calculating the correlation between the sample feature value corresponding to each sample feature in the original high-order combination feature and the standard feature value. Since the sample feature value and the standard feature value corresponding to each sample feature in the original high-order combination feature are binary data of 0 and 1, the Jaccard coefficient can be used to determine the correlation between the two. In this example, as an example, the current correlation coefficient of each sample feature is ,in, is the current correlation coefficient, and They refer to the two standard eigenvalues ​​and sample eigenvalues ​​that need to be calculated for correlation. express and The number of corresponding bits that are all 0, express is 0, The number of corresponding bits that are 1 in express is 1, The number of corresponding bits in is 0, express and The corresponding bits are all 1's.

[0090] S5023: Calculate the standard deviation of the current correlation coefficients corresponding to all original high-order combined features to obtain the importance analysis result corresponding to each sample feature.

[0091] In this example, the standard deviation calculation formula can be used to calculate the standard deviation of the correlation coefficient values ​​corresponding to the same sample feature in all the original high-order combined features to determine the importance standard deviation corresponding to the sample feature, and the importance standard deviation is determined as the importance analysis result corresponding to the sample feature. Since each sample feature corresponds to a feature tree, the importance analysis result corresponding to the sample feature can also be understood as the importance analysis result of the feature tree. Generally speaking, the smaller the importance standard deviation of any sample feature, the more uniform and stable the distribution of the sample feature values ​​corresponding to the sample feature in all the original high-order combined features, and the smaller the fluctuation; conversely, the larger the importance standard deviation of any sample feature, the more uneven and stable the distribution of the sample feature values ​​corresponding to the sample feature in all the original high-order combined features, and the larger the fluctuation.

[0092] S503: If the saturation analysis result meets the saturation standard threshold, and the importance analysis result meets the importance standard threshold, then the initial leaf node in the initial forest model corresponding to the sample feature is determined as a valid leaf node.

[0093] Among them, the saturation standard threshold is a pre-set threshold for evaluating whether the saturation meets the standard. The importance analysis threshold is a pre-set threshold for evaluating whether the importance meets the standard. In this example, the saturation analysis result is compared with the saturation standard threshold, and the importance analysis result is compared with the importance standard threshold; if the importance analysis result corresponding to any sample feature meets the importance standard threshold, that is, the importance standard deviation of the sample feature is less than the importance standard threshold, it means that the sample feature value corresponding to the sample feature is relatively stable and has small fluctuations; if the saturation analysis result of any initial leaf node meets the saturation standard threshold, that is, the saturation standard deviation of the initial leaf node is less than the saturation standard threshold, it means that the initial leaf node is relatively uniform and stable in time distribution and has small fluctuations; in this example, the initial leaf node in the initial forest model corresponding to the sample feature is determined as a valid leaf node, so that the initial forest model can be pruned using the valid leaf node later to form a valid forest model. The valid leaf node can be understood as an initial leaf node in the feature tree corresponding to the sample feature whose importance analysis result meets the importance standard threshold, and the saturation analysis result meets the saturation standard threshold.

[0094] In the sample model training method provided in the present embodiment, a saturation analysis is performed based on time labels and original high-order combined features, so that the obtained saturation analysis results can determine whether all original high-order combined features are uniform and stable from the perspective of time distribution; then an importance analysis is performed based on sample labels and original high-order combined features, so that the obtained importance analysis results can reflect that the original high-order combined features match the model training purpose, and determine whether the data distribution is uniform and stable; the initial leaf nodes whose saturation analysis results meet the saturation standard threshold and whose importance analysis results meet the importance standard threshold are determined as valid leaf nodes, so as to comprehensively consider the saturation analysis results and the importance analysis results, thereby removing the initial leaf nodes with large fluctuations, so that the model training samples based on the output of the effective forest model are overfitted in the subsequent model training process, resulting in the problem that a stable DeepFM model cannot be learned or the output results of the trained DeepFM model are of low accuracy.

[0095] In one embodiment, if Figure 6 As shown, step S205, i.e., performing LR regularization screening based on sample labels and effective high-order combined features to determine the target leaf node, specifically includes the following steps:

[0096] S601: Divide all valid high-order combinations into a training set and a validation set, perform LR modeling based on the valid high-order combination features in the training set, adjust the L2 regularization coefficient so that the AUC of the valid high-order combination features in the validation set is maximized to obtain the target LR model.

[0097] As an example, all valid high-order combined features can be divided into a training set and a validation set in a ratio of 7:3. All valid high-order combined features in the training set and their corresponding sample labels are used as output for LR modeling. By adjusting the L2 regularization coefficient, the target LR model determined by the LR modeling is made smoother, and the AUC formed by the valid high-order combined features in the validation set in the target LR model is maximized to complete the modeling process of the target LR model.

[0098] For example, the L2 regularization coefficient can be adjusted by iterative grid search to maximize the AUC in the validation set. For example, try 1, 0.1, 0.01, 0.001, 0.0001 first, and find that 0.001 is the last. Then the next set of experiments is designed around 0.001, such as [0.0005, 0.001, 0.002]; repeat this step several times until there is no obvious improvement, complete the modeling process of the target LR model, and determine the given L2 regularization coefficient. Among them, AUC (Area Under Curve) is defined as the area under the ROC curve and the coordinate axis. Obviously, the value of this area will not be greater than 1. Since the ROC curve is generally above the straight line y=x, the value range of AUC is between 0.5 and 1. The closer the AUC is to 1.0, the higher the authenticity of the detection method; when it is equal to 0.5, the authenticity is the lowest and there is no application value. The L2 regularized model is called Ridge regression, which can prevent the model from overfitting.

[0099] S602: Based on the target LR model, the absolute value of the LR coefficient corresponding to each valid leaf node in the valid forest model is obtained.

[0100] In this example, for a target LR model corresponding to a valid forest model determined by a given L2 regularization coefficient, the LR coefficient corresponding to each valid leaf node in the valid forest model is determined according to the target LR model, thereby obtaining the absolute value corresponding to the LR coefficient. The LR coefficient in this example may be a coefficient related to a variable in the target LR model determined after LR modeling, and the variable corresponds to a valid leaf node.

[0101] S603: Select a preset number of valid leaf nodes with larger absolute values ​​of LR coefficients and determine them as target leaf nodes.

[0102] The preset number is the number of target leaf nodes that need to be retained, which is set to X. If the number of valid leaf nodes in the valid forest model is 1000, the absolute values ​​of the LR coefficients corresponding to each valid leaf node are sorted, and the first X valid leaf nodes are selected as target leaf nodes to ensure that the LR model formed by the selected X target leaf nodes has a substantially consistent AUC with the target LR model formed by all target leaf nodes, thereby determining the leaf node most relevant to the sample label.

[0103] For example, the initial forest model built based on XGBOOST includes 300 feature trees. If the 300 feature trees have a total of 10,000 initial leaf nodes, after stability screening, an effective forest model including only 8,000 valid leaf nodes can be formed. If the number of all valid high-order combined features is 100,000, they are divided into training set and validation set according to 7:3; then, LR modeling is performed using 70,000 valid high-order combined features in the training set. The 70,000 valid high-order combined features form a rectangle of [70,000, 8,000] and feed it to the target LR model. The dimension of y is a 0 / 1 vector of [70,000, 1]; run the target LR model and check the LR coefficients corresponding to the 8,000 valid leaf nodes. These LR coefficients are positive and negative, large and small, so the absolute values ​​of all LR coefficients need to be taken; the first X (for example, X=3,000 or 4,000) valid leaf nodes can be selected. Next, the 30,000 effective high-order combined features in the validation set are used to verify the 8,000 effective leaf nodes and the absolute values ​​of the LR coefficients in the 8,000 effective leaf nodes in the first X effective leaf nodes, and it is judged that the AUCs of the two in the target LR model are basically consistent, that is, the AUC similarity of the two reaches the similarity threshold, or the ACU difference is less than the preset difference, then the first X effective leaf nodes are determined as the target leaf nodes, so that the number of target leaf nodes is small, but basically the same effect as all effective leaf nodes can be achieved, thereby ensuring that the dimension of the model training samples based on the output of the target forest model is small and does not affect the accuracy of the model training purpose.

[0104] In the sample model training method provided in this embodiment, effective high-order combination features are used for LR modeling, and the target LR model is smoother and the result is more accurate by adjusting the L2 regularization coefficient; then the absolute value of the LR coefficient corresponding to each effective leaf node in the target LR model is calculated, and a preset number of effective leaf nodes with larger absolute values ​​of the LR coefficient are selected as target leaf nodes, so that the number of target leaf nodes in the formed target forest model is further reduced, and the model training samples output by the target forest model and the model training samples output by the effective forest model are similar to the results obtained in the model training process, thereby ensuring that the dimension of the model training samples based on the target forest model output is small and does not affect the accuracy of achieving the model training purpose.

[0105] The sample generation method provided by the embodiment of the present invention can be applied as follows: Figure 1 The computer device shown may be a server. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used or generated during the execution of the sample generation method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a sample generation method is implemented.

[0106] In one embodiment, if Figure 7 As shown, a sample generation method is provided, and the sample generation method is applied in Figure 1 Taking the computer device shown in the figure as an example, the sample feature method includes:

[0107] S701: Acquire data to be processed, where the data to be processed includes feature data corresponding to at least two sample features.

[0108] The data to be processed is unprocessed data used to generate model training samples. The data to be processed includes feature data corresponding to at least two sample features, which correspond to the feature data corresponding to at least two sample features in the original training data in the above embodiment, but the data to be processed does not carry sample labels, and it is necessary to first form model training samples, and then input the model training samples into the DeepFM model for model training to learn the corresponding sample labels.

[0109] S702: Input feature data corresponding to at least two sample features into the target forest model determined by the above sample model training method, and determine the target high-order combined features in the form of One-Hot encoding output by the target forest model as model training samples of the DeepFM model.

[0110] In the sample generation method provided in the present embodiment, the target forest model determined in the above embodiment is used to convert the feature data of at least two sample features of the processed data into high-order combined features in the form of One-Hot encoding including at least two data domains, so that the target forest model is formed to form a model training sample that can be input into the DeepFM model for model training; moreover, since the target forest model is a forest model determined by stability screening and LR regularization screening of the initial leaf nodes in the initial forest model, the dimension of the formed high-order combined features is lower after secondary screening and dimensionality reduction, so that when the model training samples output by the target forest model are input into the DeepFM model for model training, the system resources occupied by the training process can be saved and the training time can be shortened; moreover, the target leaf nodes in the target forest model are matched with the model training purpose of the DeepFM model, and the leaf nodes with lower stability are filtered, so as to reduce the overfitting phenomenon of the model training samples output by the target forest model during the DeepFM model training process, save the system resources occupied by the model training process, and help to improve the accuracy of the DeepFM model training by the model training samples.

[0111] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0112] In one embodiment, a sample model training device is provided, which corresponds one-to-one to the sample model training method in the above embodiment. Figure 8 As shown, the sample model training device includes the following functional modules, and each functional module is described in detail as follows:

[0113] The original training data acquisition module 801 is used to acquire original training data, where the original training data includes a sample label and feature data corresponding to at least two sample features.

[0114] The original high-order combined feature acquisition module 802 is used to input the original training data into the initial forest model constructed based on the tree model to obtain the original high-order combined features in the One-Hot encoding form corresponding to the original training data. The initial forest model includes at least two feature trees arranged in sequence, each feature tree corresponds to a sample feature, and includes at least two initial leaf nodes.

[0115] The effective forest model acquisition module 803 is used to perform stability screening based on sample labels and original high-order combined features, determine effective leaf nodes, prune the initial leaf nodes of the initial forest model based on the effective leaf nodes, and obtain an effective forest model.

[0116] The effective high-order combined feature acquisition module 804 is used to input the original training data into the effective forest model to obtain the effective high-order combined features in the One-Hot encoding form corresponding to the original training data.

[0117] The target forest model acquisition module 805 is used to perform LR regularization screening based on sample labels and effective high-order combined features, determine target leaf nodes, prune effective leaf nodes in the effective forest model based on the target leaf nodes, and obtain the target forest model.

[0118] Preferably, the original high-order combined feature acquisition module 802 includes:

[0119] The initial feature acquisition unit is used to input feature data corresponding to at least two sample features into feature trees corresponding to the sample features for processing, so as to acquire initial features corresponding to the sample features.

[0120] The initial feature concatenation unit is used to concatenate the initial features corresponding to at least two sample features according to the arrangement order of at least two feature trees, so as to obtain the original high-order combined features in the form of One-Hot encoding corresponding to the original training data.

[0121] Preferably, the original training data also includes a time tag. The effective forest model acquisition module 803 includes:

[0122] The saturation analysis result acquisition unit is used to perform saturation analysis based on the time tag and the original high-order combined features, and obtain the saturation analysis result corresponding to each sample feature.

[0123] The importance analysis result acquisition unit is used to perform importance analysis based on the sample label and the original high-order combined features, and obtain the importance analysis result corresponding to each sample feature.

[0124] The effective leaf node acquisition unit is used to determine the initial leaf node in the initial forest model corresponding to the sample feature as a valid leaf node if the saturation analysis result meets the saturation standard threshold and the importance analysis result meets the importance standard threshold.

[0125] Preferably, the saturation analysis result obtaining unit includes:

[0126] The time feature group division subunit is used to group the original high-order combined features corresponding to the time tags based on the time grouping period to obtain at least two time feature groups.

[0127] The current saturation acquisition subunit is used to count the first feature quantity of the original high-order combined features in the time feature group, count the second feature quantity of the original high-order combined features in the initial leaf node corresponding to the same sample feature in the time feature group, and determine the current saturation of each initial leaf node based on the first feature quantity and the second feature quantity.

[0128] The saturation analysis result acquisition subunit is used to calculate the standard deviation of the current saturation of the same initial leaf node in at least two time feature groups, and obtain the saturation analysis result corresponding to each sample feature.

[0129] Preferably, the importance analysis result obtaining unit includes:

[0130] The standard feature value acquisition subunit is used to count the number of third features of the original high-order combined features in the initial leaf node corresponding to the same sample feature from the original high-order combined features whose sample labels match the model training purpose, and determine the sample feature value with the largest number of third features as the standard feature value corresponding to the sample feature.

[0131] The current correlation coefficient acquisition subunit is used for determining the current correlation coefficient of each sample feature by comparing the sample feature value and the standard feature value corresponding to each sample feature in the original high-order combined feature.

[0132] The importance analysis result acquisition subunit is used to calculate the standard deviation of the current correlation coefficients corresponding to all original high-order combined features, and obtain the importance analysis results corresponding to each sample feature.

[0133] Preferably, the target forest model acquisition module 805 includes:

[0134] The target LR model acquisition unit is used to divide all valid high-order combinations into a training set and a validation set, perform LR modeling based on the valid high-order combination features in the training set, and adjust the L2 regularization coefficient to maximize the AUC of the valid high-order combination features in the validation set to obtain the target LR model.

[0135] The coefficient absolute value acquisition unit is used to obtain the absolute value of the LR coefficient corresponding to each valid leaf node in the valid forest model based on the target LR model.

[0136] The target leaf node acquisition unit is used to select a preset number of valid leaf nodes with larger absolute values ​​of LR coefficients and determine them as target leaf nodes.

[0137] For the specific definition of the sample model training device, please refer to the definition of the sample model training method above, which will not be repeated here. Each module in the above-mentioned sample model training device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0138] In one embodiment, a sample generation device is provided, which corresponds one-to-one to the sample generation method in the above embodiment. Fig. 9 As shown, the sample generation device includes the following functional modules, and each functional module is described in detail as follows:

[0139] The module 901 for acquiring data to be processed is used to acquire data to be processed, where the data to be processed includes feature data corresponding to at least two sample features.

[0140] The model training sample acquisition module 902 is used to input the feature data corresponding to at least two sample features into the target forest model determined by the above-mentioned sample model training method, and determine the target high-order combined features in the form of One-Hot encoding output by the target forest model as the model training samples of the DeepFM model.

[0141] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the sample model training method in the above embodiment is implemented, for example Figure 2 S201-S205 as shown, or Figure 3 , Figure 5 and Figure 6 Alternatively, when the processor executes the computer program, the functions of each module / unit in the sample model training device embodiment are realized, for example Figure 8 The functions of the modules / units shown are not described here in detail to avoid repetition. Alternatively, when the processor executes the computer program, the sample generation method in the above embodiment is implemented, for example Figure 7 S701-S702 are shown, and will not be described here to avoid repetition. Alternatively, when the processor executes the computer program, the functions of each module / unit in the sample generation device embodiment are realized, for example Fig. 9 The functions of the modules / units shown are not described here in detail to avoid repetition.

[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the sample model training method in the above embodiment is implemented, for example Figure 2 S201-S205 as shown, or Figure 3 , Figure 5 and Figure 6 Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the above-mentioned sample model training device are realized, for example Figure 8 Alternatively, when the computer program is executed by a processor, the sample generation method in the above embodiment is implemented, for example Figure 7 S701-S702 are shown, and will not be described here to avoid repetition. Alternatively, when the computer program is executed by the processor, the functions of each module / unit in the above-mentioned sample generation device embodiment are realized, for example Fig. 9 The functions of the modules / units shown are not described here in detail to avoid repetition.

[0143] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer 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 may 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. By way of 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), etc.

[0144] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0145] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A sample model training method, characterized in that: include: Acquire original training data, where the original training data includes a sample label and feature data corresponding to at least two sample features; The original training data also includes a time label; when training a user portrait analysis model based on DeepFM for evaluating user access to the system, if the purpose of model training is to analyze whether a user has accessed the system, the sample label corresponding to the original training data is labeled as access or non-access according to the actual situation; when training the user portrait analysis model, the original training data includes age, gender, income and education level; Inputting the original training data into an initial forest model constructed based on a tree model, obtaining original high-order combined features in a One-Hot encoding form corresponding to the original training data, wherein the initial forest model includes at least two feature trees arranged in sequence, each of which corresponds to one of the sample features and includes at least two initial leaf nodes; Based on the time grouping period, grouping the original high-order combined features corresponding to the time tags to obtain at least two time feature groups; Counting the first feature quantity of the original high-order combined features in the time feature group, counting the second feature quantity of the original high-order combined features in the initial leaf nodes corresponding to the same sample feature in the time feature group, and determining the current saturation of each of the initial leaf nodes based on the first feature quantity and the second feature quantity; Calculating the standard deviation of the current saturation of the same initial leaf node in at least two of the time feature groups to obtain a saturation analysis result corresponding to each sample feature; Performing importance analysis based on the sample labels and the original high-order combined features to obtain importance analysis results corresponding to each of the sample features; If the saturation analysis result meets the saturation standard threshold, and the importance analysis result meets the importance standard threshold, then the initial leaf node in the initial forest model corresponding to the sample feature is determined as a valid leaf node; Pruning the initial leaf nodes of the initial forest model based on the valid leaf nodes to obtain a valid forest model; Inputting the original training data into the effective forest model to obtain effective high-order combination features in the form of One-Hot encoding corresponding to the original training data; LR regularization screening is performed based on the sample labels and the effective high-order combined features to determine the target leaf nodes, and the effective leaf nodes in the effective forest model are pruned based on the target leaf nodes to obtain the target forest model; the target forest model is the forest model corresponding to the model training sample for generating the DeepFM model after the model training is completed, and the DeepFM model is used to construct a user portrait analysis model.

2. The sample model training method according to claim 1, characterized in that: The performing importance analysis based on the sample label and the original high-order combined features to obtain the importance analysis result corresponding to each of the sample features includes: From the original high-order combined features whose sample labels match the model training purpose, count the number of third features of the original high-order combined features in the initial leaf node corresponding to the same sample feature, and determine the sample feature value with the largest number of third features as the standard feature value corresponding to the sample feature; The sample feature value corresponding to each of the sample features in the original high-order combined features and the standard feature value are used to determine the current correlation coefficient of each of the sample features; The standard deviation of the current correlation coefficients corresponding to all the original high-order combined features is calculated to obtain the importance analysis result corresponding to each sample feature.

3. The sample model training method according to claim 1, characterized in that: The performing LR regularization screening based on the sample label and the effective high-order combined features to determine the target leaf node includes: Divide all valid high-order combinations into a training set and a validation set, perform LR modeling based on the valid high-order combination features in the training set, and adjust the L2 regularization coefficient so that the AUC of the valid high-order combination features in the validation set is maximized to obtain the target LR model; Based on the target LR model, obtaining an absolute value of an LR coefficient corresponding to each of the valid leaf nodes in the valid forest model; A preset number of valid leaf nodes having larger absolute values ​​of the LR coefficients are selected and determined as target leaf nodes.

4. A sample generation method, characterized in that: include: Acquire data to be processed, wherein the data to be processed includes feature data corresponding to at least two sample features; The feature data corresponding to at least two sample features are input into the target forest model determined by the sample model training method described in any one of claims 1 to 3, and the target high-order combined features in the form of One-Hot encoding output by the target forest model are determined as the model training samples of the DeepFM model.

5. A sample model training device, the device being used to implement the sample model training method according to any one of claims 1 to 3, characterized in that: The device comprises: An original training data acquisition module, used to acquire original training data, wherein the original training data includes a sample label and feature data corresponding to at least two sample features; An original high-order combined feature acquisition module is used to input the original training data into an initial forest model constructed based on a tree model to obtain original high-order combined features in a One-Hot encoding form corresponding to the original training data, wherein the initial forest model includes at least two feature trees arranged in sequence, each of which corresponds to one of the sample features and includes at least two initial leaf nodes; An effective forest model acquisition module, used to perform stability screening based on the sample labels and the original high-order combined features, determine effective leaf nodes, and prune the initial leaf nodes of the initial forest model based on the effective leaf nodes to obtain an effective forest model; An effective high-order combined feature acquisition module, used to input the original training data into the effective forest model to obtain effective high-order combined features in the form of One-Hot encoding corresponding to the original training data; The target forest model acquisition module is used to perform LR regularization screening based on the sample labels and the effective high-order combined features, determine the target leaf nodes, prune the effective leaf nodes in the effective forest model based on the target leaf nodes, and obtain the target forest model.

6. A sample generating device, characterized in that: include: A module for acquiring data to be processed, used to acquire data to be processed, wherein the data to be processed includes feature data corresponding to at least two sample features; A model training sample acquisition module is used to input feature data corresponding to at least two sample features into a target forest model determined by the sample model training method described in any one of claims 1 to 3, and determine the target high-order combined features in the form of One-Hot encoding output by the target forest model as model training samples of the DeepFM model.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the sample model training method as described in any one of claims 1 to 3; or, when the processor executes the computer program, it implements the sample generation method as described in claim 4.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the sample model training method as described in any one of claims 1 to 3; or, when the computer program is executed by a processor, it implements the sample generation method as described in claim 4.

Citation Information

Patent Citations

  • Multi-feature fusion extraction method in field of financial risk control

    CN107423871A

  • A method and system for performing object detection using a multi-task object detection model

    CN109344806A