Method and apparatus for generating a model

By calculating the evaluation indicators of features and determining the threshold for mutation points, the problem of huge feature volume in the prediction of gender labels of e-commerce users is solved, and the model training efficiency and accuracy are improved.

CN113792952BActive Publication Date: 2025-01-10BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110200440.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-23
Publication Date
2025-01-10
Estimated Expiration
2041-02-23

AI Technical Summary

Technical Problem

In the gender label prediction scenario of e-commerce users, the model's feature volume is huge, which makes model training difficult and feature screening urgently is needed.

Method used

By calculating the evaluation index of the feature, determine the mutation point of the evaluation index as the threshold, so as to screen out the features whose evaluation index is greater than the threshold for model training. Use the polynomial function to fit the slope mutation point or the average slope ratio maximum feature as the threshold to perform feature screening .

Benefits of technology

It improves the accuracy and efficiency of feature screening, reduces model training time, and uses fewer features to obtain a model with high accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113792952B_ABST
    Figure CN113792952B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose methods, devices, equipment and storage media for generating models. A specific implementation of the method includes: obtaining the original feature set; calculating the evaluation index of each feature in the feature set, and sorting the features in descending order according to the evaluation index to obtain a feature sequence; determining the mutation point of the evaluation index from the feature sequence as the evaluation index threshold; screening out features whose evaluation index is greater than the evaluation index threshold from the feature sequence as features for model training; obtaining a training sample set based on the features for model training; using the training sample set to perform model training to obtain a trained model. This implementation can improve the accuracy and efficiency of feature screening, thereby training a model with high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a method and device for generating a model. Background Art

[0002] In the existing model training process, the number of features is huge, which makes model training difficult. In a typical case, for example, in the scenario of e-commerce user gender label prediction, the model features include: user attributes, user levels, features related to the attributes of the goods ordered by the user, and user behavior features such as ordering, adding to cart, clicking, browsing, etc., especially behavioral features, which are particularly sparse. Each user only buys, clicks, and adds to cart a few goods in different categories, and the rest of the features are 0. This leads to the problem of a huge number of features, which can reach tens of millions or even hundreds of millions in e-commerce scenarios, making model training difficult and urgently requiring feature screening. Summary of the invention

[0003] Embodiments of the present disclosure provide methods and devices for generating models.

[0004] In a first aspect, an embodiment of the present disclosure provides a method for generating a model, comprising: obtaining an original feature set; calculating an evaluation index for each feature in the feature set, and sorting the features in descending order of the evaluation index to obtain a feature sequence; determining a mutation point of the evaluation index from the feature sequence as an evaluation index threshold; screening out features whose evaluation index is greater than the evaluation index threshold from the feature sequence as features for model training; obtaining a training sample set based on the features for model training; and performing model training using the training sample set to obtain a trained model.

[0005] In some embodiments, a mutation point of an evaluation index is determined from a feature sequence as an evaluation index threshold, including: using the subscript index of each feature after sorting as the horizontal coordinate, and the evaluation index of each feature as the vertical coordinate to determine the position of each feature in the coordinate system, and calculating the slope between each feature and the previous feature as the slope corresponding to each feature; using the subscript index of each feature after sorting as the independent variable and the corresponding slope as the dependent variable, performing polynomial function fitting to obtain a fitting curve of all feature slopes; analyzing the slope mutation point of the fitting curve, and using the evaluation index corresponding to the slope mutation point as the evaluation index threshold.

[0006] In some embodiments, a mutation point of an evaluation index is determined from a feature sequence as an evaluation index threshold, including: using the subscript index of each feature after sorting as the horizontal coordinate, using the evaluation index of each feature as the vertical coordinate to determine the position of each feature in the coordinate system, and calculating the slope between each feature and other features; finding a target feature from the feature sequence, so that the feature sequence is divided into a first interval and a second interval by the target feature, and the ratio of the average slope between each feature in the first interval to the average slope between each feature in the second interval is the largest; and determining the evaluation index corresponding to the target feature as the evaluation index threshold.

