Data processing method and related device

By evaluating and exchanging the mobile influence of sample data, the problem of inconsistent data distribution between the experimental group and the control group is solved, a balanced data distribution is achieved, and the accuracy and reliability of the experimental results are improved.

CN113988185BActive Publication Date: 2024-10-18PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111271282.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2024-10-18
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

Existing technology cannot effectively ensure that the sample data distribution of the experimental group and the control group is consistent, causing the accuracy and reliability of the experimental results to be affected. Especially in application scenarios such as auto insurance renewal strategies, inconsistent distribution of sample indicators will cause bias in the renewal rate. High, unable to prove the effectiveness of the strategy.

Method used

By obtaining the sample data of the experimental group and the control group, the difficulty score of each attribute data is evaluated, and the mobile influence of each sample is calculated based on the score, and the samples with the lowest mobile influence in each group are exchanged until the equilibrium conditions are met to ensure Consistency of data distribution.

Benefits of technology

By iteratively exchanging samples, the degree of inconsistency in data distribution between the experimental group and the control group is significantly reduced, making the data distribution more balanced, thus improving the accuracy and reliability of the experimental results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113988185B_ABST
    Figure CN113988185B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and discloses a data processing method and related devices, which include: obtaining a first sample group and a second sample group, and determining the difficulty score of each attribute data in the two first sample groups when the attribute data distribution characteristics of the two sample groups do not meet the equilibrium condition, determining the mobile impact score of each sample in the two sample groups based on the difficulty score, exchanging the K samples with the lowest mobile impact in the two sample groups, obtaining the two updated sample groups, and continuing to determine whether the attribute data distribution characteristics of the two updated sample groups meet the equilibrium condition, and if not, continuing to update the two sample groups until the equilibrium condition is met, and outputting the two updated sample groups that meet the equilibrium condition. The present application can minimize the degree of inconsistency in the data distribution of the two sample groups, so that the data distribution of the two sample groups is balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a data processing method and related devices. Background Art

[0002] In work, it is often necessary to use experimental groups and control groups, and use new and old strategies for the two groups of sample data to verify whether the new strategy is effective. The samples included in the experimental group and the control group are sampled and selected from the overall sample. If the characteristic distribution of the sample data of the experimental group and the control group is very different, it is easy to have a negative impact on the experimental results. For example, in the application scenario of the auto insurance renewal strategy, if the distribution of certain indicators of the experimental group and the control group (such as the insurance period, the length of time to purchase the car, etc.) is inconsistent, it will naturally cause the renewal rate to be high, and it will be impossible to prove the effectiveness of the strategy.

[0003] At present, the general sampling method is to first use simple random sampling, stratified sampling and other sampling methods to sample the total sample, and then simply divide the sampled samples into two groups to obtain the experimental group sample and the control group sample. However, the above methods cannot guarantee the consistency of the sample data distribution of the experimental group and the control group. Therefore, how to process the data so that the sample data distribution of the experimental group and the control group is consistent needs to be solved urgently. Summary of the invention

[0004] The embodiment of the present application provides a data processing method and related devices, which can minimize the degree of inconsistency in data distribution of the two sample groups by performing data processing on two sample groups whose attribute data distribution characteristics do not meet the equilibrium condition until the equilibrium condition is met, so as to make the data distribution of the two sample groups balanced.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, including:

[0006] Acquire a first sample group and a second sample group, wherein the first sample group and the second sample group each include a plurality of samples, and each sample in the plurality of samples includes a plurality of attribute data;

[0007] determining whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition, and if the balance condition is not met, determining a difficulty score of each attribute data in the first sample group and a difficulty score of each attribute data in the second sample group, wherein the difficulty score is related to the discrete degree of the attribute data;

[0008] Determine the movement influence score of each sample in the first sample group based on the difficulty score of each attribute data in the first sample group, and determine the movement influence score of each sample in the second sample group based on the difficulty score of each attribute data in the second sample group, wherein the movement influence score is used to indicate the total influence degree of moving the sample on the attribute data distribution characteristics of the sample group to which the sample belongs;

[0009] The K samples with the lowest mobile influence scores in the first sample group and the second sample group are exchanged respectively to obtain an updated first sample group and an updated second sample group, where K is a positive integer; and it is determined whether the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, until the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, and the updated first sample group and the updated second sample group that meet the equilibrium condition are output.

[0010] In a possible implementation manner, determining whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition includes:

[0011] Determine the distribution characteristics of each attribute data in the first sample group and the distribution characteristics of each attribute data in the second sample group;

[0012] If the distribution characteristics of the attribute data representing the same attribute in the first sample group and the second sample group meet the difference condition, determine the attribute represented by the attribute data as a target attribute, obtain the number of the target attributes, and calculate the ratio of the number of the target attributes to the number of the multiple attribute data included in the first sample group;

[0013] When the ratio is less than a preset threshold, determining that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet the balance condition;

[0014] When the ratio is greater than the preset threshold, it is determined that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group do not satisfy the balance condition.

[0015] In a possible implementation, determining the difficulty score of each attribute data in the first sample group includes:

