Detailed Description
In order to better understand the technical solutions, the technical solutions of the embodiments of the present specification are described in detail below with reference to the drawings and specific embodiments, and it should be understood that the specific features of the embodiments and embodiments of the present specification are detailed descriptions of the technical solutions of the embodiments of the present specification, and are not limitations of the technical solutions of the present specification, and the technical features of the embodiments and embodiments of the present specification may be combined with each other without conflict.
Please refer to fig. 1, which is a schematic diagram of an application scenario of model score correction according to an embodiment of the present disclosure. The terminal 100 is located on the user side and communicates with the server 200 on the network side. The user may generate transactions through the APP or website in the terminal 100. The server 200 collects transactions generated by the respective terminals and implements the model score correction method according to this. The embodiment can be applied to a risk assessment scene, such as: and a reverse-cash interception scene, a risk transaction identification scene and the like.
In a first aspect, an embodiment of the present disclosure provides a method for correcting a model score, please refer to fig. 2, which includes steps S201 to S204.
S201: extracting samples to be detected according to a preset strategy, and obtaining the score value of each sample to be detected based on a preset wind control model;
s202: establishing a score mapping table based on the score of each sample to be detected, wherein the score mapping table comprises a plurality of score ranges, each score range corresponds to a black concentration, and the black concentration corresponding to each score range is the proportion of the black samples which are actually marked as the black samples in the samples to be detected and the scores of which belong to the score range;
s203: judging whether the current wind control scoring threshold value meets a preset condition or not based on a scoring mapping table;
s204: and if not, correcting the current wind control scoring threshold value based on the scoring mapping table.
Specifically, in this embodiment, first, in step S201, a sample to be detected is obtained by sampling according to a preset strategy. Specifically, the sampling of the sample to be detected can be performed by, but not limited to, the following two methods:
the first method comprises the following steps: the real-time sampling mode comprises the following steps: determining a real-time transaction sample entering a preset wind control model at the current moment; extracting a sample to be detected from the real-time transaction sample according to a first preset proportion; or extracting a first preset number of samples to be detected from the real-time transaction samples.
Specifically, in this embodiment, a sample is taken of a real-time transaction sample entering a preset wind control model. The samples to be detected can be extracted in proportion, and firstly, the real-time transaction samples entering the preset wind control model at the current moment are determined, such as: and under the condition that the current queued transactions entering the preset wind control model reach a preset number, determining the real-time transaction samples of the preset number as sampling objects, namely the real-time transaction samples entering the preset wind control model at the current moment. And then, extracting a sample to be detected with a first preset ratio from the real-time transaction samples according to a preset mode. In the specific implementation process, the first preset proportion can be set according to actual needs, such as: the first predetermined percentage is 5%, 10%, etc., and the application is not limited thereto. Further, the first preset occupation ratio can be set according to the transaction amount processed by the system, if the transaction amount is larger, the first preset occupation ratio can be set to be smaller, and if the transaction amount is smaller, the first preset occupation ratio can be set to be larger, so that the first preset occupation ratio can be dynamically adjusted according to the current real-time transaction amount to better adapt to a real transaction scene.
Furthermore, can also carry out the sampling according to fixed numerical value, prescribe the first preset quantity that draws every time in advance promptly, draw the sample that awaits measuring of first preset quantity from real-time transaction sample according to the preset mode, in concrete implementation, first preset quantity can be set for according to actual need, for example: the first predetermined amount is set to a value of 100, 200, etc., and the application is not limited thereto.
In this embodiment, the preset manner may be a random extraction manner, a sequential extraction manner, or the like. In the specific implementation process, the setting can be performed according to the actual needs, and the application is not limited herein.
Further, for the real-time transaction sample, the real-time transaction sample with the last mantissa of the user ID being N may also be used as the sample to be detected. In the specific implementation process, the mode of extracting the sample to be detected from the real-time transaction sample can be set according to actual needs, and the application is not limited herein.
And further, after the sample to be detected is determined, the corresponding score value based on the preset wind control model can be obtained. Specifically, the scoring of the sample to be detected may be performed before the sample to be detected is extracted, that is: all real-time transaction samples are graded based on a preset wind control model, then sampling is carried out, and samples to be detected are extracted, so that the grade value of each sample to be detected based on the preset wind control model can be obtained. Alternatively, scoring the sample to be tested may be performed after the sample to be tested is extracted, i.e.: the method comprises the steps of firstly extracting samples to be detected from real-time transaction samples, and then grading the samples to be detected based on a preset wind control model, so that the grading value of each sample to be detected based on the preset wind control model can be obtained. In a specific implementation process, the order of scoring and sampling may be set according to actual needs, and the application is not limited herein.
Scoring the non-sampled real-time transaction sample according to a preset wind control model, and then making a risk decision according to a wind control scoring threshold before being uncorrected, wherein the risk decision comprises the following steps: and if the score value of the real-time transaction sample is greater than the current wind control score threshold value, the real-time transaction is determined as a risk transaction, the transaction is intercepted, or a user corresponding to the transaction is locked, and the like.
And the second method comprises the following steps: the periodic sampling mode comprises the following steps: judging whether the time interval between the current moment and the last moment of sampling the sample to be detected reaches a preset time interval or not; if yes, extracting samples to be detected from the transaction samples corresponding to the current time according to a second preset proportion or extracting a second preset number of samples to be detected from the transaction samples corresponding to the current time period.
Specifically, in this embodiment, the sample to be tested is extracted at a predetermined time interval T (i.e., a period T). Firstly, judging whether the time interval between the current time and the last time of extracting the sample to be detected reaches a preset time interval T, and if the preset time interval T is determined to be reached, obtaining the transaction sample to be processed corresponding to the current time. In the specific implementation process, the preset time interval may be set according to actual needs, for example: the preset time interval is set to 12 hours, 24 hours, etc., and when set to 24 hours, it indicates that the wind control score threshold is corrected every other day. The application is not limited thereto.
And further, extracting the samples to be detected from the transaction samples to be processed corresponding to the current moment according to a second preset proportion. The second preset proportion can be set according to actual needs, for example: the second predetermined percentage is 5%, 10%, etc. and the application is not limited thereto. Further, the second preset occupation ratio can be set according to the transaction amount processed by the system, if the transaction amount is larger, the second preset occupation ratio can be set to be smaller, and if the transaction amount is smaller, the second preset occupation ratio can be set to be larger, so that the second preset occupation ratio can be dynamically adjusted according to the transaction amount of the system to better adapt to a real transaction scene.
Furthermore, can also carry out the sampling according to fixed numerical value, and the second that extracts every time is predetermine promptly and is predetermine the second and predetermine quantity, extracts the sample that awaits measuring of second predetermine quantity in the corresponding transaction sample of treating of current moment according to the preset mode, and in concrete implementation, the second predetermines quantity and can set for according to actual need, for example: the second predetermined amount is set to a value of 100, 200, etc., and the application is not limited thereto.
In this embodiment, the preset manner may be a random extraction manner, a sequential extraction manner, or the like. In the specific implementation process, the setting can be performed according to the actual needs, and the application is not limited herein.
Further, for the to-be-processed transaction sample corresponding to the current time, the transaction sample with the last mantissa of the user ID being N may also be used as the to-be-detected sample. In a specific implementation process, the manner of extracting the to-be-detected sample from the to-be-processed transaction sample corresponding to the current moment can be set according to actual needs, and the application is not limited herein.
And further, after the sample to be detected is determined, the corresponding score value based on the preset wind control model can be obtained. Specifically, the scoring of the sample to be detected may be performed before the sample to be detected is extracted, that is: all to-be-processed transaction samples corresponding to the current moment are scored based on a preset wind control model, then sampling is carried out, and the to-be-detected samples are extracted, so that the scoring value of each to-be-detected sample based on the preset wind control model can be obtained. Alternatively, scoring the sample to be tested may be performed after the sample to be tested is extracted, i.e.: the method comprises the steps of firstly extracting samples to be detected from transaction samples to be processed corresponding to the current moment, and then grading the samples to be detected based on a preset wind control model, so that the grading value of each sample to be detected based on the preset wind control model can be obtained. In a specific implementation process, the order of scoring and sampling may be set according to actual needs, and the application is not limited herein.
Scoring the non-sampled transaction samples in the to-be-processed transaction samples corresponding to the current moment according to a preset wind control model, and then making risk decision according to a wind control scoring threshold before non-correction, such as: and if the score value of the transaction sample is larger than the current wind control score threshold value, the real-time transaction is determined to be a risk transaction, the transaction is intercepted, or a user corresponding to the transaction is locked, and the like.
The two sampling modes are carried out on the basis of a shunting mechanism, and the dynamic adjustment of the mapping relation between the risk score of the model and the black concentration of the sample is realized through a shunting evaluation mechanism, so that the adaptive relation between the risk score and the black concentration is ensured.
The two sampling modes represent two correction modes respectively, wherein the first real-time sampling mode corresponds to a real-time correction scheme, and the second periodic sampling mode corresponds to a periodic correction scheme. In a specific implementation process, the selection may be performed according to an actual scene, and the application is not limited herein. In particular, the real-time correction scheme may be applied during a predetermined activity. Such as: the e-commerce platform needs to carry out activities in a preset time period, so that the transaction quantity of the users is increased, if the wind control scoring threshold value is not updated timely, the users can be judged as abnormal users by the original wind control strategy, and the normal transactions of the users are intercepted. Therefore, a real-time correction scheme is required for such a scenario, that is: whether the current time belongs to a preset time range is judged, the preset time range can be an activity time range set by a system, and can also be other time ranges, and the method is not limited in the application. And if the current moment belongs to the preset time range, indicating that the wind control scoring threshold value needs to be corrected according to a real-time correction scheme. And determining a real-time transaction sample entering a preset wind control model at the current moment, and extracting the sample to be detected according to the first real-time sampling mode. Because the real-time correction mode needs to occupy more computing power and processing power, the wind control scoring threshold can be corrected according to a periodic correction scheme at other moments except for a preset time range.
Further, in this embodiment, the preset wind control model may be selected according to actual needs, for example: models such as random forest, logistic regression, gradient boosting decision tree, etc., and the application is not limited herein. The wind control scoring threshold value is an important reference value in a wind control scene for wind control decision making. For each transaction, if the score value based on the preset wind control model is greater than the wind control score threshold value, the system will regard the transaction as a risk transaction, and perform corresponding risk decision, such as: intercepting the transaction, locking a user corresponding to the transaction, and the like. Certainly, according to different scoring strategies of the preset wind control model, the situation that the smaller the score value is, the higher the risk degree is may occur, so when the score value of the transaction is smaller than the wind control score threshold, the system will regard the transaction as a risk transaction and perform a corresponding risk decision.
Further, after the score value of each sample to be detected is obtained in step S201, a score mapping table is established based on the score value of each sample to be detected in step S202. Firstly, dividing a plurality of score ranges, and determining black concentration corresponding to each score range. Such as: the score value range can be divided into 0.5-0.6, 0.6-0.7, 0.7-0.8, 0.8-0.9 and 0.9-1. Further, it is assumed that there are 100 samples to be detected having score values within the score range of 0.9 to 1. Among the 100 samples to be detected, 90 black samples exist, and the black concentration is calculated to be 90/100. The black concentration corresponding to the score range of 0.9-1 is 0.9. The grading mapping table can be established in such a way, and the black concentration corresponding to other grading ranges can be calculated in the same way. The attribute of each sample to be detected is marked by a related user after the sample to be detected is successfully processed, and the black sample is also marked by a set black sample attribute, such as: the merchant knows that transaction a is a cash-out transaction and marks its attribute as black, and the system will mark transaction a as a black sample after receiving the feedback from the merchant. In a specific implementation process, the division of the score range in the score mapping table may be set according to actual needs, may be divided according to an interval of 0.1 in the foregoing example, and may also be divided according to an interval of 0.05, where this application is not limited.
Further, in step S203, the current black density corresponding to the current wind control score threshold is obtained by searching from the score mapping table. Specifically, a score range to which the current wind control score threshold belongs is determined, and then black concentration corresponding to the score range to which the current wind control score threshold belongs is determined from the score mapping table. Such as: the current wind control scoring threshold value is 0.85, which belongs to the score range of 0.8-0.9, and in the scoring mapping table, the black concentration corresponding to the score range of 0.8-0.9 is 0.7, which indicates that the current black concentration corresponding to the current wind control scoring threshold value of 0.85 is 0.7. And then, judging whether the current black concentration meets the preset condition. Specifically, the method can be realized by the following steps:
and judging whether the absolute value of the difference value between the current black concentration and the target black concentration is smaller than a preset numerical value, if not, indicating that the current black concentration does not meet the preset condition. Or judging whether the current black concentration belongs to the target black concentration range, and if not, indicating that the current black concentration does not meet the preset condition.
Specifically, in this embodiment, a preset target black density can be obtained, such as: in the transaction to be intercepted by the system, more than 90% of the groups which are all black transactions need to be intercepted, and the target black concentration is determined to be 90%. In a specific implementation process, the target black concentration may be set according to actual needs, and the application is not limited herein. And if the absolute value of the difference value between the current black concentration and the target black concentration is smaller than a preset value, the current wind control scoring threshold value is not satisfied with a preset condition, and the current wind control scoring threshold value needs to be corrected. Such as: the current wind control scoring threshold value is 0.8, the corresponding black concentration is determined to be 0.6 after the scoring mapping table is inquired, the absolute value of the difference value between the current wind control scoring threshold value and the target black concentration is 0.9 is 0.3, if the preset numerical value is set to be 0.1, the 0.3 is larger than 0.1, the current black concentration corresponding to the current wind control scoring threshold value is determined not to meet the preset condition, the current wind control scoring threshold value is unreasonable in setting, and the current wind control scoring threshold value needs to be corrected.
Similarly, in this embodiment, a preset target black density range can be obtained, such as: in the transaction to be intercepted by the system, more than 80% of groups which are all black transactions need to be intercepted, and the target black concentration is determined to be 80% -100%. In a specific implementation process, the target black concentration range may be set according to actual needs, and the application is not limited herein. And if the current black concentration does not belong to the target black concentration range, indicating that the current black concentration does not meet the preset condition, and correcting the current wind control scoring threshold value. Such as: the current wind control scoring threshold value is 0.8, the corresponding black concentration is determined to be 0.6 after the scoring mapping table is inquired and does not belong to the target black concentration range of 80% -100%, and the current black concentration corresponding to the current wind control scoring threshold value is determined not to meet the preset condition, so that the current wind control scoring threshold value is unreasonable in setting and needs to be corrected.
Furthermore, when it is determined that the current wind control scoring threshold does not meet the preset condition, the current wind control scoring threshold needs to be corrected through step S204, and when the current wind control scoring threshold is corrected, a target scoring value meeting the preset condition is obtained by querying from the scoring mapping table, and the wind control scoring threshold is corrected based on the target scoring value. Specifically, the wind control score threshold may be corrected to a target score value.
For example, in a scenario of cash register, it is mainly determined whether the user is likely to be in cash register through transaction information, for example, there are two characteristics of a transaction: and (3) transaction amount and transaction time, wherein the transaction amount is that the risk exceeds 10000 yuan, the weight is added by 0.7 point, after the transaction time is 0 point, the risk weight is added by 0.2 point, and finally the risk score output by the wind control model is 0.9 point. The current wind control score threshold was set to 0.85 prior to correction, with a target black concentration of 0.8. At this threshold, the transaction is identified as a risk transaction. And if the user is in the large promotion activity period, a plurality of users can carry out transactions after 0 point, the black concentration corresponding to the value range to which the current wind control scoring threshold value of 0.85 belongs is changed into 0.6, the difference between the black concentration and the target black concentration is larger, and the risk decision is unreasonable by adopting the wind control scoring threshold value of 0.8. Therefore, the score value corresponding to the target black concentration is searched in the score mapping table, and if the score range corresponding to the target black concentration of 0.8 is 0.9-1, the wind control score threshold value can be corrected to be 0.95 which is the middle value of 0.9-1. Even if the transaction occurs after 0 o' clock, the risk score value is 0.9, and based on the corrected wind control score threshold value of 0.95, the transaction is not judged as a risk transaction. Thus, normal traffic can be effectively prevented from being intercepted. And if the target black concentration does not exist in the grading mapping table, selecting the black concentration closest to the target black concentration, determining the score range of the black concentration, and re-determining a target score value according to the score range to correct the current wind control grading threshold value.
Of course, after the target score value is determined based on the score mapping table, a wind control score threshold value is recalculated based on the target score value, and the target score value is a reference value when the target score value is recalculated. Such as: the wind control scoring threshold is K, the target scoring value is P1, and the reference value of other factors is P2, then the corrected wind control scoring threshold K = α P1+ β P2, and α and β are weighted values, which can be set according to actual needs in a specific implementation process, and the application is not limited herein.
In the method in the embodiment, the sample to be detected is extracted through a shunting evaluation mechanism, and the wind control scoring threshold value is corrected. The mapping relation between the risk score and the sample black concentration of the preset wind control model can change along with the time distribution change of the sample, so that the corresponding relation between the risk score and the sample black concentration of the preset wind control model is adapted in real time, the wind control score threshold value can be dynamically corrected according to the score mapping table, the wind control score threshold value which is adapted to the current scene is determined, and the stability of making a relevant risk decision according to the risk score and the wind control score threshold value is guaranteed.
In a second aspect, based on the same inventive concept, an embodiment of the present disclosure provides a model score calibration apparatus, please refer to fig. 3, including:
the acquiring unit 301 is configured to extract samples to be detected according to a preset strategy, and obtain a score value of each sample to be detected based on a preset wind control model;
the establishing unit 302 is configured to establish a score mapping table based on the score value of each sample to be detected, where the score mapping table includes multiple score ranges, each score range corresponds to a black concentration, and the black concentration corresponding to each score range is a proportion of the sample to be detected, in which the score value belongs to the score range, that is actually marked as a black sample;
a judging unit 303, configured to judge whether a current wind control scoring threshold meets a preset condition based on the scoring mapping table;
and the correcting unit 304 is configured to correct the current wind control scoring threshold if the judgment result of the judging unit is negative.
In an optional implementation manner, the obtaining unit 301 is specifically configured to:
determining a real-time transaction sample entering a preset wind control model at the current moment;
extracting a sample to be detected from the real-time transaction sample according to a first preset proportion; or
A first preset number of samples to be detected are extracted from the real-time transaction samples.
In an optional implementation manner, the obtaining unit 301 is specifically configured to:
and judging whether the current time belongs to a preset time range, and if so, determining that the current time enters a real-time transaction sample of a preset wind control model.
In an optional implementation manner, the obtaining unit 301 is specifically configured to:
judging whether the time interval between the current moment and the last moment of sampling the sample to be detected reaches a preset time interval or not;
if so, extracting a sample to be detected from the transaction sample corresponding to the current moment according to a second preset proportion; or
If yes, extracting a second preset number of samples to be detected from the transaction samples corresponding to the current time.
In an optional implementation manner, the determining unit 303 is specifically configured to:
determining the current black concentration corresponding to the current wind control scoring threshold value based on the scoring mapping table;
judging whether the absolute value of the difference value between the current black concentration and the target black concentration is smaller than a preset value or not, and if not, indicating that the current wind control scoring threshold value does not meet the preset condition; or
And judging whether the current black concentration belongs to a target black concentration range, if not, indicating that the current wind control scoring threshold value does not meet the preset condition.
In an alternative implementation, the correction unit 304 is specifically configured to:
determining a target score value meeting the preset condition from the score mapping table;
and correcting the wind control scoring threshold value to be the target scoring value.
In a third aspect, based on the same inventive concept as the model score correction method in the foregoing embodiment, the present invention further provides a server, as shown in fig. 4, including a memory 404, a processor 402, and a computer program stored in the memory 404 and operable on the processor 402, wherein the processor 402 executes the computer program to implement the steps of any one of the foregoing model score correction methods.
Where in fig. 4 a bus architecture (represented by bus 400) is shown, bus 400 may include any number of interconnected buses and bridges, and bus 400 links together various circuits including one or more processors, represented by processor 402, and memory, represented by memory 404. The bus 400 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 406 provides an interface between the bus 400 and the receiver 401 and transmitter 403. The receiver 401 and the transmitter 403 may be the same element, i.e., a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 402 is responsible for managing the bus 400 and general processing, and the memory 404 may be used for storing data used by the processor 402 in performing operations.
In a fourth aspect, based on the inventive concept of model score correction as in the previous embodiments, the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of any one of the above methods of model score correction.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. 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 specification 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 changes and modifications that fall within the scope of the specification.
It will be apparent to those skilled in the art that various changes and modifications can be made in the present specification without departing from the spirit and scope of the specification. Thus, if such modifications and variations of the present specification fall within the scope of the claims of the present specification and their equivalents, the specification is intended to include such modifications and variations.