[0007] In some embodiments, the method further includes: performing a significance test on each feature according to the evaluation index.

[0008] In some embodiments, the model is a gender prediction model, the input of the model is the user's characteristics, and the output is the user's gender.

[0009] In some embodiments, the method further includes: performing a performance evaluation on the trained model to obtain an evaluation result; if the evaluation result does not meet the target expectation, re-determining the evaluation index threshold.

[0010] In some embodiments, the evaluation index includes a chi-square value or information entropy.

[0011] In a second aspect, an embodiment of the present disclosure provides a device for generating a model, comprising: an acquisition unit, configured to acquire an original feature set; a calculation unit, configured to calculate an evaluation index for each feature in the feature set, and sort the features in descending order of the evaluation index to obtain a feature sequence; a determination unit, configured to determine a mutation point of the evaluation index from the feature sequence as an evaluation index threshold; a screening unit, configured to screen out features whose evaluation index is greater than the evaluation index threshold from the feature sequence as features for model training; a training unit, configured to acquire a training sample set based on the features for model training, perform model training using the training sample set, and obtain a trained model.

[0012] In some embodiments, the determination unit is further configured to: use the subscript index of each feature after sorting as the horizontal coordinate and the evaluation index of each feature as the vertical coordinate to determine the position of each feature in the coordinate system, and calculate the slope between each feature and the previous feature as the slope corresponding to each feature; use the subscript index of each feature after sorting as the independent variable and the corresponding slope as the dependent variable to perform polynomial function fitting to obtain a fitting curve of all feature slopes; analyze the slope mutation point of the fitting curve, and use the evaluation index corresponding to the slope mutation point as the evaluation index threshold.

[0013] In some embodiments, the determination unit is further configured to: use the subscript index of each feature after sorting as the horizontal coordinate and the evaluation index of each feature as the vertical coordinate to determine the position of each feature in the coordinate system, and calculate the slope between each feature and other features; find a target feature from the feature sequence, so that the feature sequence is divided into a first interval and a second interval by the target feature, and the ratio of the average slope between the features in the first interval to the average slope between the features in the second interval is the largest; determine the evaluation index corresponding to the target feature as the evaluation index threshold.

[0014] In some embodiments, the device further includes a testing unit configured to: perform a significance test on each feature according to the evaluation index.

[0015] In some embodiments, the model is a gender prediction model, the input of the model is the user's characteristics, and the output is the user's gender.

[0016] In some embodiments, the device also includes an evaluation unit configured to: perform performance evaluation on the trained model to obtain an evaluation result; if the evaluation result does not meet the target expectation, redetermine the evaluation indicator threshold.

[0017] In some embodiments, the evaluation index includes a chi-square value or information entropy.

[0018] In a third aspect, an embodiment of the present disclosure provides an electronic device for generating a model, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement a method as described in any one of the first aspects.

[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of the first aspects is implemented.

[0020] The method and device for generating a model provided by the embodiments of the present disclosure calculate the evaluation index of the feature, find the mutation point of the evaluation index, perform feature screening, and extract the accuracy and efficiency of feature screening, thereby reducing the model training time, that is, using fewer features for training can still obtain a high-precision model. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0022] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;

[0023] Figure 2 is a flowchart of one embodiment of a method for generating a model according to the present disclosure;

[0024] Figure 3a-3c is a schematic diagram of mutation points of evaluation indicators of the method for generating a model according to the present disclosure;

[0025] Figure 4 is a flowchart of another embodiment of a method for generating a model according to the present disclosure;

[0026] Figure 5 is a structural schematic diagram of an embodiment of an apparatus for generating a model according to the present disclosure;

[0027] Figure 6 It is a structural diagram of a computer system of an electronic device suitable for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0029] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0030] Figure 1 An exemplary system architecture 100 is shown to which the method and apparatus for generating a model according to an embodiment of the present application can be applied.

[0031] like Figure 1 As shown, the system architecture 100 may include terminals 101, 102, a network 103, a database server 104, and a server 105. The network 103 is used to provide a medium for communication links between the terminals 101, 102, the database server 104, and the server 105. The network 103 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0032] The user 110 can use the terminals 101 and 102 to interact with the server 105 through the network 103 to receive or send messages, etc. Various client applications can be installed on the terminals 101 and 102, such as model training applications, shopping applications, payment applications, web browsers, and instant messaging tools.

[0033] The terminals 101 and 102 here can be hardware or software. When the terminals 101 and 102 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Dynamic Image Experts Compression Standard Audio Layer 3), laptops and desktop computers, etc. When the terminals 101 and 102 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0034] The database server 104 may be a database server that provides various services. For example, a sample set may be stored in the database server. The sample set includes a large number of samples. Each sample may include various features. In this way, the user 110 may also select features of samples from the sample set stored in the database server 104 through the terminals 101 and 102.

[0035] The server 105 may also be a server that provides various services, such as a background server that supports various applications displayed on the terminals 101 and 102. The background server may train the initial model using the features of the samples in the sample set sent by the terminals 101 and 102, and may send the training results (such as the generated shopper gender recognition model) to the terminals 101 and 102. In this way, the user may apply the generated model for gender detection.

[0036] The database server 104 and the server 105 here can also be hardware or software. When they are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When they are software, they can be implemented as multiple software or software modules (for example, for providing distributed services), or as a single software or software module. No specific limitation is made here.

[0037] It should be noted that the method for generating a model provided in the embodiment of the present application is generally executed by the server 105. Accordingly, the device for generating a model is generally also disposed in the server 105.

[0038] It should be pointed out that, in the case where the server 105 can implement the related functions of the database server 104 , the database server 104 may not be provided in the system architecture 100 .

[0039] It should be understood that Figure 1The number of terminals, networks, database servers and servers in the embodiment is only for illustration. Any number of terminals, networks, database servers and servers may be provided according to the implementation requirements.

[0040] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for generating a model according to the present disclosure. The method for generating a model comprises the following steps:

[0041] Step 201, obtaining an original feature set.