[0016] For each type of attribute data in the first sample group, determine multiple data features of each type of attribute data, and combine the multiple data features of each type of attribute data into vectors to obtain multiple vectors, wherein each type of attribute data in the first sample group corresponds to one vector;

[0017] Clustering the multiple vectors to obtain one or more clusters;

[0018] Determine the average degree of dispersion of each cluster in the one or more clusters, and determine the difficulty score of each type of attribute data in the first sample group based on the average degree of dispersion of each cluster, wherein the difficulty score is positively correlated with the average degree of dispersion of the cluster to which the vector corresponding to the attribute data belongs.

[0019] In one possible implementation, the multiple data features include multiple items of the following features: the variance of the attribute data value distribution, the number of non-repetitive attribute data values, the saturation of the attribute data, the range of the attribute data value distribution, the standard deviation of the attribute data value distribution, and the interquartile range of the attribute data value distribution.

[0020] In a possible implementation manner, determining the average discrete degree of each cluster in the one or more clusters includes:

[0021] For each cluster of the one or more clusters, attribute data corresponding to the vector included in the cluster is determined, and based on the multiple data features of the attribute data corresponding to the vector included in the cluster, an average degree of dispersion of the cluster is determined.

[0022] In a possible implementation, determining the mobility impact score of each sample in the first sample group based on the difficulty score of each attribute data in the first sample group includes:

[0023] For any sample in the first sample group, the distribution characteristic value of each attribute data in the sample is obtained, and the mobile impact score of the sample is determined based on the difficulty score of each attribute data in the first sample group and the distribution characteristic value of each attribute data in the sample.

[0024] In a possible implementation manner, obtaining the first sample group and the second sample group includes:

[0025] Acquire a sample set, and sample the sample set using a preset sampling method to obtain a plurality of samples after sampling, wherein the preset sampling method includes simple random sampling or stratified sampling;

[0026] The plurality of samples after sampling are divided into two groups to obtain the first sample group and the second sample group.

[0027] In a second aspect, an embodiment of the present application provides a data processing device, including:

[0028] An acquiring unit, configured to acquire a first sample group and a second sample group, wherein the first sample group and the second sample group each include a plurality of samples, and each sample in the plurality of samples includes a plurality of attribute data;

[0029] A first determining unit, configured to determine whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition, and if the balance condition is not met, determine a difficulty score of each attribute data in the first sample group and a difficulty score of each attribute data in the second sample group, wherein the difficulty score is related to the discrete degree of the attribute data;

[0030] a second determining unit, configured to determine a movement influence score of each sample in the first sample group based on the difficulty score of each attribute data in the first sample group, and to determine a movement influence score of each sample in the second sample group based on the difficulty score of each attribute data in the second sample group, wherein the movement influence score is used to indicate a total influence degree of moving the sample on a distribution feature of the attribute data of the sample group to which the sample belongs;

[0031] The updating unit is used to exchange K samples with the lowest mobile influence scores in the first sample group and the second sample group respectively to obtain an updated first sample group and an updated second sample group, where K is a positive integer; and determine whether the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, until the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, and output the updated first sample group and the updated second sample group that meet the equilibrium condition.

[0032] In a possible design, the first determining unit is specifically configured to:

[0033] Determine the distribution characteristics of each attribute data in the first sample group and the distribution characteristics of each attribute data in the second sample group;

[0034] If the distribution characteristics of the attribute data representing the same attribute in the first sample group and the second sample group meet the difference condition, determine the attribute represented by the attribute data as a target attribute, obtain the number of the target attributes, and calculate the ratio of the number of the target attributes to the number of the multiple attribute data included in the first sample group;

[0035] When the ratio is less than a preset threshold, determining that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet the balance condition;

[0036] When the ratio is greater than the preset threshold, it is determined that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group do not satisfy the balance condition.

[0037] In a possible design, the first determining unit is specifically configured to:

[0038] For each type of attribute data in the first sample group, determine multiple data features of each type of attribute data, and combine the multiple data features of each type of attribute data into vectors to obtain multiple vectors, wherein each type of attribute data in the first sample group corresponds to one vector;

[0039] Clustering the multiple vectors to obtain one or more clusters;

[0040] Determine the average degree of dispersion of each cluster in the one or more clusters, and determine the difficulty score of each type of attribute data in the first sample group based on the average degree of dispersion of each cluster, wherein the difficulty score is positively correlated with the average degree of dispersion of the cluster to which the vector corresponding to the attribute data belongs.

[0041] In one possible design, the multiple data features include multiple items of the following features: the variance of the attribute data value distribution, the number of non-repetitive attribute data values, the saturation of the attribute data, the range of the attribute data value distribution, the standard deviation of the attribute data value distribution, and the interquartile range of the attribute data value distribution.

[0042] In a possible design, the first determining unit is specifically configured to:

[0043] For each cluster of the one or more clusters, attribute data corresponding to the vector included in the cluster is determined, and based on the multiple data features of the attribute data corresponding to the vector included in the cluster, an average degree of dispersion of the cluster is determined.

[0044] In a possible design, the second determining unit is specifically configured to:

[0045] For any sample in the first sample group, the distribution characteristic value of each attribute data in the sample is obtained, and the mobile impact score of the sample is determined based on the difficulty score of each attribute data in the first sample group and the distribution characteristic value of each attribute data in the sample.

[0046] In a possible design, the acquisition unit is specifically used to:

[0047] Acquire a sample set, and sample the sample set using a preset sampling method to obtain a plurality of samples after sampling, wherein the preset sampling method includes simple random sampling or stratified sampling;

[0048] The plurality of samples after sampling are divided into two groups to obtain the first sample group and the second sample group.

[0049] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a communication interface, wherein the processor, memory, and communication interface are interconnected, wherein the communication interface is used to receive and send data, the memory is used to store program code, and the processor is used to call the program code to execute the method described in the first aspect.

[0050] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method described in the first aspect above.

[0051] In the embodiment of the present application, when the attribute data distribution characteristics of the first sample group and the second sample group do not meet the equilibrium condition, the difficulty score of each attribute data in the first sample group and the second sample group is determined, and the mobile impact score of each sample in the first sample group and the second sample group is determined based on the difficulty score, and the K samples with the lowest mobile impact in each of the two sample groups are exchanged to obtain the two updated sample groups, and it is continued to be determined whether the attribute data distribution characteristics of the two updated sample groups meet the equilibrium condition. If not, the two sample groups are continuously updated until the attribute data distribution characteristics of the two updated sample groups meet the equilibrium condition. By processing the data of the two sample groups whose attribute data distribution characteristics do not meet the equilibrium condition, that is, finding the samples that meet the conditions (that is, the lowest mobile impact score) in the two sample groups with uneven distribution and iteratively exchanging them until the equilibrium condition is reached, the degree of inconsistency in the data distribution of the two sample groups can be minimized, thereby balancing the data distribution of the two sample groups as much as possible. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0053] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;

[0054] Figure 2 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The present application is described in further detail below in conjunction with the accompanying drawings.

[0057] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "a", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context.

[0058] In the present application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three and more than three, and "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c".

[0059] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0060] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0061] The embodiments of the present application provide a data processing method and related devices. In order to more clearly describe the solution of the present application, some drawings involved in the present application are further introduced below.

[0062] See also Figure 1 , Figure 1A flow chart of a data processing method provided in an embodiment of the present application. Figure 1 As shown, the method may include the following steps 110 to 140.

[0063] Step 110, obtaining a first sample group and a second sample group, wherein the first sample group and the second sample group each include a plurality of samples, and each sample in the plurality of samples includes a plurality of attribute data;

[0064] In one embodiment, the process of obtaining the first sample group and the second sample group is as follows:

[0065] First, a sample set is obtained, and the sample set is sampled using a preset sampling method to obtain multiple samples after sampling. The preset sampling method includes simple random sampling or stratified sampling. Then, the multiple samples after sampling are divided into two groups to obtain a first sample group and a second sample group. The data in the sample set is structured, that is, each sample in the sample set has multiple attributes. For example, in a marketing strategy testing scenario, a sample may refer to relevant information of a user, and the multiple attributes of the sample may refer to information such as the user's gender, age, and insurance term. The first sample group and the second sample group are obtained by sampling based on the sample set. Therefore, the first sample group and the second sample group both have multiple samples in the sample set, and the multiple samples included in the first sample group are different from the multiple samples included in the second sample group. Each sample in the two sample groups includes multiple attribute data. For example, the first sample group is {user 1 (A attribute data 1, B attribute data 1), user 2 (A attribute data 2, B attribute data 2)}, and the second sample group is {user 3 (A attribute data 3, B attribute data 3), user 4 (A attribute data 4, B attribute data 4)}. It can be understood that in a sample group, if a sample corresponds to a row of data, then a type of attribute data can correspond to a column of data in the sample group. Conversely, if a sample corresponds to a column of data, then a type of attribute data can correspond to a row of data in the sample group.

[0066] Step 120, determining whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition. If the balance condition is not met, determining a difficulty score for each attribute data in the first sample group and a difficulty score for each attribute data in the second sample group, wherein the difficulty score is related to the degree of discreteness of the attribute data.

[0067] In one embodiment, if the distribution difference of some attribute data in the first sample group and the second sample group is large, it can be considered that the data distribution of the two sample groups is unbalanced, and the accuracy and reliability of the experimental results of the control experiment based on the two sample groups cannot be guaranteed. Therefore, the two sample groups need to be processed to make the data distribution of the two balanced, that is, the distribution difference of the attribute data of the two meets the experimental requirements. Specifically, determining whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet the balance condition can include the following steps:

[0068] First, determine the distribution characteristics of each attribute data in the first sample group and the distribution characteristics of each attribute data in the second sample group. In this embodiment, in the first sample group or the second sample group, the distribution characteristics of one attribute data may refer to the value distribution characteristics of all attribute data representing the same attribute in the sample group. For example, the first sample group includes 100 samples, and the gender data of the samples is one of the attribute data. The number of samples with female gender (which can be represented by the value 1) in the first sample group is 30, and the number of samples with male gender (which can be represented by the value 0) is 70. Then the distribution characteristics of the attribute data in the first sample group can be: 1, 30%; 0, 70%. This distribution characteristic means that the attribute data has a total of 2 values ​​1 and 0, and the corresponding distribution proportions are 30% and 70% respectively.

[0069] Secondly, if the distribution characteristics of the attribute data representing the same attribute in the first sample group and the second sample group meet the difference condition, the attribute represented by the attribute data is determined as the target attribute, the number of the target attributes is obtained, and the ratio of the number of the target attributes to the number of the multiple attribute data included in the first sample group is calculated. In this embodiment, the difference condition can be set according to the strictness of the difference between the two groups of data in the comparative test. If the test requirements are strict and the distribution of the two groups of data is required to be as consistent as possible, the difference condition is set to a relatively strict condition. Exemplarily, the difference condition can be set to a difference in the distribution of any value of the attribute data that is greater than 2%. If the distribution characteristics of a certain attribute data of the first sample group and the second sample group are p, 20%, q, 30%, r, 50%; and p, 19%, q, 32%, r, 49%, that is, the difference in the value distribution characteristics of the corresponding attribute data is 1%, -2%, 1%, then it can be determined that the distribution characteristics of the attribute data of the two sample groups do not meet the difference condition, and the data distribution of the attribute data of the two groups of data is consistent; and if the distribution characteristics of a certain attribute data are p, 0%, q, 44%, r, 56%; and p, 3%, q, 43%, r, 54%, that is, the difference in the value distribution characteristics of the corresponding attribute data is -3%, -2%, 1%, then it can be determined that the distribution characteristics of the attribute data of the two sample groups meet the difference condition, and the data distribution of the attribute data of the two groups of data is inconsistent, so the attribute represented by the attribute data can be determined as the target attribute. Comparing the number of target attributes with the number of attribute data included in the first sample group, the ratio obtained can represent the degree of inconsistency of the attribute data distribution of the two sample groups. The above ratio is compared with a preset threshold, and according to the comparison result, it can be determined whether the attribute data distribution characteristics of the first sample group and the second sample group meet the balance condition. The preset threshold can be set according to actual needs.

[0070] Specifically, when the ratio is less than a preset threshold, it is determined that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet the balance condition; and when the ratio is greater than the preset threshold, it is determined that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group do not meet the balance condition. When the ratio is equal to the preset threshold, it can be determined whether the balance condition is met or not according to the strictness of the experiment.

[0071] Therefore, after determining that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet the equilibrium condition, the first sample group and the second sample group are further processed to make the data distribution of the two sample groups as consistent as possible. Specifically, the difficulty score of each attribute data in the first sample group and the second sample group can be determined first. The difficulty score is related to the discrete degree of the attribute data. The process of determining the difficulty score of the attribute data in one embodiment is described below:

[0072] (1) For each attribute data in the first sample group, multiple data features of each attribute data are determined, and the multiple data features of each attribute data are combined into a vector to obtain multiple vectors, wherein one attribute data in the first sample group corresponds to one vector; optionally, the multiple data features include multiple items of the following features: variance of attribute data value distribution, number of non-repetitive attribute data values, saturation of attribute data (i.e., ratio of total number of non-null values ​​to total number of all values), range of attribute data value distribution, standard deviation of attribute data value distribution and interquartile range of attribute data value distribution. It is understandable that if each attribute data in the first sample group corresponds to one column, the above multiple data features correspond to the variance of column value distribution, column saturation, etc. If each attribute data in the first sample group corresponds to one row, the above multiple data features correspond to the variance of row value distribution, row saturation, etc.

[0073] (2) Clustering the multiple vectors to obtain one or more clusters; the clustering can be completed using the k-means clustering algorithm (k-means clustering algorithm). The clustering algorithm is an unsupervised machine learning method, which automatically classifies similar samples into one category. The k-means clustering algorithm is a very common and effective clustering algorithm. The specific process of clustering the multiple vectors using the k-means clustering algorithm can include the following steps 1)-4):

[0074] 1) Determine k initial center point vectors from the above multiple vectors, denoted as C1, C2, ..., C k , each vector has the same feature dimension. k is an integer greater than or equal to 1.

[0075] 2) Calculate the distance between each vector and the k center point vectors, and put the vector into the set corresponding to the nearest center point. Thus, each vector will enter a cluster.

[0076] 3) For each cluster, calculate the coordinate average of all vectors included in the cluster to obtain the new center point vector C1, C2, ..., C k .

[0077] 4) Repeat steps 2) and 3) until the center point converges or the maximum number of iterations is reached, and k clusters and the vectors contained in each cluster are obtained.

[0078] (3) Determine the average discreteness of each cluster in the one or more clusters, and determine the difficulty score of each type of attribute data in the first sample group based on the average discreteness of each cluster, wherein the difficulty score is positively correlated with the average discreteness of the cluster to which the vector corresponding to the attribute data belongs. In one embodiment, the average discreteness of each cluster is related to the discreteness of the attribute data corresponding to the vector included in it. Therefore, for each cluster in the one or more clusters, determine the attribute data corresponding to the vector included in the cluster, and determine the average discreteness of the cluster based on the multiple data features of the attribute data corresponding to the vector included in the cluster. Exemplarily, the average discreteness of the cluster can be obtained by weighted averaging the data features of the attribute data corresponding to the vector included in each cluster. The data features may include the discreteness of the value distribution (such as the range, the interquartile range, the standard deviation, etc.), the number of non-repeated values, the variance of the column value distribution, etc. It is understandable that if the average degree of dispersion of the clusters is greater, it is more difficult to make the distribution of the attribute data corresponding to the vectors included in the clusters of one sample group consistent with the distribution of the corresponding attribute data in another sample group. Therefore, the difficulty score of each attribute data can be determined according to the average degree of dispersion of the clusters. Specifically, one or more clusters related to the first sample group can be sorted according to the average degree of dispersion, and the difficulty score of each attribute data in the first sample group can be determined according to the sorting result. The difficulty score can indicate to a certain extent the difficulty of the attribute data to make the distribution of the two sample groups balanced. The greater the difficulty score, the greater the difficulty of making the distribution of the two groups of data balanced.

[0079] The process of obtaining the difficulty score of each attribute data in the second sample group is the same as the process of obtaining the difficulty score of each attribute data in the first sample group.

[0080] Step 130, based on the difficulty score of each attribute data in the first sample group, determine the movement impact score of each sample in the first sample group, and based on the difficulty score of each attribute data in the second sample group, determine the movement impact score of each sample in the second sample group, the movement impact score is used to represent the total impact of moving the sample on the attribute data distribution characteristics of the sample group to which the sample belongs.

[0081] In one embodiment, after obtaining the difficulty score of each attribute data in the sample group, the mobile impact score of each sample in the first sample group and the second sample group can be further determined based on the difficulty score, and the first sample group and the second sample group can be processed according to the mobile impact score so that the attribute data distribution of the two samples is as consistent as possible. In this embodiment, the process of determining the mobile impact score of each sample in the first sample group specifically includes the following steps: for any sample in the first sample group, obtain the distribution characteristic value of each attribute data in the sample, and determine the mobile impact score of the sample based on the difficulty score of each attribute data in the first sample group and the distribution characteristic value of each attribute data in the sample. Among them, the distribution characteristic value of each attribute data in a sample can specifically include the ratio of the number of repetitions of the value of the single attribute data in the attribute data representing the same attribute in the sample group to the total number of samples in the first sample group, and the number of different values ​​of the attribute data. If one sample in the first sample group corresponds to a row and one attribute data corresponds to a column, the difficulty score of the attribute data is recorded as A. j , (j represents the total number of columns in the first sample group), and the mobile impact score of the sample is recorded as P i (i represents the total number of rows in the first sample group), the relationship between the two can be expressed by formula (1):

[0082]

[0083] Among them, P i is the mobility impact score of the i-th row, A j is the difficulty score of the jth column, K j is the number of different values ​​of column j, S i,j It is the ratio of the number of repetitions of this sample value in the i-th row and j-th column in the j-th column to the total number of all samples in the j-th column.

[0084] Specifically, for the first sample group, for each row in the first sample group, the mobile impact score of the row is the sum of the products of the column distribution characteristic value of each data in the row and the difficulty score of the column where the data is located. In general, the ratio of the total number of values ​​corresponding to a certain data in the column distribution characteristic value of a certain data in a certain row to the total number of data in the column where the data is located (S i,j ) and the fewer the values ​​in the column where the data is located, the lower the mobile impact score of the row is. The mobile impact score can represent the total impact of moving the row of samples on the distribution characteristics of the attribute data of the first sample group.

[0085] It is understandable that the process of determining the mobile impact score of each sample in the second sample group based on the difficulty score of each attribute data in the second sample group can be specifically referred to the process of determining the mobile impact score of each sample in the first sample group. That is to say, to obtain the mobile impact score of each sample, the processing process of the two sample groups is similar. The above steps are explained by taking the first sample group as an example, which will not be repeated here.

[0086] Step 140: Exchange the K samples with the lowest mobile influence scores in the first sample group and the second sample group respectively to obtain an updated first sample group and an updated second sample group, where K is a positive integer; and determine whether the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, until the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, and output the updated first sample group and the updated second sample group that meet the equilibrium condition.

[0087] In one embodiment, after determining the mobility impact score of each sample in the first sample group and the mobility impact score of each sample in the second sample group, the K samples with the lowest mobility impact scores in the first sample group are exchanged with the K samples with the lowest mobility impact scores in the second sample group to obtain an updated first sample group and an updated second sample group. Furthermore, after obtaining the updated first sample group and the updated second sample group, it is determined whether the attribute data distribution characteristics of the updated two sample groups meet the equilibrium condition in the above step 120. If not, the mobile influence score of each sample in the two updated sample groups is continued to be determined, and the K samples with the lowest mobile influence score are exchanged respectively, and the update is completed again, and it is determined whether the condition for stopping iteration is met, and the condition for stopping iteration includes the above equilibrium condition; and if the attribute data distribution characteristics of the updated two sample groups meet the equilibrium condition in the above step 120, that is, after updating the first sample group and the second sample group (that is, completing the sample exchange), it is determined that the condition for stopping iteration is met, the iteration is stopped, and the updated first sample group and the second sample group that meet the above equilibrium condition are output, and they are determined as two sample groups that can be subjected to a control experiment. Optionally, the above condition for stopping iteration may also include other conditions, for example, determining whether the number of iterations meets the iteration threshold, and the iteration threshold may be determined according to actual needs. If it is determined that the number of iterations meets the iteration threshold, even if the above equilibrium condition is not met, the iteration may be stopped, and the first sample group and the second sample group obtained by the last update may be output.

[0088] It can be understood that exchanging the K samples with the lowest mobile impact scores in the two sample groups respectively is actually to determine the samples with the lowest impact on the distribution characteristics of the attribute data of each group after the movement from the two sample groups and exchange them. By exchanging samples, the degree of distribution inconsistency of the two sample groups can be minimized, so that the distribution of the two groups can be as balanced as possible. Among them, K is a positive integer, that is, K can be 1, that is, each time the first sample group and the second sample group are updated, only one sample with the lowest mobile impact score in each of the two sample groups is exchanged with each other to complete the update. In this way, the accuracy of the process of updating the two sample groups can be improved, and the most suitable samples can be found for exchange each time, thereby avoiding the problem that the distribution deviation of the two updated sample groups does not converge due to too many samples exchanged at a single time, thereby improving the accuracy of data processing. In addition, K may also be an integer greater than 1. Specifically, the actual value of K may be determined according to the number of samples included in the first sample group and the second sample group. That is, each time the first sample group and the second sample group are updated, a plurality of samples with the lowest mobile influence scores in the two sample groups are correspondingly exchanged to complete the update. In this way, when the number of samples included in the two sample groups is large, a plurality of samples may be exchanged at one time to increase the degree of variation of the data distribution characteristics of a single sample group, so that the degree of inconsistency in the data distribution of the two sample groups is reduced as quickly as possible, thereby improving data processing efficiency.

[0089] In the embodiment of the present application, when the attribute data distribution characteristics of the first sample group and the second sample group do not meet the equilibrium condition, the difficulty score of each attribute data in the first sample group and the second sample group is determined, and the mobile impact score of each sample in the first sample group and the second sample group is determined based on the difficulty score, and the K samples with the lowest mobile impact in each of the two sample groups are exchanged to obtain the two updated sample groups, and it is continued to be determined whether the attribute data distribution characteristics of the two updated sample groups meet the equilibrium condition. If not, the two sample groups are continuously updated until the attribute data distribution characteristics of the two updated sample groups meet the equilibrium condition. By processing the data of the two sample groups whose attribute data distribution characteristics do not meet the equilibrium condition, that is, finding the samples that meet the conditions (that is, the lowest mobile impact score) in the two sample groups with uneven distribution and iteratively exchanging them until the equilibrium condition is reached, the degree of inconsistency in the data distribution of the two sample groups can be minimized, thereby balancing the data distribution of the two sample groups as much as possible.

[0090] See also Figure 2 , Figure 2 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application. Figure 2 As shown, the data processing device may include:

[0091] An acquisition unit 10 is configured to acquire a first sample group and a second sample group, wherein the first sample group and the second sample group each include a plurality of samples, and each sample in the plurality of samples includes a plurality of attribute data;

[0092] A first determining unit 11 is used to determine whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition, and if the balance condition is not met, determine a difficulty score of each attribute data in the first sample group and a difficulty score of each attribute data in the second sample group, wherein the difficulty score is related to the discrete degree of the attribute data;

[0093] a second determining unit 12, configured to determine a movement influence score of each sample in the first sample group based on the difficulty score of each attribute data in the first sample group, and to determine a movement influence score of each sample in the second sample group based on the difficulty score of each attribute data in the second sample group, wherein the movement influence score is used to indicate a total influence degree of moving the sample on the attribute data distribution characteristics of the sample group to which the sample belongs;

[0094] The updating unit 13 is used to exchange the K samples with the lowest mobile influence scores in the first sample group and the second sample group respectively to obtain an updated first sample group and an updated second sample group, where K is a positive integer; and determine whether the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, until the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, and output the updated first sample group and the updated second sample group that meet the equilibrium condition.

[0095] In a possible design, the first determining unit 11 is specifically configured to:

[0096] Determine the distribution characteristics of each attribute data in the first sample group and the distribution characteristics of each attribute data in the second sample group;

[0097] If the distribution characteristics of the attribute data representing the same attribute in the first sample group and the second sample group meet the difference condition, determine the attribute represented by the attribute data as a target attribute, obtain the number of the target attributes, and calculate the ratio of the number of the target attributes to the number of the multiple attribute data included in the first sample group;

[0098] When the ratio is less than a preset threshold, determining that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet the balance condition;

[0099] When the ratio is greater than the preset threshold, it is determined that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group do not satisfy the balance condition.

[0100] In a possible design, the first determining unit 11 is specifically configured to:

[0101] For each type of attribute data in the first sample group, determine multiple data features of each type of attribute data, and combine the multiple data features of each type of attribute data into vectors to obtain multiple vectors, wherein each type of attribute data in the first sample group corresponds to one vector;

[0102] Clustering the multiple vectors to obtain one or more clusters;

[0103] Determine the average degree of dispersion of each cluster in the one or more clusters, and determine the difficulty score of each type of attribute data in the first sample group based on the average degree of dispersion of each cluster, wherein the difficulty score is positively correlated with the average degree of dispersion of the cluster to which the vector corresponding to the attribute data belongs.

[0104] In one possible design, the multiple data features include multiple items of the following features: the variance of the attribute data value distribution, the number of non-repetitive attribute data values, the saturation of the attribute data, the range of the attribute data value distribution, the standard deviation of the attribute data value distribution, and the interquartile range of the attribute data value distribution.

[0105] In a possible design, the first determining unit 11 is specifically configured to:

[0106] For each cluster of the one or more clusters, attribute data corresponding to the vector included in the cluster is determined, and based on the multiple data features of the attribute data corresponding to the vector included in the cluster, an average degree of dispersion of the cluster is determined.

[0107] In a possible design, the second determining unit 12 is specifically configured to:

[0108] For any sample in the first sample group, the distribution characteristic value of each attribute data in the sample is obtained, and the mobile impact score of the sample is determined based on the difficulty score of each attribute data in the first sample group and the distribution characteristic value of each attribute data in the sample.

[0109] In a possible design, the acquisition unit 10 is specifically used to:

[0110] Acquire a sample set, and sample the sample set using a preset sampling method to obtain a plurality of samples after sampling, wherein the preset sampling method includes simple random sampling or stratified sampling;

[0111] The plurality of samples after sampling are divided into two groups to obtain the first sample group and the second sample group.

[0112] in, Figure 2 The detailed description of the embodiment of the device shown can refer to the aforementioned Figure 1 The specific description of the illustrated method embodiment will not be repeated here.

[0113] Please refer to Figure 3 , Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the electronic device 1000 may include: at least one processor 1001, such as a CPU, at least one communication interface 1003, a memory 1004, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The communication interface 1003 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1004 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1004 may optionally also be at least one storage device located away from the aforementioned processor 1001. As shown in FIG. Figure 3 As shown, the memory 1004 as a computer storage medium may include an operating system, a network communication module, and program instructions.

[0114] exist Figure 3 In the electronic device 1000 shown, the processor 1001 may be used to load the program instructions stored in the memory 1004, and specifically perform the following operations:

[0115] Acquire a first sample group and a second sample group, wherein the first sample group and the second sample group each include a plurality of samples, and each sample in the plurality of samples includes a plurality of attribute data;

[0116] determining whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition, and if the balance condition is not met, determining a difficulty score of each attribute data in the first sample group and a difficulty score of each attribute data in the second sample group, wherein the difficulty score is related to the discrete degree of the attribute data;

[0117] Determine the movement influence score of each sample in the first sample group based on the difficulty score of each attribute data in the first sample group, and determine the movement influence score of each sample in the second sample group based on the difficulty score of each attribute data in the second sample group, wherein the movement influence score is used to indicate the total influence degree of moving the sample on the attribute data distribution characteristics of the sample group to which the sample belongs;

[0118] The K samples with the lowest mobile influence scores in the first sample group and the second sample group are exchanged respectively to obtain an updated first sample group and an updated second sample group, where K is a positive integer; and it is determined whether the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, until the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, and the updated first sample group and the updated second sample group that meet the equilibrium condition are output.

[0119] It should be noted that the specific implementation process can be found in Figure 1 The specific description of the illustrated method embodiment will not be repeated here.

[0120] The specific execution steps can be found in the description of the aforementioned embodiment and will not be repeated here.

[0121] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 1 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 1 The specific description of the illustrated embodiment will not be repeated here.

[0122] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it includes the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

Claims

1. A data processing method, characterized in that: include: Obtaining a first sample group and a second sample group, wherein the first sample group and the second sample group each include a plurality of samples, each of the plurality of samples includes a plurality of attribute data, each sample is relevant information of a user, and the plurality of attribute data included in each sample includes the user's gender, age, insurance period, and vehicle purchase time; determining whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition, and if the balance condition is not met, determining, for each attribute data in the first sample group, a plurality of data characteristics of each attribute data in the first sample group, and combining the plurality of data characteristics of each attribute data in the first sample group into a vector to obtain a plurality of vectors corresponding to the first sample group, wherein each attribute data in the first sample group corresponds to one vector; Clustering the multiple vectors corresponding to the first sample group to obtain one or more clusters corresponding to the first sample group; Determine the average degree of dispersion of each cluster in one or more clusters corresponding to the first sample group, and determine the difficulty score of each attribute data in the first sample group based on the average degree of dispersion of each cluster corresponding to the first sample group, wherein the difficulty score is positively correlated with the average degree of dispersion of the cluster to which the vector corresponding to the attribute data belongs; For each type of attribute data in the second sample group, determine multiple data features of each type of attribute data in the second sample group, and combine the multiple data features of each type of attribute data in the second sample group into vectors to obtain multiple vectors corresponding to the second sample group, wherein each type of attribute data in the second sample group corresponds to one vector; Clustering the multiple vectors corresponding to the second sample group to obtain one or more clusters corresponding to the second sample group; Determine the average degree of dispersion of each cluster in one or more clusters corresponding to the second sample group, and determine the difficulty score of each attribute data in the second sample group based on the average degree of dispersion of each cluster corresponding to the second sample group, wherein the difficulty score is positively correlated with the average degree of dispersion of the cluster to which the vector corresponding to the attribute data belongs; For any sample of the first sample group, obtaining a distribution characteristic value of each attribute data in any sample of the first sample group, and determining a movement influence score of any sample in the first sample group based on a difficulty score of each attribute data in the first sample group and a distribution characteristic value of each attribute data in any sample of the first sample group, wherein the movement influence score is used to indicate a total influence degree of moving any sample in the first sample group on the distribution characteristics of the attribute data of the first sample group; For any sample of the second sample group, obtaining a distribution characteristic value of each attribute data in any sample of the second sample group, and determining a movement influence score of any sample in the second sample group based on a difficulty score of each attribute data in the second sample group and a distribution characteristic value of each attribute data in any sample of the second sample group, wherein the movement influence score is used to indicate a total influence degree of moving any sample in the second sample group on the distribution characteristics of the attribute data of the second sample group; Respectively exchanging K samples with the lowest mobile influence scores in the first sample group and the second sample group to obtain an updated first sample group and an updated second sample group, where K is a positive integer; and determining whether the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, until the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, and outputting the updated first sample group and the updated second sample group that meet the equilibrium condition; One of the updated first sample group and the updated second sample group is used for calculation using the new motor vehicle insurance renewal strategy to obtain the renewal rate corresponding to the new motor vehicle insurance renewal strategy, and the other of the updated first sample group and the updated second sample group is used for calculation using the old motor vehicle insurance renewal strategy to obtain the renewal rate corresponding to the old motor vehicle insurance renewal strategy.

2. The method according to claim 1, characterized in that The determining whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition includes: Determine the distribution characteristics of each attribute data in the first sample group and the distribution characteristics of each attribute data in the second sample group; If the distribution characteristics of the attribute data representing the same attribute in the first sample group and the second sample group meet the difference condition, determine the attribute represented by the attribute data as a target attribute, obtain the number of the target attributes, and calculate the ratio of the number of the target attributes to the number of the multiple attribute data included in the first sample group; In the case where the ratio is less than a preset threshold, determining that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet the balance condition; When the ratio is greater than the preset threshold, it is determined that the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group do not satisfy the balance condition.

3. The method according to claim 1, characterized in that The multiple data features include multiple items of the following features: variance of attribute data value distribution, number of non-repetitive attribute data values, saturation of attribute data, range of attribute data value distribution, standard deviation of attribute data value distribution and interquartile range of attribute data value distribution.

4. The method according to claim 1, characterized in that The determining the average discrete degree of each cluster in the one or more clusters corresponding to the first sample group includes: For each cluster of the one or more clusters corresponding to the first sample group, attribute data corresponding to the vector included in the cluster is determined, and based on the multiple data features of the attribute data corresponding to the vector included in the cluster, an average discrete degree of the cluster is determined.

5. The method according to claim 1, characterized in that The obtaining of the first sample group and the second sample group comprises: Acquire a sample set, and sample the sample set using a preset sampling method to obtain a plurality of samples after sampling, wherein the preset sampling method includes simple random sampling or stratified sampling; The plurality of samples after sampling are divided into two groups to obtain the first sample group and the second sample group.

6. A data processing device, characterized in that: The device comprises a unit for executing the method according to any one of claims 1 to 5, the device comprising: An acquiring unit, configured to acquire a first sample group and a second sample group, wherein the first sample group and the second sample group each include a plurality of samples, and each sample in the plurality of samples includes a plurality of attribute data; A first determining unit, configured to determine whether the attribute data distribution characteristics of the first sample group and the attribute data distribution characteristics of the second sample group meet a balance condition, and if the balance condition is not met, determine a difficulty score of each attribute data in the first sample group and a difficulty score of each attribute data in the second sample group, wherein the difficulty score is related to the discrete degree of the attribute data; a second determining unit, configured to determine a movement influence score of each sample in the first sample group based on the difficulty score of each attribute data in the first sample group, and to determine a movement influence score of each sample in the second sample group based on the difficulty score of each attribute data in the second sample group, wherein the movement influence score is used to indicate a total influence degree of moving the sample on a distribution feature of the attribute data of the sample group to which the sample belongs; The updating unit is used to exchange K samples with the lowest mobile influence scores in the first sample group and the second sample group respectively to obtain an updated first sample group and an updated second sample group, where K is a positive integer; and determine whether the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, until the attribute data distribution characteristics of the updated first sample group and the attribute data distribution characteristics of the updated second sample group meet the equilibrium condition, and output the updated first sample group and the updated second sample group that meet the equilibrium condition.

7. An electronic device, characterized in that: It includes a processor, a memory and a communication interface, wherein the processor, the memory and the communication interface are interconnected, wherein the communication interface is used to receive and send data, the memory is used to store program code, and the processor is used to call the program code to execute the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Vehicle insurance risk prediction method, vehicle insurance risk prediction device, and server

    CN107292528A

  • Credit business data matching method and device

    CN112634031A