CN111325228A - Model training method and device - Google Patents

Model training method and device Download PDF

Info

Publication number
CN111325228A
CN111325228A CN201811544547.2A CN201811544547A CN111325228A CN 111325228 A CN111325228 A CN 111325228A CN 201811544547 A CN201811544547 A CN 201811544547A CN 111325228 A CN111325228 A CN 111325228A
Authority
CN
China
Prior art keywords
sample data
negative sample
negative
determining
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811544547.2A
Other languages
Chinese (zh)
Other versions
CN111325228B (en
Inventor
林淼哲
方桢
张峻滔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Youkun Information Technology Co ltd
Original Assignee
Shanghai Youkun Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Youkun Information Technology Co ltd filed Critical Shanghai Youkun Information Technology Co ltd
Priority to CN201811544547.2A priority Critical patent/CN111325228B/en
Publication of CN111325228A publication Critical patent/CN111325228A/en
Application granted granted Critical
Publication of CN111325228B publication Critical patent/CN111325228B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • G06F18/24133Distances to prototypes

Abstract

The embodiment of the invention discloses a model training method and a device, wherein the method comprises the following steps: for each negative sample data, determining whether the negative sample data is untrustworthy negative sample data according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q negative sample data; and performing model training by using the credible negative sample data except the incredible negative sample data in the P positive sample data and the Q negative sample data to obtain a binary model. In the embodiment of the invention, the credible negative sample data used for training the model is obtained by determining the incredible negative sample data in the Q negative sample data, and compared with the negative sample data obtained based on random screening or manual screening in the prior art, the credible negative sample data in the embodiment of the invention is more accurate, so that the binary classification model obtained based on the training of the credible negative sample data is more reasonable, and the prediction result is more in line with the actual situation.

Description

Model training method and device
Technical Field
The invention relates to the field of data processing, in particular to a model training method and device.
Background
Under the internet marketing mode, a marketer usually wants to be able to screen out users who are interested in the product marketed by the marketer (called target users) from a plurality of users, so that advertisements can be put on the target users in a targeted manner, and product marketing is realized. One of the most common methods for determining the target user is: and training the model by adopting positive sample data and negative sample data to obtain a two-classification model, and predicting whether a certain user is a target user by using the two-classification model obtained by training. Wherein, the positive sample data can be the data of the existing users interested in the product, such as the data of the users who have purchased the product and included in the client system of the marketer; the negative sample data may be data of a part of users screened from a preset database. In specific implementation, the accuracy of the negative sample data affects the effect of model training, so that the accuracy of the target user predicted according to the binary model is affected. Therefore, how to accurately determine the negative sample data is very important for realizing the marketing of the product and improving the marketing efficiency.
In the prior art, when negative sample data is determined, data of one or more users is generally randomly selected from data of multiple users stored in a preset database to serve as the negative sample data, or data of multiple users is screened in advance in a manual mode to serve as the negative sample data. In the first method, the quality of the negative sample data may not be guaranteed because the negative sample data is determined by random screening, and therefore, if the negative sample data is used for model training, the trained model may have a poor effect. The second mode adopts manual screening, so that the cost is relatively high, the screening time is long, and the efficiency is not high; and the manually screened negative sample data can not meet the requirements of different marketing products, so that the model training has poor flexibility and poor effect.
In summary, there is a need for a model training method to improve the effect of the trained model.
Disclosure of Invention
The embodiment of the invention provides a model training method, which is used for improving the effect of a trained model.
The embodiment of the invention provides a model training method, which comprises the following steps:
acquiring M sample data, wherein the M sample data comprise P positive sample data and Q negative sample data, the positive sample data are data of a user known to be interested in a target object, and the Q negative sample data are data of a user unknown to be interested in the target object;
for each negative sample data in Q negative sample data, determining whether the negative sample data is untrustworthy negative sample data according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q negative sample data, wherein the untrustworthy negative sample data is data of a user who may be interested in the target object;
performing model training by using the P positive sample data and the credible negative sample data except the incredible negative sample data in the Q negative sample data to obtain a two-classification model; wherein M, P, Q are integers.
Optionally, the method further comprises: for each piece of negative sample data, predicting the negative sample data by using the two classification models to obtain a prediction score corresponding to the negative sample data;
and selecting the first W negative sample data with the maximum prediction score from the Q negative sample data, and recommending the target object to the user corresponding to the W negative sample data.
Optionally, each sample data in the M sample data includes values of N features;
for each negative sample data in the Q negative sample data, determining whether the negative sample data is untrusted negative sample data according to the difference values between the negative sample data and the P positive sample data and the difference values between the negative sample data and the Q negative sample data, including:
for each feature of the N features, determining a first probability density function corresponding to the feature from the P positive sample data, and determining a second probability density function corresponding to the feature from the Q negative sample data;
obtaining a first numerical value according to the values of the N characteristics included in each negative sample data and the first probability density functions respectively corresponding to the N characteristics; obtaining a second numerical value according to the values of the N characteristics included in each negative sample data and second probability density functions respectively corresponding to the N characteristics;
determining a first difference value according to the first numerical value and a first preset numerical value of the P pieces of positive sample data, and determining a second difference value according to the second numerical value and a second preset numerical value of the Q pieces of negative sample data;
and if the first difference value is smaller than the second difference value, determining that the negative sample data is untrustworthy.
Optionally, the method further comprises: determining the number of the untrusted negative sample data from the Q negative sample data to be X, and if the X is less than or equal to a second threshold, determining the Q-X negative sample data to be the trusted negative sample data; if the X is larger than a second threshold, aiming at each negative sample data in Q-X negative sample data, determining whether the negative sample data is the untrustworthy negative sample data according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q-X negative sample data.
Optionally, for each of the N features, determining a first probability density function corresponding to the feature from the P positive sample data includes:
calculating to obtain an initial average value and an initial variance corresponding to the characteristics according to the P pieces of positive sample data, and adjusting the initial average value and the initial variance according to a preset deviation value to obtain a target average value and a target variance;
and determining a first probability density function corresponding to the features according to the target average value and the target variance.
The embodiment of the invention provides a model training device, which comprises:
the acquisition module is used for acquiring M sample data, wherein the M sample data comprises P positive sample data and Q negative sample data, the positive sample data is data of a user known to be interested in a target object, and the Q negative sample data is data of a user unknown to be interested in the target object;
a determining module, configured to determine, for each negative sample data of Q negative sample data, whether the negative sample data is untrusted negative sample data according to a difference value between the negative sample data and the P positive sample data and a difference value between the negative sample data and the Q negative sample data, where the untrusted negative sample data is data of a user who may be interested in the target object;
the training module is used for performing model training by using the P positive sample data and the credible negative sample data except the credible negative sample data in the Q negative sample data to obtain a binary model; wherein M, P, Q are integers.
Optionally, the apparatus further comprises a processing module configured to:
for each piece of negative sample data, predicting the negative sample data by using the two classification models to obtain a prediction score corresponding to the negative sample data;
and selecting the first W negative sample data with the maximum prediction score from the Q negative sample data, and recommending the target object to the user corresponding to the W negative sample data.
Optionally, each sample data in the M sample data includes values of N features; the determining module is specifically configured to:
for each feature of the N features, determining a first probability density function corresponding to the feature from the P positive sample data, and determining a second probability density function corresponding to the feature from the Q negative sample data;
obtaining a first numerical value according to the values of the N characteristics included in each negative sample data and the first probability density functions respectively corresponding to the N characteristics; obtaining a second numerical value according to the values of the N characteristics included in each negative sample data and second probability density functions respectively corresponding to the N characteristics;
determining a first difference value according to the first numerical value and a first preset numerical value of the P pieces of positive sample data, and determining a second difference value according to the second numerical value and a second preset numerical value of the Q pieces of negative sample data;
and if the first difference value is smaller than the second difference value, determining that the negative sample data is untrustworthy.
Optionally, the determining module is further configured to: determining the number of the untrusted negative sample data from the Q negative sample data to be X, and if the X is less than or equal to a second threshold, determining the Q-X negative sample data to be the trusted negative sample data; if the X is larger than a second threshold, aiming at each negative sample data in Q-X negative sample data, determining whether the negative sample data is the untrustworthy negative sample data according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q-X negative sample data.
Optionally, the determining module is further configured to: calculating to obtain an initial average value and an initial variance corresponding to the characteristics according to the P pieces of positive sample data, and adjusting the initial average value and the initial variance according to a preset deviation value to obtain a target average value and a target variance;
and determining a first probability density function corresponding to the features according to the target average value and the target variance.
In the above embodiment of the present invention, for each negative sample data in Q negative sample data, it may be determined whether the negative sample data is an untrusted negative sample data according to a difference value between the negative sample data and P positive sample data and a difference value between the negative sample data and Q negative sample data, and then model training may be performed using the trusted negative sample data in the P positive sample data and the Q negative sample data except the untrusted negative sample data to obtain a binary model. In the embodiment of the invention, the credible negative sample data used for training the model is obtained by determining the incredible negative sample data in the Q negative sample data, and compared with the negative sample data obtained based on random screening or manual screening in the prior art, the credible negative sample data in the embodiment of the invention is more accurate, so that the binary classification model obtained based on the training of the credible negative sample data is more reasonable, and the prediction result is more in line with the actual situation.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of a possible application scenario provided in an embodiment of the present invention;
fig. 2 is a schematic flow chart corresponding to a model training method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a model training apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic diagram of a possible application scenario provided in an embodiment of the present invention, where the application scenario may be a crowd diffusion business scenario in an internet marketing mode. As shown in FIG. 1, the scene may include a marketer 110 and a marketing platform 120, and the marketer 110 may obtain users interested in the target objects through the marketing platform 120 and may deliver marketing advertisements to the users. The target object may be an advertisement, an application, music, a video, news information, a product, and the like, and is not limited specifically; for example, if the target object operated by the marketer is product a, users interested in product a can be obtained according to the marketing platform 120, so as to increase the profit.
In particular implementations, marketer 110 may use existing users as seed users, who may be users known to be interested in the target object, such as users who have purchased product a, or who may be determined potential users, and submit the seed user's identification to marketing platform 120. Accordingly, a preset database may be disposed in the marketing platform 120, and data of a plurality of users may be stored in the preset database, and the data of each user may be referred to as one sample data. After receiving the identifier of the seed user, the marketing platform 120 may determine the target user according to the identifier of the seed user and a plurality of sample data in the preset database, and feed back the identifier of the target user to the marketer 110. Further, the marketer 110 can place advertisements to the target users after receiving the feedback information sent by the marketing platform 120.
In one example, as shown in fig. 1, the preset database of the marketing platform 120 stores data of users 131 to 139, and after receiving the identifier of the seed user sent by the marketing platform 110, the marketing platform 120 determines that the target users include the user 131, the user 134, and the user 138, so that feedback information including the identifiers of the user 131, the user 132, and the user 133 may be sent to the marketing platform 110. At this point, marketer 110 places advertisements to user 131, user 134, and user 139, respectively.
In the embodiment of the present invention, the specific implementation process of determining the target user according to the identifier of the seed user and the plurality of sample data in the preset database may include a process of model training (training phase), a process of determining whether the user is the target user by using the model obtained by training (prediction phase), or may further include other processes, for example, a process of verifying the target user, and the like, and is not limited specifically.
Based on the application scenario illustrated in fig. 1, fig. 2 is an overall flowchart corresponding to a model training method provided in an embodiment of the present invention, and as shown in fig. 1, the method includes:
step 201, M sample data are obtained, where the M sample data include P positive sample data and Q negative sample data.
Here, the positive sample data may be data of a user known to be interested in the target object, and the negative sample data may be data of a user unknown to be interested in the target object. In one example, the positive sample data and the negative sample data may be sample data stored in a preset database, the positive sample data may be obtained according to the identifier of the seed user sent by the marketer 110, and the negative sample data may be other sample data in the preset database except the positive sample data.
In specific implementation, after receiving the identifier of the seed user sent by the marketer 110, matching the identifier of the seed user with a plurality of sample data stored in a preset database, and taking P successfully matched sample data as P positive sample data; accordingly, Q sample data other than P sample data may be taken as Q negative sample data. For example, the identifier of the seed user includes an identifier of a terminal device used by the user a, the identifier of the terminal device used by the user a is matched with a plurality of sample data stored in a preset database (each sample data includes the identifier of the terminal device used by the user corresponding to the sample data), the sample data successfully matched is the data of the user a, and the data of the user a can be used as a positive sample data.
It should be noted that the Q negative sample data may be all sample data in the preset database except the P positive sample data, or may also be partial sample data in the preset database except the P positive sample data. For example, the preset database includes 1000 sample data, where P is 200, the Q negative sample data may be 800 sample data of the 1000 sample data except 200 positive sample data, or may also be 600 sample data of the 800 sample data of the 1000 sample data except 200 positive sample data, which is not limited specifically.
In step 202, for each negative sample data in the Q negative sample data, it is determined whether the negative sample data is untrusted negative sample data, which may be data of a user who may be interested in the target object, according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q negative sample data.
In the embodiment of the invention, after P positive sample data and Q negative sample data are determined, one or more credible negative sample data can be determined from the Q negative sample data, and model training is carried out by using the P positive sample data and the one or more credible negative sample data. In one possible implementation mode, a continuous bayesian algorithm can be adopted to calculate each negative sample data in the Q negative sample data, determine the non-trusted negative sample data included in the Q negative sample data, and further determine that the negative sample data except the non-trusted negative sample data in the Q negative sample data is the trusted negative sample data.
In specific implementation, each sample data in the M sample data may include values of N features, and the features may refer to attributes having symbolic significance, such as gender, age, blood type, and the like. The characteristics can be classified into a classification characteristic or a continuous characteristic, the classification characteristic means that the value of the characteristic is classified, for example, the value of the gender characteristic can be 0 or 1, wherein "0" is used for representing males, "1" is used for representing females, or "0" is used for representing females, and "1" is used for representing males; the continuous characteristic means that the characteristic is continuous, for example, the body temperature characteristic can be any one of 36 ℃ to 38 ℃, for example, 36.55 ℃, 36.73 ℃ and the like.
In one example, each of the M sample data may further include a tag for the sample data for indicating that the sample data is positive or negative. Table 1 shows a possible sample data, where as shown in table 1, each sample data may include values of 5 features and a label of the sample data, where the 5 features are a sex feature, an age feature, a blood sample feature, and a weight feature, respectively, the sex feature, the age feature, and the blood feature may be classified features, and the blood sample feature and the weight feature may be continuous features.
Table 1: multiple sample data schematic
User' s Label (R) Sex Age (age) Blood type Blood sample Body weight
First of all Negative sample 1 35 1 89.75 57.42
Second step Positive sample 0 30 0 76.82 70.32
C3 Negative sample 1 25 3 87.53 49.58
T-shirt Negative sample 1 40 2 82.29 52.66
As shown in table 1, the labels of sample a, sample c and sample d are all negative samples, the genders are all females, the label of sample b is a positive sample, and the genders are males; the blood type of the sample A is A type, the blood type of the sample B is O type, the blood type of the sample C is AB type, and the blood type of the sample D is B type.
In the embodiment of the present invention, for each feature in the N features, a first probability density function corresponding to the feature may be determined according to P positive sample data, and a second probability density function corresponding to the feature may be determined according to Q negative sample data. Specifically, an initial average value and an initial variance corresponding to the feature may be calculated according to a value of the feature included in the P pieces of positive sample data, the initial average value and the initial variance are adjusted according to a preset deviation value to obtain a target average value and a target variance, and then a first probability density function corresponding to the feature is determined according to the target average value and the target variance. The preset offset value may be obtained by biased sampling, for example, the preset offset value may be obtained by analyzing W sample data and determining a compensation value corresponding to the W sample data through a preset algorithm, where the compensation value may be the preset offset value. Preferably, the initial average determined by the preset algorithm may correspond to a preset deviation value of 0.07, and the initial variance may correspond to a preset deviation value of 0.5.
In a possible implementation manner, the initial average value and the initial variance may be added to or subtracted from a preset deviation value to obtain a target average value and a target variance, and the target average value and the target variance are substituted into a normal distribution function to obtain a first probability density corresponding to the feature. Accordingly, the determination method of the second probability density function can be implemented by referring to the determination method of the first probability density function, and is not described herein again.
Further, after a first probability density function and a second probability density corresponding to the N features respectively are determined, a first numerical value may be obtained according to values of the N features included in each negative sample data and the first probability density function corresponding to the N features respectively; and a second numerical value can be obtained according to the values of the N characteristics included in each negative sample data and the second probability density functions respectively corresponding to the N characteristics. Taking the negative sample characteristic X as an example, in one example, for each of the N characteristics (for example, the blood sample characteristic), a value of the blood sample characteristic included in the negative sample characteristic X may be taken into a first probability density function corresponding to the blood sample characteristic, so as to obtain a first value corresponding to the blood sample characteristic; after the first values corresponding to the N features are obtained through calculation, the first values corresponding to the N features may be multiplied to obtain the first values. Accordingly, the method for determining the second value may be implemented by referring to the method for determining the first value, and will not be described herein again.
In this embodiment of the present invention, a difference between the first numerical value and the first preset numerical value of the P positive sample data may be a first difference value, a difference between the second numerical value and the second preset numerical value of the Q negative sample data may be a second difference value, and if the first difference value is smaller than the second difference value, the negative sample data may be determined to be the unreliable negative sample data. The first preset value of the P positive sample data or the second preset value of the Q negative sample data may be set by a person skilled in the art according to experience, or may also be determined by experiments, or may also be determined by the positive sample data or the negative sample data. In one example, the first preset value may be determined by an average value corresponding to N features included in the P pieces of positive sample data, and a first probability density function corresponding to N features, respectively, and the second preset value may be determined by a second probability density function corresponding to an average value corresponding to N features included in the Q pieces of negative sample data, respectively, and N features, respectively.
In one possible implementation manner, the number of the unreliable negative sample data determined from the Q negative sample data is X, and if X is less than or equal to a second threshold, the Q-X negative sample data is determined to be the reliable negative sample data; if X is greater than the second threshold, for each negative sample data in the Q-X negative sample data, it may be determined whether the negative sample data is an untrusted negative sample data according to the difference values between the negative sample data and the P positive sample data and the difference values between the negative sample data and the Q-X negative sample data. In a specific implementation, the process of determining whether each negative sample data in the Q-X negative sample data is untrusted negative sample data is similar to the process of determining whether each negative sample data in the Q negative sample data is untrusted negative sample data, which may be implemented by referring to the above steps, and details are not repeated here. The second threshold may be set empirically by a person skilled in the art, or may be determined experimentally, and is not limited in particular.
For example, taking the second threshold equal to 5 as an example, the M sample data includes 1000 sample data, where the number of positive sample data is 200 and the number of negative sample data is 800, the process of determining the number of the trusted negative sample data included in the 800 negative sample data may be implemented with reference to steps a to e.
Step a, calculating any one of 800 negative sample data, and determining that 200 untrustworthy negative sample data exist in the 800 negative sample data;
step b, because the quantity (200) of the untrustworthy negative sample data obtained by screening is larger than a second threshold value (5), the quantity of untrustworthy negative sample data in 600 negative sample data except 200 untrustworthy negative sample data in 800 negative sample data can be determined again, and 50 untrustworthy negative sample data in 600 negative sample data are determined by calculating any negative sample data in 600 negative sample data;
step c, because the quantity (50) of the untrustworthy negative sample data obtained by the screening is larger than a second threshold value (5), the quantity of untrustworthy negative sample data in 550 negative sample data except for 50 untrustworthy negative samples in 600 negative sample data can be determined again, and 4 untrustworthy negative sample data in 550 negative sample data are determined by calculating any negative sample data in the 550 negative sample data;
step d, since the number (4) of the untrustworthy negative sample data obtained by the screening is smaller than the second threshold (5), 546 negative sample data of 550 negative sample data except the 4 untrustworthy negative sample data can be determined to be the trustable negative sample data.
As can be seen, in this implementation, if the number of the determined untrusted negative sample data is greater than the second threshold, the number of the untrusted negative sample data in the other negative sample data may be calculated based on the other negative sample data than the determined untrusted negative sample data until the number of the determined untrusted negative sample data is less than the second threshold.
In another possible implementation manner, if the execution times of screening the untrusted negative samples from the Q negative sample data (i.e., the execution times in step 202) are not less than the third threshold, the number of the untrusted negative sample data determined from the Q negative sample data is Y, and then it may be determined that Q-Y negative sample data are the trusted negative sample data. That is, if the number of times of screening the untrusted negative samples from the Q negative sample data is set to 20 times, the step 202 may be stopped from being repeatedly executed regardless of whether the number of the untrusted negative samples obtained by the 20 th screening is greater than the second threshold. The third threshold may be set empirically by a person skilled in the art, or may be determined experimentally, and is not limited specifically.
And 203, performing model training by using the credible negative sample data except the incredible negative sample data in the P positive sample data and the Q negative sample data to obtain a binary model.
It should be noted that the step number is only one example of an execution flow, and does not limit the execution order of each step.
The above steps 201 to 203 describe the implementation of the training phase specifically, and the following description is directed to the implementation of using the two-class model to determine whether the user is the target user (i.e., the prediction phase).
Specifically, for each negative sample data in a preset database, a binary classification model can be used for predicting the negative sample data to obtain a prediction score corresponding to the negative sample data; further, the target user may be determined according to the predicted scores of the Q negative sample data.
In a possible implementation manner, the first W negative sample data with the largest prediction score may be selected from the Q negative sample data, a user corresponding to the first W negative sample data is determined to be a target user, and a target object is recommended to the user corresponding to the first W negative sample data. In another possible implementation manner, a fourth threshold may be preset, a user corresponding to the negative sample data with the prediction score larger than the fourth threshold among the Q negative sample data is determined as the target user, and the target object is recommended to the target user.
In the above embodiment of the present invention, for each negative sample data in Q negative sample data, it may be determined whether the negative sample data is an untrusted negative sample data according to a difference value between the negative sample data and P positive sample data and a difference value between the negative sample data and Q negative sample data, and then model training may be performed using the trusted negative sample data in the P positive sample data and the Q negative sample data except the untrusted negative sample data to obtain a binary model. In the embodiment of the invention, the credible negative sample data used for training the model is obtained by determining the incredible negative sample data in the Q negative sample data, and compared with the negative sample data obtained based on random screening or manual screening in the prior art, the credible negative sample data in the embodiment of the invention is more accurate, so that the binary classification model obtained based on the training of the credible negative sample data is more reasonable, and the prediction result is more in line with the actual situation.
For the above method flow, an embodiment of the present invention further provides a model training apparatus, and the specific content of the apparatus may be implemented with reference to the above method.
Fig. 3 is a schematic structural diagram of a model training apparatus according to an embodiment of the present invention, where the apparatus includes:
an obtaining module 301, configured to obtain M sample data, where the M sample data includes P positive sample data and Q negative sample data, the positive sample data is data of a user known to be interested in a target object, and the Q negative sample data is data of a user unknown to whether the user is interested in the target object;
a determining module 302, configured to determine, for each negative sample data of Q negative sample data, whether the negative sample data is untrusted negative sample data according to a difference value between the negative sample data and the P positive sample data and a difference value between the negative sample data and the Q negative sample data, where the untrusted negative sample data is data of a user who may be interested in the target object;
a training module 303, configured to perform model training using the P positive sample data and the trusted negative sample data, excluding the untrusted negative sample data, in the Q negative sample data, to obtain a binary model; wherein M, P, Q are integers.
Optionally, the apparatus further comprises a processing module 304, wherein the processing module 304 is configured to:
for each piece of negative sample data, predicting the negative sample data by using the two classification models to obtain a prediction score corresponding to the negative sample data;
and selecting the first W negative sample data with the maximum prediction score from the Q negative sample data, and recommending the target object to the user corresponding to the W negative sample data.
Optionally, each sample data in the M sample data includes values of N features; the determining module 302 is specifically configured to:
for each feature of the N features, determining a first probability density function corresponding to the feature from the P positive sample data, and determining a second probability density function corresponding to the feature from the Q negative sample data;
obtaining a first numerical value according to the values of the N characteristics included in each negative sample data and the first probability density functions respectively corresponding to the N characteristics; obtaining a second numerical value according to the values of the N characteristics included in each negative sample data and second probability density functions respectively corresponding to the N characteristics;
determining a first difference value according to the first numerical value and a first preset numerical value of the P pieces of positive sample data, and determining a second difference value according to the second numerical value and a second preset numerical value of the Q pieces of negative sample data;
and if the first difference value is smaller than the second difference value, determining that the negative sample data is untrustworthy.
Optionally, the determining module 302 is further configured to:
determining the number of the untrusted negative sample data from the Q negative sample data to be X, and if the X is less than or equal to a second threshold, determining the Q-X negative sample data to be the trusted negative sample data; if the X is larger than a second threshold, aiming at each negative sample data in Q-X negative sample data, determining whether the negative sample data is the untrustworthy negative sample data according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q-X negative sample data.
Optionally, the determining module 302 is further configured to:
calculating to obtain an initial average value and an initial variance corresponding to the characteristics according to the P pieces of positive sample data, and adjusting the initial average value and the initial variance according to a preset deviation value to obtain a target average value and a target variance;
and determining a first probability density function corresponding to the features according to the target average value and the target variance.
From the above, it can be seen that: in the above embodiment of the present invention, for each negative sample data in Q negative sample data, it may be determined whether the negative sample data is an untrusted negative sample data according to a difference value between the negative sample data and P positive sample data and a difference value between the negative sample data and Q negative sample data, and then model training may be performed using the trusted negative sample data in the P positive sample data and the Q negative sample data except the untrusted negative sample data to obtain a binary model. In the embodiment of the invention, the credible negative sample data used for training the model is obtained by determining the incredible negative sample data in the Q negative sample data, and compared with the negative sample data obtained based on random screening or manual screening in the prior art, the credible negative sample data in the embodiment of the invention is more accurate, so that the binary classification model obtained based on the training of the credible negative sample data is more reasonable, and the prediction result is more in line with the actual situation.
It should be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-QOM, optical storage, etc.) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method of model training, the method comprising:
acquiring M sample data, wherein the M sample data comprise P positive sample data and Q negative sample data, the positive sample data are data of a user known to be interested in a target object, and the Q negative sample data are data of a user unknown to be interested in the target object;
for each negative sample data in Q negative sample data, determining whether the negative sample data is untrustworthy negative sample data according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q negative sample data, wherein the untrustworthy negative sample data is data of a user who may be interested in the target object;
performing model training by using the P positive sample data and the credible negative sample data except the incredible negative sample data in the Q negative sample data to obtain a two-classification model; wherein M, P, Q are integers.
2. The method of claim 1, further comprising:
for each piece of negative sample data, predicting the negative sample data by using the two classification models to obtain a prediction score corresponding to the negative sample data;
and selecting the first W negative sample data with the maximum prediction score from the Q negative sample data, and recommending the target object to the user corresponding to the W negative sample data.
3. The method according to any one of claims 1 to 2, wherein each of the M sample data comprises values of N features;
for each negative sample data in the Q negative sample data, determining whether the negative sample data is untrusted negative sample data according to the difference values between the negative sample data and the P positive sample data and the difference values between the negative sample data and the Q negative sample data, including:
for each feature of the N features, determining a first probability density function corresponding to the feature from the P positive sample data, and determining a second probability density function corresponding to the feature from the Q negative sample data;
obtaining a first numerical value according to the values of the N characteristics included in each negative sample data and the first probability density functions respectively corresponding to the N characteristics; obtaining a second numerical value according to the values of the N characteristics included in each negative sample data and second probability density functions respectively corresponding to the N characteristics;
determining a first difference value according to the first numerical value and a first preset numerical value of the P pieces of positive sample data, and determining a second difference value according to the second numerical value and a second preset numerical value of the Q pieces of negative sample data;
and if the first difference value is smaller than the second difference value, determining that the negative sample data is untrustworthy.
4. The method of claim 3, further comprising:
determining the number of the untrusted negative sample data from the Q negative sample data to be X, and if the X is less than or equal to a second threshold, determining the Q-X negative sample data to be the trusted negative sample data; if the X is larger than a second threshold, aiming at each negative sample data in Q-X negative sample data, determining whether the negative sample data is the untrustworthy negative sample data according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q-X negative sample data.
5. The method of claim 3, wherein determining, for each of the N features, a first probability density function for the feature from the P positive sample data comprises:
calculating to obtain an initial average value and an initial variance corresponding to the characteristics according to the P pieces of positive sample data, and adjusting the initial average value and the initial variance according to a preset deviation value to obtain a target average value and a target variance;
and determining a first probability density function corresponding to the features according to the target average value and the target variance.
6. A model training apparatus, the apparatus comprising:
the acquisition module is used for acquiring M sample data, wherein the M sample data comprises P positive sample data and Q negative sample data, the positive sample data is data of a user known to be interested in a target object, and the Q negative sample data is data of a user unknown to be interested in the target object;
a determining module, configured to determine, for each negative sample data of Q negative sample data, whether the negative sample data is untrusted negative sample data according to a difference value between the negative sample data and the P positive sample data and a difference value between the negative sample data and the Q negative sample data, where the untrusted negative sample data is data of a user who may be interested in the target object;
the training module is used for performing model training by using the P positive sample data and the credible negative sample data except the credible negative sample data in the Q negative sample data to obtain a binary model; wherein M, P, Q are integers.
7. The apparatus of claim 6, further comprising a processing module to:
for each piece of negative sample data, predicting the negative sample data by using the two classification models to obtain a prediction score corresponding to the negative sample data;
and selecting the first W negative sample data with the maximum prediction score from the Q negative sample data, and recommending the target object to the user corresponding to the W negative sample data.
8. The apparatus according to any one of claims 6 to 7, wherein each sample data of the M sample data comprises values of N features; the determining module is specifically configured to:
for each feature of the N features, determining a first probability density function corresponding to the feature from the P positive sample data, and determining a second probability density function corresponding to the feature from the Q negative sample data;
obtaining a first numerical value according to the values of the N characteristics included in each negative sample data and the first probability density functions respectively corresponding to the N characteristics; obtaining a second numerical value according to the values of the N characteristics included in each negative sample data and second probability density functions respectively corresponding to the N characteristics;
determining a first difference value according to the first numerical value and a first preset numerical value of the P pieces of positive sample data, and determining a second difference value according to the second numerical value and a second preset numerical value of the Q pieces of negative sample data;
and if the first difference value is smaller than the second difference value, determining that the negative sample data is untrustworthy.
9. The apparatus of claim 8, wherein the determining module is further configured to:
determining the number of the untrusted negative sample data from the Q negative sample data to be X, and if the X is less than or equal to a second threshold, determining the Q-X negative sample data to be the trusted negative sample data; if the X is larger than a second threshold, aiming at each negative sample data in Q-X negative sample data, determining whether the negative sample data is the untrustworthy negative sample data according to the difference value between the negative sample data and the P positive sample data and the difference value between the negative sample data and the Q-X negative sample data.
10. The apparatus of claim 8, wherein the determining module is further configured to:
calculating to obtain an initial average value and an initial variance corresponding to the characteristics according to the P pieces of positive sample data, and adjusting the initial average value and the initial variance according to a preset deviation value to obtain a target average value and a target variance;
and determining a first probability density function corresponding to the features according to the target average value and the target variance.
CN201811544547.2A 2018-12-17 2018-12-17 Model training method and device Active CN111325228B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811544547.2A CN111325228B (en) 2018-12-17 2018-12-17 Model training method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811544547.2A CN111325228B (en) 2018-12-17 2018-12-17 Model training method and device