[0042] In this embodiment, the execution body of the method for generating the model (eg Figure 1 The server shown in the figure can obtain the original feature set from the database server through a wired connection or a wireless connection. Models for different purposes involve different original feature sets. Taking the e-commerce user gender recognition model as an example, the e-commerce user gender-related features are extracted and the feature records are marked to obtain model training data. The extracted original feature set covers the following:

[0043] 1. User-related characteristics:

[0044] √User attributes

[0045] √ User level

[0046] √ User age

[0047] √ User category preference

[0048] √User value score ...

[0050] 2. User product related characteristics:

[0051] √The color of the product ordered by the user

[0052] √ Sales volume of goods ordered by users

[0053] √The popularity of the products ordered by users

[0054] √The weight of the product ordered by the user

[0055] √The size of the goods ordered by the user

[0056] √ Number of clicks on products ordered by users

[0057] 3. Cross-features related to user behavior: ...

[0059] √ User behavior characteristics such as ordering, adding to cart, clicking, browsing, etc. for all products, multi-level categories, and brands. The number of characteristics is the same as the number of products, categories, and brands, which can reach tens of millions;

[0060] The data is labeled to mark the gender of the user. As shown in Table 1 below:

[0061]

[0062] Table 1

[0063] Step 202, calculate the evaluation index of each feature in the feature set, and sort the features in descending order according to the evaluation index to obtain a feature sequence.

[0064] In this embodiment, the evaluation index may be a chi-square value or information entropy, etc. Reference may be made to the evaluation index and calculation method used by the filter method in the prior art. Then, the features are sorted in descending order according to the evaluation index, and the subscript index of the obtained feature sequence is sorted in descending order, that is, the feature with a larger evaluation index has a smaller subscript index.

[0065] The chi-square values ​​calculated from the data in Table 1 are shown in Table 2, and the ranking results are shown in Table 3.

[0066]

[0067] Table 2

[0068]

[0069] Table 3

[0070] Chi-square calculation is used to filter all the expanded products, categories, and brand features. Because the number of features is huge and there are too many useless features, the calculation method is as follows:

[0071] In the following table, the training set data corresponds to user names, multiple product features, and gender identifiers (1: male, 0: female):

[0072] user shaver notebook Lipstick gender Zhang m 2 1 0 1 Wang h 1 0 0 1 Li 0 1 4 0 ... ... ... ... ...

[0073] Table 4

[0074] First, calculate the number of users corresponding to each feature field and gender:

[0075]

[0076]

[0077] Table 5

[0078] Then calculate according to the chi-square calculation formula (where A, B, C, D, and N are the corresponding letters in the table):

[0079]

[0080] Then the chi-square value of each product feature is obtained.

[0081] Calculation methods for other evaluation indicators:

[0082] For example, the information gain method, which represents the mutual information between classes and features in the training set, is slightly different from the chi-square calculation process. It directly calculates the two-dimensional table of the training set. The calculation process is as follows:

[0083] (1) Input training data set

[0084] (2) Calculate the empirical entropy of data set D: (where C is the corresponding category)

[0085] (3) Calculate the empirical entropy conditional entropy H(D|A) of feature A for data set D

[0086] (where k is the number of categories and n is the number of records in the dataset)

[0087] (4) Calculate information gain: g(D, A) = H(D) - H(D|A)

[0088] (5) Output feature A for the information gain of training data set D g(D, A)

[0089] Step 203: determine the mutation point of the evaluation index from the feature sequence as the evaluation index threshold.

[0090] In this embodiment, the evaluation index can be directly used as the dependent variable, and the subscript index of each feature after sorting can be used as the independent variable to perform polynomial function fitting to obtain the curve of the evaluation index, and then the mutation point of the evaluation index can be solved by mathematical methods. Or the mutation point for solving the evaluation index can be converted into the mutation point for solving the slope. Because the curve starts to accelerate and then suddenly slows down after a certain point and gradually flattens out. This turning point is the slope change point.

[0091] In some optional implementations of the present embodiment, a mutation point of an evaluation index is determined from the feature sequence as an evaluation index threshold, including: using the subscript index of each feature after sorting as the horizontal coordinate and the evaluation index of each feature as the vertical coordinate to determine the position of each feature in the coordinate system, and calculating the slope between each feature and other features; finding a target feature from the feature sequence, so that the feature sequence is divided into a first interval and a second interval by the target feature, and the ratio of the average slope between each feature in the first interval to the average slope between each feature in the second interval is the largest; and determining the evaluation index corresponding to the target feature as the evaluation index threshold.

[0092] The slope of the two-point line segment represents the downward trend of category discrimination:

[0093]

[0094] Represents the average rate of change of the category discrimination of the interval [i, i+n]. This parameter describes the overall change trend of the category discrimination within a certain interval.

[0095] The slope change point can be calculated using the following formula:

[0096]

[0097] It represents the slope from the 1st point to the i-th point, that is, the average rate of change of ID {1, 2, ..., i}; It represents the slope from the i-th point to the i+1-th point, that is, the average slope of the points with ID {i, i+1}.

[0098] This method solves the local mutation points.

[0099] In some optional implementations of the present embodiment, a mutation point of an evaluation index is determined from a feature sequence as an evaluation index threshold, including: using the subscript index of each feature after sorting as the horizontal coordinate and the evaluation index of each feature as the vertical coordinate to determine the position of each feature in the coordinate system, and calculating the slope between each feature and the previous feature as the slope corresponding to each feature; using the subscript index of each feature after sorting as the independent variable and the corresponding slope as the dependent variable, performing polynomial function fitting to obtain a fitting curve of all feature slopes; analyzing the slope mutation point of the fitting curve, and using the evaluation index corresponding to the slope mutation point as the evaluation index threshold.

[0100] First, we need to calculate the slope. After descending, we calculate the slope of the line segment between each feature and the previous feature in the coordinate graph as the slope corresponding to the current feature.

[0101] The calculation formula is as follows:

[0102]

[0103] Among them, x i Indicates the subscript index of the current feature, y i Represents the evaluation index of the current feature, x i-1 Indicates the subscript index of the previous feature, y i-1 Represents the evaluation index of the previous feature. For the first feature, since there is no previous feature, the slope corresponding to the first feature is a very large value.

[0104] The calculated slopes are shown in Table 6:

[0105]

[0106] Table 6

[0107] Then, the subscript index of each feature after sorting is used as the independent variable, and the corresponding slope is used as the dependent variable to perform polynomial function fitting to obtain the slope fitting function F(x) of all features. The fitting can use optimization algorithms such as stochastic gradient descent to obtain the polynomial function.

[0108] The global mutation point analysis method proposed in the present invention is used to calculate the chi-square threshold, and the specific formula is as follows:

[0109]

[0110] Among them, max: represents the subscript index corresponding to the first feature after all features are sorted according to the evaluation index, min: represents the subscript index corresponding to the last feature after all features are sorted according to the evaluation index, and t represents the mutation point to be found.

[0111]

Formula derivation process

[0112] Fit the curve and get the approximate function representation of the function, assumed to be F(x);

[0113] To find the global mutation point, the problem is transformed into finding the average slope between a certain point and the first point and between the point and the last point in the function. Let the former be represented by: afore_fun, and the latter by: after_fun. Since it is a continuous function, the average slope within a certain range can be found by the integral method:

[0114]

[0115]

[0116] Final goal = afore_fun / after_fun (7)

[0117]

[0118] So we get the target calculation formula:

[0119]

[0120] Among them, T represents the feature ID and evaluation index value corresponding to the final global mutation point, max represents the subscript index corresponding to the first feature after all features are sorted according to the evaluation index, min represents the subscript index corresponding to the last feature after all features are sorted according to the evaluation index, t represents the mutation point to be found, and F(x) represents the evaluation index fitting function.

[0121] Data distribution is as follows Figure 3a As shown, the fitting function graph is as follows Figure 3b As shown, it corresponds to Table 6. Among them, the horizontal axis is the index of the feature, and the horizontal axis 1, 2, 3... respectively represents the name of the feature item_ord2, item_ord3, item_ord4... The vertical axis represents the slope.

[0122] The fitting function is:

[0123] F(x)=0.67x^5+0.82x^4-0.7x^3+0.2x^2-0.004x-0.0046967953

[0124] Finally, the threshold is calculated:

[0125]

[0126] The chi-square value corresponding to the subscript 7 is 4.

[0127] If other evaluation indicators are used, the results are as follows: Figure 3c shown.

[0128] This method can obtain the global mutation point of the curve with high computational efficiency and small resource occupation.

[0129] Step 204 , filtering out features whose evaluation index is greater than the evaluation index threshold from the feature sequence as features for model training.

[0130] In this embodiment, according to the chi-square threshold obtained in the previous step, features greater than the chi-square threshold are extracted from the chi-square ranking table as shown in Table 5:

[0131]

[0132] Table 7

[0133] Step 205: Obtain a training sample set based on the features used for model training.

[0134] In this embodiment, for example, the selected features include user attributes, user levels, attributes of the goods ordered by the user, and user orders, add-to-carts, clicks, and browsing. Each sample in the constructed sample set includes the features selected in step 204. The sample also includes category labels with these features (for example, in the gender prediction model, 0 represents male and 1 represents female).

[0135] Step 206: Use the training sample set to perform model training to obtain a trained model.

[0136] In this embodiment, the features of the training samples are used as input, and the category labels are used as the expected outputs to train a neural network model, which can be classified according to the input features. For the gender prediction model, the user's features (such as user-related features, user-product-related features, user behavior-related cross-features, etc.) are input, and the prediction result obtained is the user's gender. The predicted gender is compared with the expected output, and the loss value is calculated. If the loss value is greater than a predetermined threshold, the network parameters of the model are adjusted and training continues. The training process is a prior art and will not be described in detail here.

[0137] The method provided by the above embodiment of the present disclosure provides a global mutation point statistical analysis method. By analyzing the global mutation point, a qualified threshold is found for feature screening. The problem that the threshold setting of the feature evaluation index in the Filter algorithm in the prior art can only be set in a qualitative manner, resulting in poor algorithm stability, is solved.

[0138] In some optional implementations of this embodiment, the method further includes: performing a significance test (such as p-value, etc.) on each feature according to an evaluation index.

[0139] Further references Figure 4 , which shows a process 400 of another embodiment of a method for generating a model. The process 400 of the method for generating a model includes the following steps:

[0140] Step 401, obtaining the original feature set.

[0141] Step 402, calculate the evaluation index of each feature in the feature set, and sort the features in descending order according to the evaluation index to obtain a feature sequence.

[0142] Step 403: determine the mutation point of the evaluation index from the feature sequence as the evaluation index threshold.

[0143] Step 404: Select features whose evaluation index is greater than the evaluation index threshold from the feature sequence as features for model training.

[0144] Steps 401-404 are substantially the same as steps 201-204, and thus are not described in detail herein.

[0145] Step 405: Acquire a training sample set according to the selected features.

[0146] In this embodiment, the selected features are the features used for model training obtained in step 404. For example, the selected features include user attributes, user levels, features related to the attributes of the goods ordered by the user, and user orders, add-to-cart, clicks, and browsing. Each sample in the constructed sample set includes the features selected in step 404. And the sample also includes the category labels with these features (for example, in the gender prediction model, 0 represents male and 1 represents female).

[0147] Step 406: Use the training sample set to perform model training to obtain a trained model.

[0148] In this embodiment, the features of the training samples are used as input, and the category labels are used as the expected outputs to train a neural network model, which can be classified according to the input features. For the gender prediction model, the user's features are input, and the prediction result obtained is the user's gender. The predicted gender is compared with the expected output, and the loss value is calculated. If the loss value is greater than a predetermined threshold, the network parameters of the model are adjusted and training continues. The training process is a prior art and will not be described in detail here.

[0149] Step 407: Perform performance evaluation on the trained model to obtain evaluation results.

[0150] In this embodiment, the performance of the model can be evaluated by common technical means in the prior art, for example, the model can be verified by a verification set to obtain evaluation results such as recall rate and accuracy rate.

[0151] Step 408: If the evaluation result fails to meet the target expectation, the evaluation index threshold is re-determined.

[0152] In this embodiment, the target expectation may include that multiple indicators all reach a predetermined threshold, for example, the recall rate reaches more than 80%, the accuracy rate reaches more than 80%, etc. If the evaluation result does not meet the target expectation, it means that the performance of the model does not meet the standard, which may be due to the incorrect selection of the evaluation indicator threshold. Step 403 can be re-executed to obtain a new evaluation indicator threshold, and then the evaluation indicator is re-selected, and the sample is re-selected according to the new evaluation indicator to retrain the model. Steps 403-408 can be repeatedly executed until a suitable evaluation threshold is found and a model whose evaluation result meets the target expectation is trained.

[0153] from Figure 4 It can be seen that Figure 2 Compared with the corresponding embodiment, the process 400 of the method for generating a model in this embodiment embodies the step of evaluating the model. Therefore, the solution described in this embodiment can re-screen features according to the evaluation results, thereby improving the accuracy of the model.

[0154] Further references Figure 5As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a device for generating a model. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0155] like Figure 5 As shown, the device 500 for generating a model in this embodiment includes: an acquisition unit 501, a calculation unit 502, a determination unit 503, a screening unit 504, and a training unit 505. Among them, the acquisition unit 501 is configured to acquire the original feature set; the calculation unit 502 is configured to calculate the evaluation index of each feature in the feature set, and sort the features in descending order according to the evaluation index to obtain a feature sequence; the determination unit 503 is configured to determine the mutation point of the evaluation index from the feature sequence as the evaluation index threshold; the screening unit 504 is configured to screen out the features whose evaluation index is greater than the evaluation index threshold from the feature sequence as the features for model training; the training unit 505 is configured to: acquire a training sample set according to the features for model training; use the training sample set to perform model training to obtain a trained model.

[0156] In this embodiment, the specific processing of the acquisition unit 501, the calculation unit 502, the determination unit 503, the screening unit 504, and the training unit 505 of the device 500 for generating a model can be referred to. Figure 2 Corresponding to step 201, step 202, step 203, step 204, step 205, and step 206 in the embodiment.

[0157] In some optional implementations of the present embodiment, the determination unit 503 is further configured to: use the subscript index of each feature after sorting as the horizontal coordinate and the evaluation index of each feature as the vertical coordinate to determine the position of each feature in the coordinate system, and calculate the slope between each feature and the previous feature as the slope corresponding to each feature; use the subscript index of each feature after sorting as the independent variable and the corresponding slope as the dependent variable to perform polynomial function fitting to obtain a fitting curve of all feature slopes; analyze the slope mutation point of the fitting curve, and use the evaluation index corresponding to the slope mutation point as the evaluation index threshold.

[0158] In some optional implementations of the present embodiment, the determination unit 503 is further configured to: use the subscript index of each feature after sorting as the horizontal coordinate and the evaluation index of each feature as the vertical coordinate to determine the position of each feature in the coordinate system, and calculate the slope between each feature and other features; find a target feature from the feature sequence, so that the feature sequence is divided into a first interval and a second interval by the target feature, and the ratio of the average slope between the features in the first interval to the average slope between the features in the second interval is the largest; and determine the evaluation index corresponding to the target feature as the evaluation index threshold.

[0159] In some optional implementations of this embodiment, the device further includes a testing unit (not shown in the drawings) configured to perform a significance test on each feature according to the evaluation index.

[0160] In some optional implementations of this embodiment, the model is a gender prediction model, the input of the model is the user's characteristics, and the output is the user's gender.

[0161] In some optional implementations of this embodiment, the device also includes an evaluation unit (not shown in the drawings), which is configured to: perform performance evaluation on the trained model to obtain an evaluation result; if the evaluation result does not meet the target expectation, redetermine the evaluation index threshold.

[0162] In some embodiments, the evaluation index includes a chi-square value or information entropy.

[0163] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 A schematic diagram of the structure of the server in (a) 600. Figure 6 The server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0164] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0165] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0166] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above functions defined in the method of the embodiment of the present disclosure are executed. It should be noted that the computer-readable medium described in the embodiment of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus, or a device. In an embodiment of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus, or a device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.

[0167] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains the original feature set; calculates the evaluation index of each feature in the feature set, and sorts the features in descending order according to the evaluation index to obtain a feature sequence; determines the mutation point of the evaluation index from the feature sequence as the evaluation index threshold; selects the features whose evaluation index is greater than the evaluation index threshold from the feature sequence as the features for model training; obtains a training sample set based on the features for model training; and performs model training using the training sample set to obtain a trained model.

