A method and device for determining data correlation
By calculating the relationship between Pilson phase -phase -phase -phase -due to variables and the number of Speelman, and determining a new related parameters, solving the problem that the relevant coefficient cannot be accurately selected in the existing technology, and achieved accurate analysis of data correlation. Essence
Patent Information
- Application Number
- CN201811012940.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-08-31
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2038-08-31
AI Technical Summary
The prior art cannot accurately select from the Pearson correlation coefficient and Spearman correlation coefficient when performing data correlation analysis, especially when the data correlation relationship is not clear.
By calculating the relationship between the Pilson phase between the independent variable and the Virman between the Pilson and the Speelman, and determine a new related parameters based on these two related coefficients. The value of this parameter is in The coefficients are correlated with the dependent variable and the variable.
There is no need to choose from the relationship between Pilson's relationship and the relationship between Speelman, which can accurately determine the correlation between data, and it can be effectively analyzed even if it is not clear.
Smart Images

Figure CN109346168B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for determining data correlation. Background Art
[0002] In order to determine the correlation between two groups of data, the correlation coefficient between the two groups of data can be calculated. In the prior art, the Pearson correlation coefficient or the Spearman correlation coefficient between the two groups of data can be calculated to determine the correlation between the two groups of data. Among them, the Pearson correlation coefficient is applicable to the scenario where the two groups of data have a linear correlation relationship, and the Spearman correlation coefficient is applicable to the scenario where the two groups of data have a nonlinear correlation relationship. It is usually necessary to manually rely on experience to choose to use the Pearson correlation coefficient or the Spearman correlation coefficient to represent the correlation between the two groups of data. However, when data correlation analysis is required, if there is a situation where the analyzed data has what kind of correlation relationship and is not understood, it is impossible to accurately select from the Pearson correlation coefficient or the Spearman correlation coefficient. Summary of the invention
[0003] In view of this, an embodiment of the present application provides a method and device for determining data correlation to solve the technical problem in the prior art that it is impossible to accurately select from the Pearson correlation coefficient or the Spearman correlation coefficient when performing data correlation analysis.
[0004] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:
[0005] A method for determining data relevance, the method comprising:
[0006] According to the parameter value of the independent variable and the parameter value of the dependent variable, the Pearson correlation coefficient and the Spearman correlation coefficient between the independent variable and the dependent variable are calculated, and the independent variable and the dependent variable have a corresponding relationship;
[0007] According to the Pearson correlation coefficient and the Spearman correlation coefficient, the correlation parameter between the independent variable and the dependent variable is determined, and the correlation parameter between the independent variable and the dependent variable is greater than or equal to a first value and less than or equal to a second value. If the Pearson correlation coefficient and the Spearman correlation coefficient are not equal, the first value is the smaller value of the Pearson correlation coefficient and the Spearman correlation coefficient, and the second value is the larger value of the Pearson correlation coefficient and the Spearman correlation coefficient. If the Pearson correlation coefficient and the Spearman correlation coefficient are equal, the first value and the second value are the Pearson correlation coefficient or the Spearman correlation coefficient.
[0008] In a possible implementation, determining the correlation parameter between the independent variable and the dependent variable according to the Pearson correlation coefficient and the Spearman correlation coefficient includes:
[0009] Multiplying the Pearson correlation coefficient by the Spearman correlation coefficient to obtain a third value;
[0010] Adding the Pearson correlation coefficient to the Spearman correlation coefficient to obtain a fourth value;
[0011] Divide the third value by the fourth value and then multiply by 2 to obtain a fifth value;
[0012] A correlation parameter between the independent variable and the dependent variable is determined to be the fifth value.
[0013] In a possible implementation, determining the correlation parameter between the independent variable and the dependent variable according to the Pearson correlation coefficient and the Spearman correlation coefficient includes:
[0014] When the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is greater than a first threshold, determining that the correlation parameter between the independent variable and the dependent variable is the second value;
[0015] When the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is less than or equal to the first threshold, the correlation parameter between the independent variable and the dependent variable is determined to be the fifth value.
[0016] In a possible implementation, the method further includes:
[0017] An independent variable whose correlation parameter between the independent variable and the dependent variable is greater than a second threshold is determined as a characteristic independent variable.
[0018] In a possible implementation, the method further includes:
[0019] Establish a linear equation, wherein one end of the linear equation is the dependent variable, and the other end of the linear equation is the sum of each characteristic data item, each of the characteristic data items is the product of a characteristic independent variable and a regression coefficient corresponding to the characteristic independent variable, the characteristic independent variables in each of the characteristic data items are different, and the number of the characteristic data items is the same as the number of the characteristic independent variables;
[0020] Substituting the standardized parameter values of the feature independent variables and the standardized parameter values of the dependent variables into the linear equation, and solving to obtain the regression coefficients corresponding to the respective feature independent variables;
[0021] According to the sorting of the regression coefficients corresponding to the respective feature independent variables, a first sorting result of the feature independent variables is obtained;
[0022] According to the sorting of the correlation parameters between each of the feature independent variables and the dependent variable, obtaining a second sorting result of the feature independent variables;
[0023] When the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from small to large, if the second sorting result of the target feature independent variable is greater than the first sorting result of the target feature independent variable, the target feature independent variable is deleted from the feature independent variables, and the target feature independent variable is any one of the feature independent variables;
[0024] When the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from large to small, if the second sorting result of the target feature independent variable is smaller than the first sorting result of the target feature independent variable, the target feature independent variable is deleted from the feature independent variables.
[0025] A device for determining data relevance, the device comprising:
[0026] A first calculation unit, used for calculating the Pearson correlation coefficient and the Spearman correlation coefficient between the independent variable and the dependent variable according to the parameter value of the independent variable and the parameter value of the dependent variable, wherein the independent variable and the dependent variable have a corresponding relationship;
[0027] A first determination unit is used to determine the correlation parameter between the independent variable and the dependent variable according to the Pearson correlation coefficient and the Spearman correlation coefficient, the correlation parameter between the independent variable and the dependent variable is greater than or equal to a first value and less than or equal to a second value. If the Pearson correlation coefficient and the Spearman correlation coefficient are not equal, the first value is the smaller value of the Pearson correlation coefficient and the Spearman correlation coefficient, and the second value is the larger value of the Pearson correlation coefficient and the Spearman correlation coefficient. If the Pearson correlation coefficient and the Spearman correlation coefficient are equal, the first value and the second value are the Pearson correlation coefficient or the Spearman correlation coefficient.
[0028] In a possible implementation manner, the first determining unit includes:
[0029] A first calculation subunit, configured to multiply the Pearson correlation coefficient by the Spearman correlation coefficient to obtain a third value;
[0030] A second calculation subunit, configured to add the Pearson correlation coefficient to the Spearman correlation coefficient to obtain a fourth value;
[0031] a third calculating subunit, configured to divide the third value by the fourth value and then multiply the result by 2 to obtain a fifth value;
[0032] The first determining subunit is used to determine that the correlation parameter between the independent variable and the dependent variable is the fifth value.
[0033] In a possible implementation manner, the first determining unit includes:
[0034] a second determining subunit, configured to determine that the correlation parameter between the independent variable and the dependent variable is the second value when the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is greater than a first threshold;
[0035] The third determination subunit is used to determine that the correlation parameter between the independent variable and the dependent variable is the fifth value when the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is less than or equal to the first threshold.
[0036] In a possible implementation manner, the device further includes:
[0037] The second determining unit is used to determine the independent variable whose correlation parameter between the independent variable and the dependent variable is greater than a second threshold as a characteristic independent variable.
[0038] In a possible implementation manner, the device further includes:
[0039] An establishing unit, used for establishing a linear equation, wherein one end of the linear equation is the dependent variable, and the other end of the linear equation is the sum of each characteristic data item, each of the characteristic data items is the product of a characteristic independent variable and a regression coefficient corresponding to the characteristic independent variable, the characteristic independent variables in each of the characteristic data items are different, and the number of the characteristic data items is the same as the number of the characteristic independent variables;
[0040] A second calculation unit is used to bring the standardized parameter value of the feature independent variable and the standardized parameter value of the dependent variable into the linear equation to solve and obtain the regression coefficient corresponding to each of the feature independent variables;
[0041] A first sorting unit, configured to obtain a first sorting result of the feature independent variables according to the sorting of the regression coefficients corresponding to the feature independent variables;
[0042] A second sorting unit, configured to obtain a second sorting result of the feature independent variables according to the sorting of correlation parameters between each of the feature independent variables and the dependent variable;
[0043] A first deleting unit is configured to, when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from small to large, delete the target feature independent variable from the feature independent variable if the second sorting result of the target feature independent variable is greater than the first sorting result of the target feature independent variable, wherein the target feature independent variable is any one of the feature independent variables;
[0044] The second deleting unit is used to delete the target feature independent variable from the feature independent variable when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from large to small and if the second sorting result of the target feature independent variable is smaller than the first sorting result of the target feature independent variable.
[0045] A computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the above-mentioned method for determining data correlation.
[0046] A computer program product, when running on a terminal device, enables the terminal device to implement the method for determining data relevance as described above.
[0047] It can be seen that the embodiments of the present application have the following beneficial effects:
[0048] The embodiment of the present application simultaneously calculates the Pearson correlation coefficient and the Spearman correlation coefficient between two groups of data of the independent variable and the dependent variable, and then uses the calculated Pearson correlation coefficient and the Spearman correlation coefficient to determine a new correlation parameter to characterize the correlation between the independent variable and the dependent variable. The value of the correlation parameter is between the Pearson correlation coefficient and the Spearman correlation coefficient. The correlation between the independent variable and the dependent variable is characterized by the correlation parameter. There is no need to select from the Pearson correlation coefficient and the Spearman correlation coefficient. Even if it is not clear what kind of correlation the analyzed data has, the correlation between the data can be determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A flowchart of a method for determining data relevance provided in an embodiment of the present application;
[0050] FIG. 2( a ) is an example diagram of a linear relationship between an independent variable and a dependent variable provided in an embodiment of the present application;
[0051] FIG2( b ) is an example diagram of a nonlinear relationship between independent variables and dependent variables provided in an embodiment of the present application;
[0052] FIG2( c ) is an example diagram of a nonlinear relationship between independent variables and dependent variables provided in an embodiment of the present application;
[0053] FIG2( d ) is an example diagram of a linear relationship between an independent variable and a dependent variable provided in an embodiment of the present application;
[0054] FIG2( e ) is an example diagram of a nonlinear relationship between independent variables and dependent variables provided in an embodiment of the present application;
[0055] Figure 3 A flowchart of a method for removing strongly correlated feature independent variables provided in an embodiment of the present application;
[0056] Figure 4 A structural diagram of a device for determining data correlation provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0058] To facilitate understanding of the technical solution of the present application, the background technology of the present application is first described below.
[0059] The inventors found in the study of traditional methods for analyzing the correlation between data that traditional analysis methods include the Pearson method and the Spearman method. Among them, the Pearson method is used to measure whether two data sets are on the same line, and is used to measure the degree of correlation between two sets of data in a linear relationship. The larger the absolute value of the Pearson correlation coefficient, the stronger the correlation between the two. However, this method is more suitable for the analysis of linear relationships between data, and has poor results for the analysis of data in non-linear relationships; the Spearman method is mainly used to analyze the degree of correlation between data in non-linear relationships, but this method cannot well reflect the degree of correlation between data in linear relationships. When it is necessary to perform correlation analysis on a large amount of collected data, for users who have not received professional training or do not know much about the collected data, it is impossible to accurately choose one of the above two methods to analyze the correlation of the data.
[0060] Based on this, an embodiment of the present application provides a method for determining data correlation, and simultaneously calculates the Pearson correlation coefficient and the Spearman correlation coefficient between two groups of data of the independent variable and the dependent variable, and then determines a new correlation parameter based on the above two correlation coefficients. The value of the correlation parameter is between the Pearson correlation coefficient and the Spearman correlation coefficient. The correlation parameter is used to characterize the correlation between the independent variable and the dependent variable. There is no need to select from the Pearson correlation coefficient and the Spearman correlation coefficient. Even if it is not clear what kind of correlation the analyzed data has, the correlation between the data can be determined.
[0061] To facilitate understanding of the technical solution of the present application, a method for determining data correlation provided in an embodiment of the present application will be described below with reference to the accompanying drawings.
[0062] See also Figure 1 , which is a flow chart of a method for determining data relevance provided in an embodiment of the present application, such as Figure 1 As shown, the method may include:
[0063] S101: Calculate the Pearson correlation coefficient and the Spearman correlation coefficient between the independent variable and the dependent variable according to the parameter value of the independent variable and the parameter value of the dependent variable.
[0064] In this embodiment, in order to obtain the correlation between the independent variable and the dependent variable in the collected large amount of data sets, the Pearson correlation coefficient and the Spearman correlation coefficient between each independent variable and the dependent variable can be calculated according to the parameter values of the respective variables and the parameter value of the dependent variable.
[0065] Among them, the independent variable and the dependent variable have a corresponding relationship, and the corresponding relationship can be one dependent variable corresponding to one independent variable, or one dependent variable corresponding to multiple independent variables. When the corresponding relationship is the latter, it is necessary to calculate the Pearson correlation coefficient and Spearman correlation coefficient between each independent variable and the dependent variable.
[0066] For example, to determine whether a patient has disease A, multiple tests are required for the patient, and finally a diagnosis is made based on multiple test data items. Among them, whether the patient has disease A can be regarded as a dependent variable, and each test item can be regarded as an independent variable. The Pearson correlation coefficient and Spearman correlation coefficient between the test data corresponding to each test item and the parameter value corresponding to whether the patient has disease A are calculated. In specific implementation, the parameter value corresponding to the patient having disease A can be set to 1; the parameter value corresponding to the patient not having disease A can be set to 0, so that the two correlation coefficients between the independent variable and the dependent variable can be calculated.
[0067] For another example, in order to determine whether a transaction is fraudulent, the bank needs to judge multiple transaction attributes such as the transaction time, transaction amount, and transaction location of the transaction, so as to comprehensively judge whether the transaction is fraudulent. Among them, determining whether the transaction is fraudulent can be the dependent variable, and multiple transaction attributes such as transaction time, transaction amount, and transaction location can be independent variables, and two correlation coefficients between each independent variable and the dependent variable are calculated. In the specific implementation, for the convenience of calculation, the transaction behavior can be determined as fraudulent and set to 1, and the transaction behavior can be set to 0 if it is not fraudulent. The transaction location can be represented by an administrative code, where the administrative code is a hierarchical six-digit Arabic numeral representing the name of the province (autonomous region, municipality directly under the central government), region (city, state, league), county (district, city, flag) of my country, so that the parameter values corresponding to the independent variable and the dependent variable are all numerical data, so as to calculate the correlation coefficient.
[0068] It should be noted that the above two correlation coefficients are used to characterize the correlation between the independent variable and the dependent variable. The larger the absolute value of the correlation coefficient, the stronger the correlation between the independent variable and the dependent variable, that is, the greater the influence of the independent variable on the dependent variable. For example, in the inspection project, the correlation coefficient between the independent variable red blood cell distribution width and the dependent variable whether the patient has disease A is large, indicating that the red blood cell distribution width has a greater influence on whether the patient has disease A; or, the correlation coefficient between the independent variable transaction time and the dependent variable fraudulent behavior is large, indicating that the transaction time has a greater influence on determining whether the transaction behavior is fraudulent.
[0069] For ease of understanding, the Pearson correlation coefficient and the Spearman correlation coefficient are calculated based on the parameter values of the independent variables and the dependent variables. The dependent variable is whether the transaction behavior is fraudulent, and the independent variables are the transaction time, transaction amount and transaction location. As shown in Table 1, multiple transaction data can be obtained, and each transaction data includes a dependent variable and multiple independent variables.
[0070]
[0071] As shown in Table 1, multiple transaction data are obtained, and each independent variable and dependent variable in each transaction data has a corresponding parameter value. When calculating the correlation coefficient between the independent variable and the dependent variable, the correlation coefficient is calculated using a column of parameter values corresponding to the independent variable and a column of parameter values corresponding to the dependent variable. The calculation of the Pearson correlation coefficient and the Spearman correlation coefficient will be explained in conjunction with Table 1.
[0072] (I) Calculation of Pearson correlation coefficient
[0073] In specific implementation, the Pearson correlation coefficient between the independent variable and the dependent variable can be calculated using formula (1):
[0074]
[0075] Where r is the Pearson correlation coefficient between the independent variable xi and the dependent variable y; N is the number of parameter values corresponding to the independent variable xi, xi j is the jth parameter value corresponding to the independent variable xi, y j is the jth parameter value corresponding to the dependent variable y.
[0076] Taking Table 1 as an example, i = 1, 2 and 3, N = 3. When calculating the correlation coefficient r between the independent variable x1 and the dependent variable y, the three parameter values corresponding to x1 and the three parameter values corresponding to y are substituted into formula (1) to calculate the Pearson correlation coefficient r between x1 and y. Similarly, the independent variables x2 and x3 are substituted into the above formula respectively to calculate the Pearson correlation coefficient r between them and the dependent variable.
[0077] (II) Calculation of Spearman correlation coefficient
[0078] In specific implementation, the Spearman correlation coefficient between the independent variable and the dependent variable can be calculated using formula (2):
[0079]
[0080] Where ρ is the Spearman correlation coefficient between the independent variable xi and the dependent variable y, N is the number of parameter values corresponding to the independent variable xi, and xi j is the jth parameter value corresponding to the independent variable xi, yj is the jth parameter value corresponding to the dependent variable y, is the average value of the parameter value corresponding to xi, is the average value of the corresponding parameter of y.
[0081] Taking Table 1 as an example, i = 1, 2 and 3, N = 3. When calculating the correlation coefficient r between the independent variable x1 and the dependent variable y, first calculate the average value of the three parameter values corresponding to x1 and the average value of the three parameter values corresponding to y, and then substitute them into formula (2) to calculate the Spearman correlation coefficient ρ between x1 and y. Similarly, substitute the independent variables x2 and x3 into the above formula respectively to calculate the Spearman correlation coefficient ρ between them and the dependent variable.
[0082] Through the above two calculation formulas, the Pearson correlation coefficient and the Spearman correlation coefficient between the independent variable and the dependent variable can be determined, and then S102 is executed according to the above two correlation coefficients.
[0083] S102: Determine the correlation parameters between the independent variable and the dependent variable based on the Pearson correlation coefficient and the Spearman correlation coefficient.
[0084] In this embodiment, the Pearson correlation coefficient and the Spearman correlation coefficient are used to calculate the correlation parameter between the independent variable and the dependent variable, and the correlation parameter is greater than or equal to the first value and less than or equal to the second value, wherein, if the Pearson correlation coefficient and the Spearman correlation coefficient are not equal, the first value is the smaller value of the Pearson correlation coefficient and the Spearman correlation coefficient, and the second value is the larger value of the Pearson correlation coefficient and the Spearman correlation coefficient, if the Pearson correlation coefficient and the Spearman correlation coefficient are equal, the first value and the second value are the Pearson correlation coefficient or the Spearman correlation coefficient.
[0085] That is, in the embodiment of the present application, when the Pearson correlation coefficient and the Spearman correlation coefficient are not equal, the correlation parameter between the independent variable and the dependent variable is between the Pearson correlation coefficient and the Spearman correlation coefficient; when the Pearson correlation coefficient and the Spearman correlation coefficient are equal, the correlation parameter between the independent variable and the dependent variable is equal to the Pearson correlation coefficient or the Spearman correlation coefficient.
[0086] Regarding the use of the Pearson correlation coefficient and the Spearman correlation coefficient to calculate the correlation parameters between the independent variable and the dependent variable, an embodiment of the present application provides a calculation method, which specifically includes: multiplying the Pearson correlation coefficient and the Spearman correlation coefficient to obtain a third value; adding the Pearson correlation coefficient and the Spearman correlation coefficient to obtain a fourth value; dividing the third value by the fourth value and then multiplying the result by 2 to obtain a fifth value; determining the correlation parameter between the independent variable and the dependent variable as the fifth value.
[0087] To understand the above calculation method, please refer to formula (3):
[0088]
[0089] Among them, r is the Pearson correlation coefficient, ρ is the Spearman correlation coefficient, ρ*r is the third value, ρ+r is the fourth value, and Coff is the fifth value, that is, the correlation parameter between the independent variable and the dependent variable.
[0090] After obtaining the Pearson correlation coefficient and the Spearman correlation coefficient between the independent variable and the dependent variable through S101, the two correlation coefficients are substituted into formula (3) to calculate the correlation parameters between the independent variable and the dependent variable.
[0091] In this embodiment, since the calculated correlation parameter is between the Pearson correlation coefficient and the Spearman correlation coefficient, it can characterize the correlation between the independent variable and the dependent variable, so that even if the user is not clear about the correlation relationship between the analyzed data, the correlation between the data can be determined.
[0092] The following will explain in conjunction with the accompanying drawings how the correlation parameters can be used to characterize the correlation between the independent variable and the dependent variable.
[0093] See Figure 2(a). The discrete points in the figure represent the data of a certain independent variable and dependent variable collected. It can be seen from the figure that there is a linear relationship between the independent variable and the dependent variable. The Pearson correlation coefficient is calculated to be 1 and the Spearman correlation coefficient is 1. Substituting the above two correlation coefficients into formula (3), the correlation parameter Coff value is 1. Since the larger the absolute value of the Pearson correlation coefficient, the stronger the association between the two data, when the Pearson correlation coefficient is 1, it indicates that the independent variable and the dependent variable are linearly strongly correlated. Since the coff value is also 1, it can be said that there is a strong correlation between the independent variable and the dependent variable.
[0094] See Figure 2(b). The discrete points in the figure represent the data of a certain independent variable and dependent variable collected, and the straight line represents the change trend. The change trend can also be reflected in the correlation coefficient. When the correlation coefficient is positive, it indicates that the dependent variable increases with the increase of the independent variable. When the correlation coefficient is negative, it indicates that the dependent variable decreases with the increase of the independent variable. The straight line in Figure 2(b) is an upward trend. There is a nonlinear relationship between the independent variable and the dependent variable. The calculated Pearson correlation coefficient is 0.851, and the Spearman correlation coefficient is 1. Substituting the above two correlation coefficients into formula (3), the correlation parameter coff value is 0.92. Since the larger the absolute value of the Spearman correlation coefficient, the stronger the correlation between the two data. The Spearman correlation coefficient of the independent variable and the dependent variable in Figure 2(b) is 1, indicating that the independent variable and the dependent variable are strongly nonlinearly correlated. However, since the calculated coff value of 0.92 is also large, second only to 1, it can also represent that the independent variable and the dependent variable are strongly correlated.
[0095] See Figure 2(c). It can be seen from the figure that there is a nonlinear relationship between the independent variable and the dependent variable. The calculated Pearson correlation coefficient is -0.093, and the Spearman correlation coefficient is -0.093. Substituting the above two correlation coefficients into formula (3), the correlation parameter coff value is -0.093, where the negative sign indicates that the dependent variable decreases as the independent variable increases. Since the absolute value of the calculated Spearman correlation coefficient is small, it indicates that the correlation between the independent variable and the dependent variable is small. Since the calculated correlation parameter value is also small, it can also be characterized as a weak correlation between the independent variable and the dependent variable.
[0096] See Figure 2(d). It can be seen from the figure that there is a linear relationship between the independent variable and the dependent variable. The calculated Pearson correlation coefficient is -1, and the Spearman correlation coefficient is -1. Substituting the above two correlation coefficients into formula (3), the correlation parameter Coff value is -1. Since the larger the absolute value of the Pearson correlation coefficient, the stronger the association between the two data, when the Pearson correlation coefficient is -1, it indicates that the independent variable and the dependent variable are linearly strongly correlated. Since the coff value is also -1, it can be said that there is a strong correlation between the independent variable and the dependent variable.
[0097] Refer to Figure 2(e). It can be seen from the figure that there is a nonlinear relationship between the independent variable and the dependent variable. The calculated Pearson correlation coefficient is -0.799 and the Spearman correlation coefficient is -1. Substituting the above two correlation coefficients into formula (3), the correlation parameter coff value is -0.888. Since the larger the absolute value of the Spearman correlation coefficient, the stronger the correlation between the two data, the Spearman correlation coefficient between the independent variable and the dependent variable in Figure 2(e) is -1, indicating that the independent variable and the dependent variable are strongly nonlinearly correlated. However, since the calculated coff value of -0.88 is also large, second only to -1, it can also represent a strong correlation between the independent variable and the dependent variable.
[0098] From the above analysis, we can see that using the Pearson correlation coefficient and the Spearman correlation coefficient to calculate the correlation parameters between the independent variable and the dependent variable can take into account both linearity and nonlinearity, and can reflect the correlation between the independent variable and the dependent variable. This allows users to determine the correlation between the data without having to choose between the Pearson correlation coefficient and the Spearman correlation coefficient when faced with new data.
[0099] It can be seen from the above description that when a set of new data is obtained, the relevant parameters of the independent variable and the dependent variable in the new data can be calculated using formula (3). However, when the distribution of the collected new data is relatively discrete, the relevant parameters cannot be directly obtained using formula (3), and it is necessary to further judge the difference between the Pearson correlation coefficient and the Spearman correlation coefficient to determine the relevant parameters of the independent variable and the dependent variable in the new data according to the judgment result, specifically, when the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is greater than the first threshold, the relevant parameter between the independent variable and the dependent variable is determined to be the second value; when the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is less than or equal to the first threshold, the relevant parameter between the independent variable and the dependent variable is determined to be the fifth value.
[0100] In this embodiment, the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is calculated, and it is determined whether the difference is greater than a first preset threshold value. When the difference is greater than the first preset threshold value, the correlation parameter between the independent variable and the dependent variable is the larger value of the Pearson correlation coefficient and the Spearman correlation coefficient; when the difference is not greater than the first preset threshold value, the correlation parameter between the independent variable and the dependent variable is the coff value obtained by using formula (3). The first preset threshold value can usually be set to 0.5. In specific implementation, it can be set according to actual application conditions. This embodiment does not limit the setting of the first preset threshold value.
[0101] From the above description, it can be seen that the embodiment of the present application can simultaneously calculate the Pearson correlation coefficient and the Spearman correlation coefficient between two groups of data of the independent variable and the dependent variable, and then use the calculated Pearson correlation coefficient and Spearman correlation coefficient to determine a new correlation parameter to characterize the correlation between the independent variable and the dependent variable. The value of the correlation parameter is between the Pearson correlation coefficient and the Spearman correlation coefficient. The correlation between the independent variable and the dependent variable is characterized by the correlation parameter. There is no need to select from the Pearson correlation coefficient and the Spearman correlation coefficient. Even if it is not clear what kind of correlation relationship the analyzed data has, the correlation between the data can be determined.
[0102] In practical applications, after using the above-mentioned method embodiment to calculate the correlation parameters between the independent variable and the dependent variable in the data set, it is also possible to select a characteristic independent variable that can characterize the dependent variable from multiple independent variables. The characteristic independent variable is an independent variable that has a greater impact on the change of the dependent variable. Based on this, the embodiment of the present application provides a method for selecting characteristic independent variables, specifically, determining the independent variable whose correlation parameter between the independent variable and the dependent variable is greater than the second threshold as the characteristic independent variable.
[0103] In this embodiment, it is first determined whether the correlation parameter between the independent variable and the dependent variable calculated by the above method is greater than the second preset threshold value. If it is greater than, the corresponding independent variable is determined as a characteristic independent variable. For example, the correlation parameter between x1 and y is 0.85, the correlation parameter between x2 and y is 0.78, and the correlation parameter between x3 and y is 0.56. The second preset threshold value is 0.7, then x1 and x2 are characteristic independent variables.
[0104] Among them, the second preset value can be set with reference to the corresponding relationship between the Pearson correlation coefficient and the strength of association. When the Pearson correlation coefficient is in [0.8, 1], it indicates that the two data are extremely strongly correlated; when it is in [0.6, 0.8], it indicates that the two data are strongly correlated; when it is in [0.4, 0.6], it indicates that the two data are moderately correlated; when it is in [0.2, 0.4], it indicates that the two data are weakly correlated; when it is in [0, 0.2], it indicates that the two data are extremely weakly correlated or uncorrelated. Since the selected feature independent variable needs to be strongly correlated with the dependent variable, the second preset threshold can be set to 0.6. When the correlation parameter between a certain independent variable and the dependent variable is greater than 0.6, it is determined as a feature independent variable.
[0105] It should be noted that the second preset threshold may also be set in other ways, and this embodiment does not limit the setting of the second preset threshold.
[0106] In addition, when selecting feature independent variables, the selected feature independent variables must not only satisfy the strong correlation with the dependent variable, but also satisfy the weak correlation between the feature independent variables, that is, the feature independent variables cannot be strongly correlated. Therefore, after determining the feature independent variables, it is also necessary to determine whether each feature independent variable is strongly correlated. When the selected feature independent variables are strongly correlated, the strong correlation between the feature independent variables needs to be removed.
[0107] Based on this, an embodiment of the present application provides a method for determining whether there is a strong correlation between feature independent variables and removing the strong correlation between feature independent variables. The method will be described below with reference to the accompanying drawings.
[0108] See also Figure 3 , which is a method for removing strong correlations between feature independent variables provided by an embodiment of the present application, such as Figure 3 As shown, the method may include:
[0109] S301: Establish a linear equation.
[0110] In this example, a linear equation is established for the acquired characteristic independent variables and dependent variables. One end of the linear equation is the dependent variable, and the other end is the sum of each characteristic data item. Each characteristic data item is the product of a characteristic independent variable and the regression coefficient corresponding to the characteristic independent variable. The characteristic independent variables in each characteristic data item are different, and the number of characteristic data items is the same as the number of characteristic independent variables.
[0111] In practical applications, each feature independent variable corresponds to its own regression coefficient. Each feature independent variable is multiplied by its corresponding regression coefficient and then added to form the other side of the linear equation. For example, there are 7 independent variables x1, x2, x3, x4, x5, x6, x7. The feature independent variables x1, x3, x4x5, x7 are selected by the above method. Then the established linear equation can be specifically expressed as y=a1*x1+a3*x3+a4*x4+a5*x5+a7*x7, where a1, a3, a4, a5 and a7 are the regression coefficients corresponding to the feature independent variables x1, x3, x4x5, x7 respectively.
[0112] S302: Substitute the standardized parameter values of the feature independent variables and the standardized parameter values of the dependent variables into the linear equation to solve and obtain the regression coefficients corresponding to the respective feature independent variables.
[0113] In this example, in order to eliminate the influence of different dimensions corresponding to different characteristic independent variables on the subsequent calculation results, the parameter values corresponding to the characteristic independent variables and the parameter values corresponding to the dependent variable can be standardized first, and then the standardized parameter values can be substituted into the above linear equation to calculate the regression coefficient corresponding to each characteristic independent variable.
[0114] In specific implementation, the 0-1 standardization method can be used to normalize the parameter values of the feature independent variables and the parameter values of the dependent variables. Among them, the 0-1 standardization is also called deviation standardization, which is a linear transformation of the parameter value so that the result falls in the [0,1] interval. The conversion function is:
[0115]
[0116] Among them, x* is the standardized parameter value, x is a parameter value corresponding to a certain feature independent variable or dependent variable, max is the maximum value of all parameter values corresponding to a certain feature independent variable or dependent variable, and min is the minimum value of all parameter values corresponding to a certain feature independent variable or dependent variable.
[0117] For example, in Table 1, the transaction amount is the feature independent variable, and the three parameter values corresponding to the transaction amount are x20, x21, and x22. A maximum value and a minimum value are determined from the above three parameter values, and then the above conversion function is substituted to standardize each parameter value to obtain the standardized parameter value.
[0118] It should be noted that other normalization methods may also be used for normalization processing, such as min-max normalization, and the embodiments of the present application do not limit the specific method of normalization processing.
[0119] In addition, since the transaction locations in Table 1 are represented by administrative codes consisting of six Arabic numerals, the administrative codes can be regarded as specific parameter values when performing standardization processing, and then the above-mentioned conversion function can be used for standardization processing.
[0120] In the specific implementation, multiple parameter values of the standardized feature independent variables and multiple parameter values of the dependent variables are substituted into the thread equation to form multiple linear equations, and then the multiple linear equations are solved to obtain the regression coefficient corresponding to each feature independent variable.
[0121] S303: Obtain a first sorting result of the feature independent variables according to the sorting of the regression coefficients corresponding to the feature independent variables.
[0122] In this example, the obtained regression coefficients are sorted, so as to obtain the first sorting result of the feature independent variables according to the sorting result of the regression coefficients. In specific implementation, the sorting can be performed in a descending order or in a descending order.
[0123] For example, sort a1, a3, a4, a5, and a7 in ascending order. The sorting result is a1 < a3 < a5 < a7 < a4. Then the first sorting result of the characteristic independent variables is x1, x3, x5, x7, x4. Or, sort a1, a3, a4, a5, and a7 in descending order. The sorting result is a4 > a7 > a5 > a3 > a1. Then the first sorting result of the characteristic independent variables is x4, x7, x5, x3, x1.
[0124] S304: Obtain the second sorting result of the characteristic independent variables according to the sorting of the correlation parameters between each characteristic independent variable and the dependent variable.
[0125] In this example, sort the correlation parameters between each characteristic independent variable and the dependent variable, and thus obtain the second sorting result of the characteristic independent variables according to the sorting result of the correlation coefficients. When specifically implemented, it can be sorted in descending order or in ascending order.
[0126] For example, the correlation parameters between the characteristic independent variables x1, x3, x4, x5, x7 and the dependent variable are C1, C3, C4, C5, C7 respectively. Sort C1, C3, C4, C5, C7 in ascending order. The sorting result is C1 < C3 < C4 < C7 < C5. Then the second sorting result of the characteristic independent variables is x1, x3, x4, x7, x5. Or, sort C1, C3, C4, C5, C7 in descending order. The sorting result is C5 > C7 > C4 > C3 > C1. Then the second sorting result of the characteristic independent variables is x5, x7, x4, x3, x1.
[0127] S305: When both the first sorting result and the second sorting result of the characteristic independent variables are in ascending order, if the second sorting result of the target characteristic independent variable is greater than the first sorting result of the target characteristic independent variable, delete the target characteristic independent variable from the characteristic independent variables. The target characteristic independent variable is any one of the characteristic independent variables.
[0128] After obtaining the two sorting results of the characteristic independent variables through S303 and S304, when both the first sorting result and the second sorting result of the characteristic independent variables are in ascending order, for each characteristic independent variable, determine whether the order of the characteristic independent variable in the second sorting result is greater than that in the first sorting result. If it is greater, it indicates that there is a strong correlation between this characteristic independent variable and other characteristic independent variables, and then delete this characteristic independent variable.
[0129] For example, when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from small to large, the feature independent variable x5 is ranked fifth in the second sorting result, and ranked third in the first sorting result. The fifth is greater than the third, so the feature independent variable x5 is deleted. For the feature independent variables x1, x3, x4 and x7, their ranking in the second sorting result is not greater than that in the first sorting result, indicating that there is no strong correlation between the above feature independent variables and no need to delete them.
[0130] S306: When the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from large to small, if the second sorting result of the target feature independent variable is smaller than the first sorting result of the target feature independent variable, the target feature independent variable is deleted from the feature independent variable.
[0131] After obtaining two sorting results about the feature independent variables through S303 and S304, when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from large to small, for each feature independent variable, it is determined whether the order of the feature independent variable in the second sorting result is smaller than the order in the first sorting result. If it is smaller, it indicates that there is a strong correlation between the feature independent variable and other feature independent variables, and the feature independent variable is deleted.
[0132] For example, when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from large to small, the feature independent variable x5 is ranked first in the second sorting result, and ranked third in the first sorting result. The first is smaller than the third, so the feature independent variable x5 is deleted. For the feature independent variables x1, x3, x4 and x7, their ranking in the second sorting result is not smaller than that in the first sorting result, indicating that there is no strong correlation between the above feature independent variables and no need to delete them.
[0133] It should be noted that when a feature independent variable is deleted from multiple feature independent variables, the second sorting results and the first sorting results of the remaining feature independent variables can be obtained again, and the second sorting result and the first sorting result of each feature independent variable can be judged again until the second sorting result and the first sorting result of each feature independent variable are consistent. The above judgment is terminated to obtain feature independent variables that are not strongly correlated with each other.
[0134] Through the above method, it is possible to judge whether there is a strong correlation between the acquired feature independent variables. If there is, the feature independent variables with strong correlation are removed to obtain feature independent variables that are not strongly correlated with each other, so as to use the above feature independent variables to characterize the dependent variable.
[0135] Based on the above method embodiments, the present application also provides a device for determining data correlation, which will be described below in conjunction with the accompanying drawings.
[0136] See also Figure 4 , which is a structural diagram of a device for determining data correlation provided in an embodiment of the present application, such as Figure 4 As shown, the device may include:
[0137] A first calculation unit 401 is used to calculate the Pearson correlation coefficient and the Spearman correlation coefficient between the independent variable and the dependent variable according to the parameter value of the independent variable and the parameter value of the dependent variable, and the independent variable has a corresponding relationship with the dependent variable;
[0138] The first determination unit 402 is used to determine the correlation parameter between the independent variable and the dependent variable according to the Pearson correlation coefficient and the Spearman correlation coefficient, the correlation parameter between the independent variable and the dependent variable is greater than or equal to a first value and less than or equal to a second value. If the Pearson correlation coefficient and the Spearman correlation coefficient are not equal, the first value is the smaller value of the Pearson correlation coefficient and the Spearman correlation coefficient, and the second value is the larger value of the Pearson correlation coefficient and the Spearman correlation coefficient. If the Pearson correlation coefficient and the Spearman correlation coefficient are equal, the first value and the second value are the Pearson correlation coefficient or the Spearman correlation coefficient.
[0139] In some possible implementations, the first determining unit includes:
[0140] A first calculation subunit, configured to multiply the Pearson correlation coefficient by the Spearman correlation coefficient to obtain a third value;
[0141] A second calculation subunit, configured to add the Pearson correlation coefficient to the Spearman correlation coefficient to obtain a fourth value;
[0142] a third calculating subunit, configured to divide the third value by the fourth value and then multiply the result by 2 to obtain a fifth value;
[0143] The first determining subunit is used to determine that the correlation parameter between the independent variable and the dependent variable is the fifth value.
[0144] In some possible implementations, the first determining unit includes:
[0145] a second determining subunit, configured to determine that the correlation parameter between the independent variable and the dependent variable is the second value when the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is greater than a first threshold;
[0146] The third determining subunit is used to determine that the correlation parameter between the independent variable and the dependent variable is the fifth value when the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is less than or equal to the first threshold.
[0147] In some possible implementations, the device further includes:
[0148] The second determining unit is used to determine the independent variable whose correlation parameter between the independent variable and the dependent variable is greater than a second threshold as a characteristic independent variable.
[0149] In some possible implementations, the device further includes:
[0150] An establishing unit, used for establishing a linear equation, wherein one end of the linear equation is the dependent variable, and the other end of the linear equation is the sum of each characteristic data item, each of the characteristic data items is the product of a characteristic independent variable and a regression coefficient corresponding to the characteristic independent variable, the characteristic independent variables in each of the characteristic data items are different, and the number of the characteristic data items is the same as the number of the characteristic independent variables;
[0151] A second calculation unit is used to bring the standardized parameter value of the feature independent variable and the standardized parameter value of the dependent variable into the linear equation to solve and obtain the regression coefficient corresponding to each of the feature independent variables;
[0152] A first sorting unit, configured to obtain a first sorting result of the feature independent variables according to the sorting of the regression coefficients corresponding to the feature independent variables;
[0153] A second sorting unit, configured to obtain a second sorting result of the feature independent variables according to the sorting of correlation parameters between each of the feature independent variables and the dependent variable;
[0154] A first deleting unit is configured to, when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from small to large, delete the target feature independent variable from the feature independent variable if the second sorting result of the target feature independent variable is greater than the first sorting result of the target feature independent variable, wherein the target feature independent variable is any one of the feature independent variables;
[0155] The second deleting unit is used to delete the target feature independent variable from the feature independent variable when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from large to small and if the second sorting result of the target feature independent variable is smaller than the first sorting result of the target feature independent variable.
[0156] It should be noted that the specific implementation of each module or unit in this embodiment can be found in Figure 1 and Figure 3 The implementation of the method will not be described in detail in this embodiment.
[0157] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the above-mentioned method for determining data correlation.
[0158] An embodiment of the present application also provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the above-mentioned method for determining data correlation.
[0159] It can be seen from the above embodiments that the embodiments of the present application simultaneously calculate the Pearson correlation coefficient and the Spearman correlation coefficient between two groups of data of the independent variable and the dependent variable, and then use the calculated Pearson correlation coefficient and the Spearman correlation coefficient to determine a new correlation parameter to characterize the correlation between the independent variable and the dependent variable. The value of the correlation parameter is between the Pearson correlation coefficient and the Spearman correlation coefficient. The correlation between the independent variable and the dependent variable is characterized by the correlation parameter. There is no need to select from the Pearson correlation coefficient and the Spearman correlation coefficient. Even if it is not clear what kind of correlation relationship the analyzed data has, the correlation between the data can be determined.
[0160] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0161] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "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 objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural 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", where a, b, c can be single or multiple.
[0162] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0163] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0164] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for determining data relevance, characterized in that: The method comprises: According to the parameter value of the independent variable and the parameter value of the dependent variable, the Pearson correlation coefficient and the Spearman correlation coefficient between the independent variable and the dependent variable are calculated, and the independent variable and the dependent variable have a corresponding relationship; the dependent variable is whether the transaction behavior is a fraudulent behavior, and the independent variable is the transaction attribute of the transaction behavior, and the transaction attribute includes transaction time, transaction amount and transaction location; Determine the correlation parameter between the independent variable and the dependent variable according to the Pearson correlation coefficient and the Spearman correlation coefficient, the correlation parameter between the independent variable and the dependent variable is greater than or equal to a first value and less than or equal to a second value, if the Pearson correlation coefficient and the Spearman correlation coefficient are not equal, the first value is the smaller value of the Pearson correlation coefficient and the Spearman correlation coefficient, the second value is the larger value of the Pearson correlation coefficient and the Spearman correlation coefficient, if the Pearson correlation coefficient and the Spearman correlation coefficient are equal, the first value and the second value are the Pearson correlation coefficient or the Spearman correlation coefficient; The independent variable whose correlation parameter between the independent variable and the dependent variable is greater than the second threshold is determined as a characteristic independent variable; when the independent variable is a transaction attribute of a transaction behavior, the characteristic independent variable is a transaction attribute that affects the judgment of whether the transaction behavior is a fraudulent behavior; Determining the correlation parameter between the independent variable and the dependent variable according to the Pearson correlation coefficient and the Spearman correlation coefficient includes: Multiplying the Pearson correlation coefficient by the Spearman correlation coefficient to obtain a third value; Adding the Pearson correlation coefficient to the Spearman correlation coefficient to obtain a fourth value; Divide the third value by the fourth value and then multiply by 2 to obtain a fifth value; Determine the correlation parameter between the independent variable and the dependent variable as the fifth value; Determining the correlation parameter between the independent variable and the dependent variable according to the Pearson correlation coefficient and the Spearman correlation coefficient includes: When the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is greater than a first threshold, determining that the correlation parameter between the independent variable and the dependent variable is the second value; When the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is less than or equal to the first threshold, the correlation parameter between the independent variable and the dependent variable is determined to be the fifth value.
2. The method according to claim 1, characterized in that The method further comprises: Establish a linear equation, wherein one end of the linear equation is the dependent variable, and the other end of the linear equation is the sum of each characteristic data item, each of the characteristic data items is the product of a characteristic independent variable and a regression coefficient corresponding to the characteristic independent variable, the characteristic independent variables in each of the characteristic data items are different, and the number of the characteristic data items is the same as the number of the characteristic independent variables; Substituting the standardized parameter values of the feature independent variables and the standardized parameter values of the dependent variables into the linear equation, and solving to obtain the regression coefficients corresponding to the respective feature independent variables; According to the sorting of the regression coefficients corresponding to the respective feature independent variables, a first sorting result of the feature independent variables is obtained; According to the sorting of the correlation parameters between each of the feature independent variables and the dependent variable, obtaining a second sorting result of the feature independent variables; When the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from small to large, if the second sorting result of the target feature independent variable is greater than the first sorting result of the target feature independent variable, the target feature independent variable is deleted from the feature independent variables, and the target feature independent variable is any one of the feature independent variables; When the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from large to small, if the second sorting result of the target feature independent variable is smaller than the first sorting result of the target feature independent variable, the target feature independent variable is deleted from the feature independent variables.
3. A device for determining data relevance, characterized in that: The device comprises: a first calculation unit, for calculating a Pearson correlation coefficient and a Spearman correlation coefficient between the independent variable and the dependent variable according to a parameter value of the independent variable and a parameter value of the dependent variable, wherein the independent variable and the dependent variable have a corresponding relationship; the dependent variable is whether the transaction behavior is a fraudulent behavior, and the independent variable is a transaction attribute of the transaction behavior, wherein the transaction attribute includes a transaction time, a transaction amount, and a transaction location; A first determination unit is used to determine a correlation parameter between the independent variable and the dependent variable according to the Pearson correlation coefficient and the Spearman correlation coefficient, the correlation parameter between the independent variable and the dependent variable is greater than or equal to a first value and less than or equal to a second value, if the Pearson correlation coefficient and the Spearman correlation coefficient are not equal, the first value is the smaller value of the Pearson correlation coefficient and the Spearman correlation coefficient, and the second value is the larger value of the Pearson correlation coefficient and the Spearman correlation coefficient, if the Pearson correlation coefficient and the Spearman correlation coefficient are equal, the first value and the second value are the Pearson correlation coefficient or the Spearman correlation coefficient; A second determination unit is used to determine the independent variable whose correlation parameter between the independent variable and the dependent variable is greater than a second threshold as a characteristic independent variable; when the independent variable is a transaction attribute of a transaction behavior, the characteristic independent variable is a transaction attribute that affects the judgment of whether the transaction behavior is a fraudulent behavior; The first determining unit includes: A first calculation subunit, configured to multiply the Pearson correlation coefficient by the Spearman correlation coefficient to obtain a third value; A second calculation subunit, configured to add the Pearson correlation coefficient to the Spearman correlation coefficient to obtain a fourth value; a third calculating subunit, configured to divide the third value by the fourth value and then multiply the result by 2 to obtain a fifth value; A first determining subunit, configured to determine that a correlation parameter between the independent variable and the dependent variable is the fifth value; The first determining unit includes: a second determining subunit, configured to determine that the correlation parameter between the independent variable and the dependent variable is the second value when the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is greater than a first threshold; The third determining subunit is used to determine that the correlation parameter between the independent variable and the dependent variable is the fifth value when the absolute value of the difference between the Pearson correlation coefficient and the Spearman correlation coefficient is less than or equal to the first threshold.
4. The device according to claim 3, characterized in that The device also includes: An establishing unit, used for establishing a linear equation, wherein one end of the linear equation is the dependent variable, and the other end of the linear equation is the sum of each characteristic data item, each of the characteristic data items is the product of a characteristic independent variable and a regression coefficient corresponding to the characteristic independent variable, the characteristic independent variables in each of the characteristic data items are different, and the number of the characteristic data items is the same as the number of the characteristic independent variables; A second calculation unit is used to bring the standardized parameter value of the feature independent variable and the standardized parameter value of the dependent variable into the linear equation to solve and obtain the regression coefficient corresponding to each of the feature independent variables; A first sorting unit, configured to obtain a first sorting result of the feature independent variables according to the sorting of the regression coefficients corresponding to the feature independent variables; A second sorting unit, configured to obtain a second sorting result of the feature independent variables according to the sorting of correlation parameters between each of the feature independent variables and the dependent variable; A first deleting unit is configured to, when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from small to large, delete the target feature independent variable from the feature independent variable if the second sorting result of the target feature independent variable is greater than the first sorting result of the target feature independent variable, wherein the target feature independent variable is any one of the feature independent variables; The second deleting unit is used to delete the target feature independent variable from the feature independent variable when the first sorting result of the feature independent variable and the second sorting result of the feature independent variable are both sorted from large to small and if the second sorting result of the target feature independent variable is smaller than the first sorting result of the target feature independent variable.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method for determining data relevance according to any one of claims 1 to 2.
Citation Information
Patent Citations
Video picture quality subjective evaluation method and system
CN103458267A
Risk evaluation method and system
CN107025596A
Determination method and device of average index of data volume
CN107656903A