Publications (2)

Publication Number Publication Date
CN111325228A true CN111325228A (en) 2020-06-23
CN111325228B CN111325228B (en) 2021-04-06

Family

ID=71172437

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811544547.2A Active CN111325228B (en) 2018-12-17 2018-12-17 Model training method and device

Country Status (1)

Country Link
CN (1) CN111325228B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114331696A (en) * 2021-12-31 2022-04-12 北京瑞莱智慧科技有限公司 Risk assessment method, device and storage medium
WO2022252051A1 (en) * 2021-05-31 2022-12-08 京东方科技集团股份有限公司 Data processing method and apparatus, and device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170124719A1 (en) * 2015-10-30 2017-05-04 Xiaomi Inc. Method, device and computer-readable medium for region recognition
CN107273454A (en) * 2017-05-31 2017-10-20 北京京东尚科信息技术有限公司 User data sorting technique, device, server and computer-readable recording medium
CN107609461A (en) * 2017-07-19 2018-01-19 阿里巴巴集团控股有限公司 The training method of model, the determination method, apparatus of data similarity and equipment
CN107665349A (en) * 2016-07-29 2018-02-06 腾讯科技(深圳)有限公司 The training method and device of multiple targets in a kind of disaggregated model

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170124719A1 (en) * 2015-10-30 2017-05-04 Xiaomi Inc. Method, device and computer-readable medium for region recognition
CN107665349A (en) * 2016-07-29 2018-02-06 腾讯科技(深圳)有限公司 The training method and device of multiple targets in a kind of disaggregated model
CN107273454A (en) * 2017-05-31 2017-10-20 北京京东尚科信息技术有限公司 User data sorting technique, device, server and computer-readable recording medium
CN107609461A (en) * 2017-07-19 2018-01-19 阿里巴巴集团控股有限公司 The training method of model, the determination method, apparatus of data similarity and equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
YOSHUA BENGIO ET AL: "Adaptive Importance Sampling to Accelerate Training of a Neural Probabilistic Language Model", 《IEEE TRANSACTIONS ON NEURAL NETWORKS》 *
张文泽: "基于在线学习的展示广告系统研究与设计", 《中国优秀硕士学位论文全文数据库(电子期刊)经济与管理科学辑》 *
艾拓等: "基于难负样本挖掘的改进Faster RCNN训练方法", 《计算机科学》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022252051A1 (en) * 2021-05-31 2022-12-08 京东方科技集团股份有限公司 Data processing method and apparatus, and device and storage medium
CN114331696A (en) * 2021-12-31 2022-04-12 北京瑞莱智慧科技有限公司 Risk assessment method, device and storage medium