[0168] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0169] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0170] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units described may also be provided in a processor, for example, may be described as: a processor including an acquisition unit, a calculation unit, a determination unit, a screening unit, and a training unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the acquisition unit may also be described as a "unit for acquiring an original feature set".

[0171] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

Claims

1. A method for generating a model, comprising: Obtaining an original feature set, wherein the feature set includes the following features: user-related features, user-product-related features, and user behavior-related cross-features, wherein the cross-features include at least one of the following: ordering, adding to cart, clicking, and browsing; Calculating an evaluation index for each feature in the feature set, and sorting the features in descending order according to the evaluation index to obtain a feature sequence, wherein the evaluation index includes a chi-square value; Determining a mutation point of the evaluation index from the feature sequence as an evaluation index threshold; Selecting features whose evaluation index is greater than the evaluation index threshold from the feature sequence as features for model training; Acquire a training sample set according to the features used for model training; Taking the features of the training samples as input and the category labels as the expected output, training the neural network model, wherein the neural network model performs classification according to the input features; The step of determining the mutation point of the evaluation index from the feature sequence as the evaluation index threshold comprises: The subscript index of each feature after sorting is used as the horizontal coordinate, and the evaluation index of each feature is used as the vertical coordinate to determine the position of each feature in the coordinate system. The slope between each feature and the previous feature is calculated as the slope corresponding to each feature. The subscript index of each feature after sorting is used as the independent variable, and the corresponding slope is used as the dependent variable. Polynomial function fitting is performed to obtain the fitting curve of all feature slopes; The slope mutation point of the fitting curve is analyzed, and the evaluation index corresponding to the slope mutation point is used as the evaluation index threshold.

2. The method according to claim 1, wherein: The step of determining a mutation point of the evaluation index from the feature sequence as the evaluation index threshold comprises: The subscript index of each feature after sorting is used as the horizontal coordinate, and the evaluation index of each feature is used as the vertical coordinate to determine the position of each feature in the coordinate system, and calculate the slope between each feature and other features; Find a target feature from the feature sequence, so that the feature sequence is divided into a first interval and a second interval by the target feature, and the ratio of the average slope between the features in the first interval to the average slope between the features in the second interval is the largest; An evaluation index corresponding to the target feature is determined as an evaluation index threshold.

3. The method according to claim 1, wherein: The method further comprises: A significance test is performed on each feature according to the evaluation index.

4. The method according to claim 1, wherein: The method further comprises: Perform performance evaluation on the trained model and obtain evaluation results; If the evaluation result fails to meet the target expectation, the evaluation index threshold is re-determined.

5. The method according to claim 1, wherein: The model is a gender prediction model, the input of the model is the user's features, and the output is the user's gender.

6. The method according to any one of claims 1 to 5, wherein: The evaluation index includes a chi-square value or information entropy.

7. A device for generating a model, comprising: The acquisition unit is configured to acquire an original feature set, wherein the feature set includes the following features: user-related features, user-product-related features, and user behavior-related cross-features, wherein the cross-features include at least one of the following: ordering, adding to cart, clicking, and browsing; A calculation unit is configured to calculate an evaluation index of each feature in the feature set, and sort the features in descending order according to the evaluation index to obtain a feature sequence, wherein the evaluation index includes a chi-square value; A determination unit, configured to determine a mutation point of the evaluation index from the feature sequence as an evaluation index threshold; A screening unit is configured to screen out features whose evaluation index is greater than the evaluation index threshold from the feature sequence as features for model training; A training unit is configured to take the features of the training samples as input and the category labels as expected outputs to train a neural network model, wherein the neural network model performs classification according to the input features; The step of determining the mutation point of the evaluation index from the feature sequence as the evaluation index threshold comprises: The subscript index of each feature after sorting is used as the horizontal coordinate, and the evaluation index of each feature is used as the vertical coordinate to determine the position of each feature in the coordinate system. The slope between each feature and the previous feature is calculated as the slope corresponding to each feature. The subscript index of each feature after sorting is used as the independent variable, and the corresponding slope is used as the dependent variable. Polynomial function fitting is performed to obtain the fitting curve of all feature slopes; The slope mutation point of the fitting curve is analyzed, and the evaluation index corresponding to the slope mutation point is used as the evaluation index threshold.

8. An electronic device for generating a model, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and system for evaluating application

    CN111754126A