Also Published As

Publication number Publication date
CN111325228B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN105550903B (en) Target user determination method and device
CN107491432B (en) Low-quality article identification method and device based on artificial intelligence, equipment and medium
CN105678587B (en) Recommendation feature determination method, information recommendation method and device
US20160285672A1 (en) Method and system for processing network media information
US20160379268A1 (en) User behavior data analysis method and device
WO2016169193A1 (en) Method and apparatus for detecting cheated clicks
CN106874314B (en) Information recommendation method and device
WO2018149337A1 (en) Information distribution method, device, and server
US20110196739A1 (en) Systems and methods for efficiently ranking advertisements based on relevancy and click feedback
CN107967280B (en) Method and system for recommending songs by tag
CN105590240A (en) Discrete calculating method of brand advertisement effect optimization
CN111160624B (en) User intention prediction method, user intention prediction device and terminal equipment
EP3352121A1 (en) Content delivery method and device
CN111325228B (en) Model training method and device
WO2023000491A1 (en) Application recommendation method, apparatus and device, and computer-readable storage medium
CN111061979A (en) User label pushing method and device, electronic equipment and medium
CN111444930B (en) Method and device for determining prediction effect of two-classification model
CN107633257B (en) Data quality evaluation method and device, computer readable storage medium and terminal
WO2018161677A1 (en) Message pushing method, apparatus, and storage medium
CN113256335B (en) Data screening method, multimedia data delivery effect prediction method and device
CN108647986B (en) Target user determination method and device and electronic equipment
CN109961308B (en) Method and apparatus for evaluating tag data
CN110502639B (en) Information recommendation method and device based on problem contribution degree and computer equipment
CN110874639A (en) Method and device for acquiring operation information
US20130297406A1 (en) Matching criteria selection to scale online experiments

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant