Tax data risk detection method and system based on data mining
Through the combination of improved Lonely Forest algorithm, XGBoost algorithm, giant armadillo optimization algorithm and least squares support vector machine, the problems of data redundancy and slow detection in traditional tax data risk detection methods are solved, and more efficient and accurate risk detection is achieved.
Patent Information
- Application Number
- CN202411807682.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-01
Smart Images

Figure CN119741138A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of risk detection, and in particular to a tax data risk detection method and system based on data mining. Background Art
[0002] Chinese patent cN112861141B discloses a data export security detection method and detection system, the method specifically includes, obtaining the static features and configuration information of the export tool, wherein the static features of the export tool include the executable file name and the executable file size, and the configuration information of the export tool includes the data source information to be exported, etc.; detecting whether the export tool has risks, when there are no risks, obtaining a filled export process security assessment matrix, outputting the security detection result according to the filled export process security assessment matrix, when the security detection result is yes, sampling and collecting the data generated during the operation of the export tool, obtaining the sampling and collection result, using the sampling and collection result to compare with the static data of the export tool, obtaining the comparison result, and completing the security detection. The invention does not clarify the redundancy of the data to be detected, and the data detection speed is slow.
[0003] Traditional data risk detection methods usually have room for improvement in reducing data complexity due to the large amount of redundant data in the data processing process. At the same time, traditional tax data risk detection methods do not use high-tech technologies such as neural networks, and do not establish models that can quickly process tax data, resulting in slow risk detection speed, untimely risk warnings, and failure to achieve the purpose of risk detection. Summary of the invention
[0004] In response to the problems in the related technology, the present invention provides a tax data risk detection method and system based on data mining to overcome the above-mentioned technical problems existing in the existing related technology.
[0005] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:
[0006] The present invention is a tax data risk detection method based on data mining, comprising the following steps:
[0007] S1. Obtain tax-related indicators to obtain an initial tax data set, perform data quality evaluation on the initial tax data set to obtain a quality score, identify tax data with low quality scores based on an improved lonely forest algorithm and perform indicator decomposition to obtain a processed tax data set;
[0008] S2. Build a decision tree based on the XGBoost algorithm, form an initial XGBoost prediction model based on the decision tree, and calculate the risk rate of the initial XGBoost prediction model;
[0009] S3. Introducing the giant armadillo optimization algorithm, optimizing the number and number of layers of decision trees according to the risk rate of the initial XGBoost prediction model, obtaining an optimized decision tree, establishing a final XGBoost prediction model, and outputting a set of tax data prediction values according to the processed tax data set;
[0010] S4. Train the least squares support vector machine to obtain a least squares support vector machine model, use the least squares support vector machine model to detect whether there is a risk in the tax data prediction value set, obtain a risk detection result, and complete the tax data risk detection.
[0011] The invention first obtains the initial tax data set, evaluates the data quality based on the improved lonely forest algorithm, and decomposes the tax data with low quality scores into indicators; compared with the traditional lonely forest algorithm, this method can accurately determine the dividing line between low quality scores and high quality scores by introducing the quartile method, improves the algorithm recognition ability, and has a good cleaning effect; secondly, the XGBoost algorithm is used to build a decision tree, and then the decision tree is used to form an initial XGBoost prediction model, and the risk rate is used to describe the accuracy of the prediction model; the prediction model obtains a strong learning machine through the decision tree, which can independently repair missing values, reduce the impact of data errors, and realize efficient processing of large-scale data; and the giant armadillo optimization algorithm is used to optimize the initial XGBoost prediction model. The number and number of layers of decision trees in the GBoost prediction model are inferred from the accuracy of the prediction model to obtain the number and number of layers of optimized decision trees, generating the final XGBoost prediction model; this method cleverly achieves optimization, improves the stability and performance of the prediction model, and has higher prediction accuracy than traditional prediction models. The algorithm obtains the global optimal solution by simulating the hunting behavior of giant armadillos, and has high search efficiency and optimization ability; finally, the least squares support vector machine is trained to obtain the least squares support vector machine model, and the output results of the prediction model are combined to detect whether there are risks in the tax data, and complete the tax data risk detection; the least squares support vector machine has a faster computing speed than the traditional support vector machine and is suitable for risk assessment detection.
[0012] Preferably, the S1 comprises the following steps:
[0013] S11, obtaining tax-related indicators, the tax-related indicators include tax declaration data, capital flow data, liability data, etc., setting the number of tax-related indicators to m, each tax-related indicator contains n tax data, and obtaining a tax-related indicator tax data set to form an initial tax data set A = {A1, A2, A3, ..., A m}, where A m represents the mth tax-related indicator tax data set, performs data quality evaluation on the initial tax data set, and obtains a quality score set. The specific steps are as follows:
[0014] S111, setting an isolated tree, selecting any tax-related indicator tax data set from the initial tax data set, recorded as a quality inspection data set, selecting a number of quality inspection data from the quality inspection data set and placing them at the root node of the isolated tree, calculating the mean of the quality inspection data at the root node of the isolated tree, recorded as the root node mean, and comparing it with other quality inspection data in the quality inspection data set; when other quality inspection data are greater than the root node mean, placing the corresponding quality inspection data at the right part of the isolated tree, otherwise placing the corresponding quality inspection data at the left part of the isolated tree; until all quality inspection data in the quality inspection data set are processed, or the maximum height of the isolated tree is reached, a processed isolated tree is obtained;
[0015] S112, the node corresponding quality detection data of the processed isolated tree, setting the isolated tree harmonic function to f(a), where a represents the number of nodes of the processed isolated tree, and the average value calculation formula of the isolated tree harmonic function is as follows:
[0016]
[0017] in, represents the average value of the isolated tree harmonic function, and f(a-1) represents the isolated tree harmonic function corresponding to the a-1th quality detection data;
[0018] Traverse the processed isolation tree, count the path length from each node to the root node, record the path length from the ath node to the root node as b(a), and calculate the quality score of each quality detection data in the processed isolation tree in combination with the average value of the isolation tree harmonic function. The calculation formula is as follows:
[0019]
[0020] Among them, B(a) represents the quality score of the a-th quality detection data in the processed isolated tree;
[0021] Calculating the quality scores of the initial tax data sets in sequence to obtain a quality score set;
[0022] S12, set the score upper limit threshold and the score lower limit threshold to ω1 and ω2 respectively, when the quality score in the quality score set is greater than the score upper limit threshold, the corresponding tax data is recorded as having a high quality score, when the quality score in the quality score set is less than the score lower limit threshold, the corresponding tax data is recorded as having a low quality score, when the quality score in the quality score set is greater than or equal to the score lower limit threshold and less than or equal to the score upper limit threshold, the corresponding tax data is recorded as having an unknown quality score; further, use the improved lonely forest algorithm to judge the tax data with unknown quality score, identify the tax data with low quality score and perform index decomposition to obtain the processed tax data set, the specific steps are as follows:
[0023] S121. The tax data with unknown quality scores constitute a set of tax data to be tested. The quality scores corresponding to the set of tax data to be tested are recorded as a set of quality scores to be tested C = {b1, b2, b3, ..., b c}, where b c represents the cth quality score to be detected; the set of quality scores to be detected is divided into four equal parts to obtain equal division points, which are respectively recorded as the first equal division point c1, the second equal division point c2 and the third equal division point c3. The specific steps of the four equal division are as follows:
[0024] S1211. For the second equally divided point, when c is an odd number, c2=b (c+1) / 2 ; When c is an even number, dividing the to-be-detected quality score set into a first quality score set and a second quality score set;
[0025] S1212. For the first and third equally divided points, when c is an even number, the first equally divided point c1 and the third equally divided point c3 are the medians of the first quality score set and the second quality score set, respectively; d is set to represent a constant, and when c is an odd number and c=4d+3, When c is an odd number and c=4d+1, Complete the quartering;
[0026] S122, after the to-be-detected quality score set is divided into four equal parts, the difference between the first and third equal parts is recorded as the quarter-division interval, and the quality score threshold is calculated according to the quarter-division interval, and the calculation formula is as follows:
[0027]
[0028] Among them, α1 and α2 represent the quality score thresholds, represents the quarter interval;
[0029] The quality scores to be detected in the set of quality scores to be detected that are not within the range of [α1, α2] are recorded as low quality scores; the tax data with low quality scores are indexed and decomposed to obtain a processed tax data set.
[0030] This invention uses an improved lonely forest algorithm to evaluate data quality. Compared with the traditional lonely forest algorithm, it improves on it by introducing the quartile method, which can accurately determine the dividing line between low quality scores and high quality scores, thereby improving the algorithm's recognition ability. The tax data with low quality scores can then be decomposed into indicators, achieving a good cleaning effect.
[0031] Preferably, S2 comprises the following steps:
[0032] S21. Re-acquire tax-related indicators from previous years, perform quality evaluation, and obtain a tax sample set of tax-related indicators. Construct a linear regression equation based on the processed tax sample set, set the tax sample risk probability, and when the tax sample risk probability is greater than or equal to 0.5, the result of the linear regression equation is 1; when the tax sample risk probability is less than 0.5, the result of the linear regression equation is 0, and obtain a preliminary prediction result of the tax sample risk;
[0033] For any tax-related indicator tax sample set in the processed tax sample set, the n′th tax sample of the m′th tax-related indicator tax sample set is taken as a critical point, the m′th tax-related indicator tax sample set is divided into a left branch and a right branch according to the critical point, and the information gain of the left branch and the information gain of the right branch are calculated to obtain a local maximum information gain, and the local maximum information gain corresponds to the information gain of the m′th tax-related indicator tax sample set;
[0034] S22, calculate the local information gain of all tax-related indicator tax sample sets in sequence to obtain an information gain set, select the maximum information gain in the information gain set as the vertex of the decision tree, and divide the tax-related indicator tax sample set into the left branch and the right branch of the decision tree according to the maximum information gain to obtain the first layer of the decision tree, and the first layer of the decision tree is processed; further, select the critical point of the first layer of the decision tree to obtain the second layer of the decision tree, until the information gain of the tax-related indicator tax sample set is less than 0 or the decision tree reaches the maximum number of layers, stop dividing, obtain the maximum layer of the decision tree, use all branches of the maximum layer of the decision tree as decision tree leaf nodes, and construct k decision trees;
[0035] S23, the k decision trees form an initial XGBoost (extreme gradient boosting) prediction model, and the initial prediction result of the tax sample risk of the k′th decision tree is set to d k′, and the risk rate of the initial XGBoost prediction model is obtained in turn. The risk rate calculation formula of the k′th tax-related indicator tax sample set in the initial XGBoost prediction model is as follows:
[0036]
[0037] Among them, χ k′ Represents the risk rate of the k′th tax-related indicator tax sample set in the initial XGBoost prediction model.
[0038] The invention constructs a decision tree using the XGBoost algorithm, and then uses the decision tree to form an initial XGBoost prediction model. The prediction model obtains a strong learning machine through the decision tree, which can autonomously repair missing values, reduce the impact of data errors, and achieve efficient processing of large-scale data.
[0039] Preferably, S3 comprises the following steps:
[0040] S31. According to the risk rate of the initial XGBoost prediction model, the risk rate calculation formula of the k′th tax-related indicator tax sample set in the initial XGBoost prediction model is used as the fitness function; the number and number of layers of the decision trees are optimized based on the giant armadillo optimization algorithm. When the fitness function is maximum, it corresponds to the optimal fitness function value. The optimal fitness function value corresponds to the number and number of layers of the optimized decision trees. The specific steps are as follows:
[0041] S311. Assume that there is a giant armadillo population in the search space, the population size of the giant armadillo population is M, the dimension of the giant armadillo individuals in the giant armadillo population is N, each giant armadillo individual is regarded as the number and number of layers of the decision tree, initialize the initial position of the giant armadillo individual in the search space, set the upper bound of the search space to p′, the lower bound of the search space to p″, e1 represents a random number between [0, 1], then the calculation formula for the j-dimensional position D(i, j) of the i-th giant armadillo individual in the giant armadillo population is as follows:
[0042] D(i,j)=p″+e1·(p′-p″);
[0043] Calculate the initial fitness function value corresponding to the position of all giant armadillo individuals in the giant armadillo population;
[0044] S312. In the exploration phase, the giant armadillo population moves toward the termite mound position and compares the fitness function value corresponding to the termite mound position with the initial fitness function value. When the fitness function value corresponding to the termite mound position is less than the initial fitness function value, the corresponding termite mound position is recorded as the candidate termite mound position. The i-th giant armadillo individual in the giant armadillo population updates its position according to the candidate termite mound position, and obtains the new position D′(i, j) of the i-th giant armadillo individual in the giant armadillo population. The calculation formula is as follows:
[0045]
[0046] Among them, e2 represents a random number between [0, 1], and e3 represents a number randomly selected from 1 or 2. represents the candidate termite mound location;
[0047] Set the current number of iterations to q. At the qth iteration, by comparing the fitness function value at the new position of the giant armadillo individual and the position of the giant armadillo individual, the position of the giant armadillo individual is updated to obtain the current optimal fitness function value. The current optimal fitness function value corresponds to the number and number of layers of the current optimal decision tree.
[0048] S313, in the development stage of the giant armadillo population, set e4 to represent a random number between [0, 1], and update the new position of the i-th giant armadillo individual in the giant armadillo population within the search space upper bound and the search space lower bound to obtain the updated position D″(i, j). The specific steps are as follows:
[0049]
[0050] Compare the fitness function value at the updated position with the current optimal fitness function value again, and update the position again, set the maximum number of iterations, and stop iterating when the current number of iterations reaches the maximum number of iterations, and get the final position of the i-th giant armadillo individual in the giant armadillo population. The coordinate values of the final position correspond to the number and number of layers of the optimized decision trees respectively;
[0051] S32. Use the optimized number and number of layers of decision trees to adjust the decision tree, obtain the optimized decision tree, and generate the final XGBoost prediction model; input the processed tax data set into the final XGBoost prediction model, output the tax data prediction value, and obtain the tax data prediction value set.
[0052] This invention uses the giant armadillo optimization algorithm to optimize the number and layers of decision trees in the initial XGBoost prediction model, and obtains the global optimal solution by simulating the hunting behavior of the giant armadillo. It has high search efficiency and optimization ability. It reversely infers the number and layers of optimized decision trees based on the accuracy of the prediction model, cleverly realizes the optimization, improves the stability and performance of the prediction model, and has higher prediction accuracy than traditional prediction models.
[0053] Preferably, S4 comprises the following steps:
[0054] S41, obtaining a new tax data set again, using the new tax data set to train a least squares support vector machine to obtain a least squares support vector machine model, the specific steps are as follows:
[0055] S411, setting the kernel function of the least squares support vector machine to a radial basis function, dividing the new tax data set into a sample training set and a sample test set after quality evaluation and dimension reduction processing, inputting the sample training set into the least squares support vector machine for training until the least squares support vector machine converges, thereby obtaining a trained least squares support vector machine;
[0056] S412, input the sample test set into the trained least squares support vector machine, set an error threshold, and when the output result error is less than the error threshold, stop iteration to obtain a least squares support vector machine model, otherwise adjust the kernel parameter and penalty factor until the output result error is less than the error threshold;
[0057] S42. Use the least squares support vector machine model to detect whether there is a risk in the tax data prediction value set, input the tax data prediction value set into the least squares support vector machine model, output the risk detection result, set the risk threshold, and when the risk detection result is greater than the risk threshold, the tax data is at risk, otherwise the tax data is not at risk, and the tax data risk detection is completed.
[0058] The invention obtains a least squares support vector machine model by training a least squares support vector machine, and detects whether there are risks in tax data in combination with the output results of the prediction model, thereby completing tax data risk detection; the least squares support vector machine has a faster computing speed than the traditional support vector machine and is suitable for risk assessment detection.
[0059] The present invention also discloses a system for tax data risk detection method based on data mining, which specifically includes: a data quality evaluation module, a prediction model establishment module, a prediction model decision tree optimization module and a tax data risk detection module;
[0060] The data quality evaluation module is used to evaluate the data quality of the initial tax data set and decompose the data into indicators;
[0061] The prediction model building module is used to build an initial XGBoost prediction model using a decision tree;
[0062] The prediction model decision tree optimization module is used to optimize the number and number of layers of decision trees in the initial XGBoost prediction model using the giant armadillo optimization algorithm;
[0063] The tax data risk detection module is used to train a least squares support vector machine model to detect whether there is a risk.
[0064] The present invention has the following beneficial effects:
[0065] 1. This invention uses an improved lonely forest algorithm to evaluate data quality. Compared with the traditional lonely forest algorithm, it can accurately determine the dividing line between low quality scores and high quality scores by introducing the quartile method, thereby improving the algorithm's recognition ability and achieving a good cleaning effect.
[0066] 2. The invention constructs a decision tree by using the XGBoost algorithm, and then uses the decision tree to form an initial XGBoost prediction model. The prediction model obtains a strong learning machine through the decision tree, which can autonomously repair missing values, reduce the impact of data errors, and achieve efficient processing of large-scale data.
[0067] 3. The invention uses the giant armadillo optimization algorithm to optimize the number and layers of decision trees in the initial XGBoost prediction model, and reversely infers the number and layers of optimized decision trees based on the accuracy of the prediction model. It cleverly achieves optimization, has high search efficiency and optimization capability, improves the stability and performance of the prediction model, and has higher prediction accuracy than traditional prediction models.
[0068] 4. The invention obtains a least squares support vector machine model by training a least squares support vector machine to complete tax data risk detection; the least squares support vector machine has a faster computing speed than the traditional support vector machine and is suitable for risk assessment detection.
[0069] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the drawings required for describing the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, they can also obtain drawings based on these drawings without paying creative work.
[0071] Figure 1A schematic diagram of the process of tax data risk detection by the tax data risk detection system based on data mining provided by the present invention. DETAILED DESCRIPTION
[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] In the description of the present invention, it is necessary to understand that the terms "opening", "upper", "lower", "top", "middle", "inside" and the like indicating orientation or positional relationship are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the components or elements referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the invention.
[0074] Example 1
[0075] Please refer to Figure 1 The tax data risk detection method based on data mining of the present invention comprises the following steps:
[0076] S1. Obtain tax-related indicators to obtain an initial tax data set, perform data quality evaluation on the initial tax data set to obtain a quality score, identify tax data with low quality scores based on an improved lonely forest algorithm and perform indicator decomposition to obtain a processed tax data set;
[0077] The S1 comprises the following steps:
[0078] S11, obtaining tax-related indicators, the tax-related indicators include tax declaration data, capital flow data, liability data, etc., setting the number of tax-related indicators to m, each tax-related indicator contains n tax data, and obtaining a tax-related indicator tax data set to form an initial tax data set A = {A1, A2, A3, ..., A m}, where A m represents the mth tax-related indicator tax data set, performs data quality evaluation on the initial tax data set, and obtains a quality score set. The specific steps are as follows:
[0079] S111, setting an isolated tree, selecting any tax-related indicator tax data set from the initial tax data set, recorded as a quality inspection data set, selecting a number of quality inspection data from the quality inspection data set and placing them at the root node of the isolated tree, calculating the mean of the quality inspection data at the root node of the isolated tree, recorded as the root node mean, and comparing it with other quality inspection data in the quality inspection data set; when other quality inspection data are greater than the root node mean, placing the corresponding quality inspection data at the right part of the isolated tree, otherwise placing the corresponding quality inspection data at the left part of the isolated tree; until all quality inspection data in the quality inspection data set are processed, or the maximum height of the isolated tree is reached, a processed isolated tree is obtained;
[0080] S112, the node corresponding quality detection data of the processed isolated tree, setting the isolated tree harmonic function to f(a), where a represents the number of nodes of the processed isolated tree, and the average value calculation formula of the isolated tree harmonic function is as follows:
[0081]
[0082] in, represents the average value of the isolated tree harmonic function, and f(a-1) represents the isolated tree harmonic function corresponding to the a-1th quality detection data;
[0083] Traverse the processed isolation tree, count the path length from each node to the root node, record the path length from the ath node to the root node as b(a), and calculate the quality score of each quality detection data in the processed isolation tree in combination with the average value of the isolation tree harmonic function. The calculation formula is as follows:
[0084]
[0085] Among them, B(a) represents the quality score of the a-th quality detection data in the processed isolated tree;
[0086] Calculating the quality scores of the initial tax data sets in sequence to obtain a quality score set;
[0087] S12, set the score upper limit threshold and the score lower limit threshold to ω1 and ω2 respectively, when the quality score in the quality score set is greater than the score upper limit threshold, the corresponding tax data is recorded as having a high quality score, when the quality score in the quality score set is less than the score lower limit threshold, the corresponding tax data is recorded as having a low quality score, when the quality score in the quality score set is greater than or equal to the score lower limit threshold and less than or equal to the score upper limit threshold, the corresponding tax data is recorded as having an unknown quality score; further, use the improved lonely forest algorithm to judge the tax data with unknown quality score, identify the tax data with low quality score and perform index decomposition to obtain the processed tax data set, the specific steps are as follows:
[0088] S121. The tax data with unknown quality scores constitute a set of tax data to be tested. The quality scores corresponding to the set of tax data to be tested are recorded as a set of quality scores to be tested C = {b1, b2, b3, ..., b c}, where b c represents the cth quality score to be detected; the set of quality scores to be detected is divided into four equal parts to obtain equal division points, which are respectively recorded as the first equal division point c1, the second equal division point c2 and the third equal division point c3. The specific steps of the four equal division are as follows:
[0089] S1211. For the second equally divided point, when c is an odd number, c2=b (c+1) / 2 ; When c is an even number, dividing the to-be-detected quality score set into a first quality score set and a second quality score set;
[0090] S1212. For the first and third equally divided points, when c is an even number, the first equally divided point c1 and the third equally divided point c3 are the medians of the first quality score set and the second quality score set, respectively; d is set to represent a constant, and when c is an odd number and c=4d+3, When c is an odd number and c=4d+1, Complete the quartering;
[0091] S122, after the to-be-detected quality score set is divided into four equal parts, the difference between the first and third equal parts is recorded as the quarter-division interval, and the quality score threshold is calculated according to the quarter-division interval, and the calculation formula is as follows:
[0092]
[0093] Among them, α1 and α2 represent the quality score thresholds, represents the quarter interval;
[0094] The quality scores to be detected in the set of quality scores to be detected that are not within the range of [α1, α2] are recorded as low quality scores; the tax data with low quality scores are indexed and decomposed to obtain a processed tax data set;
[0095] S2. Build a decision tree based on the XGBoost algorithm, form an initial XGBoost prediction model based on the decision tree, and calculate the risk rate of the initial XGBoost prediction model;
[0096] The S2 comprises the following steps:
[0097] S21. Re-acquire tax-related indicators from previous years, perform quality evaluation, and obtain a tax sample set of tax-related indicators. Construct a linear regression equation based on the processed tax sample set, set the tax sample risk probability, and when the tax sample risk probability is greater than or equal to 0.5, the result of the linear regression equation is 1; when the tax sample risk probability is less than 0.5, the result of the linear regression equation is 0, and obtain a preliminary prediction result of the tax sample risk;
[0098] For any tax-related indicator tax sample set in the processed tax sample set, the n′th tax sample of the m′th tax-related indicator tax sample set is taken as a critical point, the m′th tax-related indicator tax sample set is divided into a left branch and a right branch according to the critical point, and the information gain of the left branch and the information gain of the right branch are calculated to obtain a local maximum information gain, and the local maximum information gain corresponds to the information gain of the m′th tax-related indicator tax sample set;
[0099] S22, calculate the local information gain of all tax-related indicator tax sample sets in sequence to obtain an information gain set, select the maximum information gain in the information gain set as the vertex of the decision tree, and divide the tax-related indicator tax sample set into the left branch and the right branch of the decision tree according to the maximum information gain to obtain the first layer of the decision tree, and the first layer of the decision tree is processed; further, select the critical point of the first layer of the decision tree to obtain the second layer of the decision tree, until the information gain of the tax-related indicator tax sample set is less than 0 or the decision tree reaches the maximum number of layers, stop dividing, obtain the maximum layer of the decision tree, use all branches of the maximum layer of the decision tree as decision tree leaf nodes, and construct k decision trees;
[0100] S23, the k decision trees form an initial XGBoost prediction model, and the preliminary prediction result of the tax sample risk of the k′th decision tree is set to d k′ , and the risk rate of the initial XGBoost prediction model is obtained in turn. The risk rate calculation formula of the k′th tax-related indicator tax sample set in the initial XGBoost prediction model is as follows:
[0101]
[0102] Among them, χ k′ represents the risk rate of the tax sample set of the k′th tax-related indicator in the initial XGBoost prediction model;
[0103] S3. Introducing the giant armadillo optimization algorithm, optimizing the number and number of layers of decision trees according to the risk rate of the initial XGBoost prediction model, obtaining an optimized decision tree, establishing a final XGBoost prediction model, and outputting a set of tax data prediction values according to the processed tax data set;
[0104] The S3 comprises the following steps:
[0105] S31. According to the risk rate of the initial XGBoost prediction model, the risk rate calculation formula of the k′th tax-related indicator tax sample set in the initial XGBoost prediction model is used as the fitness function; the number and number of layers of the decision trees are optimized based on the giant armadillo optimization algorithm. When the fitness function is maximum, it corresponds to the optimal fitness function value. The optimal fitness function value corresponds to the number and number of layers of the optimized decision trees. The specific steps are as follows:
[0106] S311. Assume that there is a giant armadillo population in the search space, the population size of the giant armadillo population is M, the dimension of the giant armadillo individuals in the giant armadillo population is N, each giant armadillo individual is regarded as the number and number of layers of the decision tree, initialize the initial position of the giant armadillo individual in the search space, set the upper bound of the search space to p′, the lower bound of the search space to p″, e1 represents a random number between [0, 1], then the calculation formula for the j-dimensional position D(i, j) of the i-th giant armadillo individual in the giant armadillo population is as follows:
[0107] D(i,j)=p″+e1·(p′-p″);
[0108] Calculate the initial fitness function value corresponding to the position of all giant armadillo individuals in the giant armadillo population;
[0109] S312. In the exploration phase, the giant armadillo population moves toward the termite mound position and compares the fitness function value corresponding to the termite mound position with the initial fitness function value. When the fitness function value corresponding to the termite mound position is less than the initial fitness function value, the corresponding termite mound position is recorded as the candidate termite mound position. The i-th giant armadillo individual in the giant armadillo population updates its position according to the candidate termite mound position, and obtains the new position D′(i, j) of the i-th giant armadillo individual in the giant armadillo population. The calculation formula is as follows:
[0110]
[0111] Among them, e2 represents a random number between [0, 1], and e3 represents a number randomly selected from 1 or 2. represents the candidate termite mound location;
[0112] Set the current number of iterations to q. At the qth iteration, by comparing the fitness function value at the new position of the giant armadillo individual and the position of the giant armadillo individual, the position of the giant armadillo individual is updated to obtain the current optimal fitness function value. The current optimal fitness function value corresponds to the number and number of layers of the current optimal decision tree.
[0113] S313, in the development stage of the giant armadillo population, set e4 to represent a random number between [0, 1], and update the new position of the i-th giant armadillo individual in the giant armadillo population within the search space upper bound and the search space lower bound to obtain the updated position D″(i, j). The specific steps are as follows:
[0114]
[0115] Compare the fitness function value at the updated position with the current optimal fitness function value again, and update the position again, set the maximum number of iterations, and stop iterating when the current number of iterations reaches the maximum number of iterations, and get the final position of the i-th giant armadillo individual in the giant armadillo population. The coordinate values of the final position correspond to the number and number of layers of the optimized decision trees respectively;
[0116] S32, using the optimized number and number of layers of decision trees, adjusting the decision tree to obtain an optimized decision tree, and generating a final XGBoost prediction model; inputting the processed tax data set into the final XGBoost prediction model, outputting the tax data prediction value, and obtaining a tax data prediction value set;
[0117] S4. Training a least squares support vector machine to obtain a least squares support vector machine model, using the least squares support vector machine model to detect whether the tax data prediction value set has risks, obtaining risk detection results, and completing tax data risk detection;
[0118] The S4 comprises the following steps:
[0119] S41, obtaining a new tax data set again, using the new tax data set to train a least squares support vector machine to obtain a least squares support vector machine model, the specific steps are as follows:
[0120] S411, setting the kernel function of the least squares support vector machine to a radial basis function, dividing the new tax data set into a sample training set and a sample test set after quality evaluation and dimension reduction processing, inputting the sample training set into the least squares support vector machine for training until the least squares support vector machine converges, thereby obtaining a trained least squares support vector machine;
[0121] S412, input the sample test set into the trained least squares support vector machine, set an error threshold, and when the output result error is less than the error threshold, stop iteration to obtain a least squares support vector machine model, otherwise adjust the kernel parameter and penalty factor until the output result error is less than the error threshold;
[0122] S42. Use the least squares support vector machine model to detect whether there is a risk in the tax data prediction value set, input the tax data prediction value set into the least squares support vector machine model, output the risk detection result, set the risk threshold, and when the risk detection result is greater than the risk threshold, the tax data is at risk, otherwise the tax data is not at risk, and the tax data risk detection is completed.
[0123] Example 2
[0124] The present invention also discloses a system for tax data risk detection method based on data mining, which specifically includes: a data quality evaluation module, a prediction model establishment module, a prediction model decision tree optimization module and a tax data risk detection module;
[0125] The data quality evaluation module is used to evaluate the data quality of the initial tax data set and decompose the data into indicators;
[0126] The prediction model building module is used to build an initial XGBoost prediction model using a decision tree;
[0127] The prediction model decision tree optimization module is used to optimize the number and number of layers of decision trees in the initial XGBoost prediction model using the giant armadillo optimization algorithm;
[0128] The tax data risk detection module is used to train a least squares support vector machine model to detect whether there is a risk.
[0129] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0130] The preferred embodiments of the invention disclosed above are only used to help explain the invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the invention, so that those skilled in the art can understand and use the invention well.
Claims
1. A tax data risk detection method based on data mining, characterized in that: The steps include: S1. Obtain tax-related indicators to obtain an initial tax data set, perform data quality evaluation on the initial tax data set to obtain a quality score, identify tax data with low quality scores based on an improved lonely forest algorithm and perform indicator decomposition to obtain a processed tax data set; S2. Build a decision tree based on the XGBoost algorithm, form an initial XGBoost prediction model based on the decision tree, and calculate the risk rate of the initial XGBoost prediction model; S3. Optimize the number and number of layers of decision trees according to the risk rate of the initial XGBoost prediction model, obtain an optimized decision tree, establish a final XGBoost prediction model, and output a set of tax data prediction values according to the processed tax data set; S4. Train the least squares support vector machine to obtain a least squares support vector machine model, use the least squares support vector machine model to detect whether there is a risk in the tax data prediction value set, obtain a risk detection result, and complete the tax data risk detection.
2. The tax data risk detection method based on data mining according to claim 1 is characterized in that: The S1 comprises the following steps: S11, obtaining tax-related indicators, obtaining tax-related indicator tax data sets, forming an initial tax data set, and performing data quality evaluation on the initial tax data set to obtain a quality score set; S12. Set a score threshold, compare the quality score set with the score threshold, and divide the quality score set into high quality score, low quality score, and unknown quality score; further, use the improved lonely forest algorithm to judge the tax data with unknown quality score, identify the tax data with low quality score and perform indicator decomposition to obtain the processed tax data set.
3. The tax data risk detection method based on data mining according to claim 2 is characterized in that: The S11 comprises the following steps: S111, setting an isolated tree and setting a root node, placing the quality inspection data in the right and left parts of the isolated tree respectively, until all the quality inspection data in the quality inspection data set are processed, or the maximum height of the isolated tree is reached, to obtain a processed isolated tree; S112, setting an isolated tree harmonic function, calculating an average value of the isolated tree harmonic function, and then calculating a quality score of each quality detection data in the processed isolated tree to obtain a quality score set.
4. The tax data risk detection method based on data mining according to claim 3 is characterized in that: The method of using the improved lonely forest algorithm to judge tax data with unknown quality scores includes the following steps: The tax data with unknown quality scores constitute a set of tax data to be tested, the set of quality scores to be tested is divided into four equal parts, the quarter-section interval is calculated, and the quality score threshold is calculated based on the quarter-section interval; the set of quality scores to be tested is compared with the quality score threshold, the tax data with low quality scores are identified and indexed and decomposed, so as to obtain the processed tax data set.
5. The tax data risk detection method based on data mining according to claim 4 is characterized in that: The S2 comprises the following steps: S21. Re-acquire tax-related indicators from previous years, perform quality evaluation, obtain a tax sample set of tax-related indicators, and calculate the information gain of the tax sample set of tax-related indicators; S22, dividing the tax sample set of tax-related indicators into the left branch and the right branch of the decision tree according to the information gain, and obtaining the first layer of the decision tree, until the information gain of the tax sample set of tax-related indicators is less than 0 or the decision tree reaches the maximum number of layers, and then stopping the division, obtaining the maximum layer of the decision tree, and taking all branches of the maximum layer of the decision tree as the leaf nodes of the decision tree, and obtaining k decision trees; S23. The k decision trees form an initial XGBoost prediction model, and the risk rate of the initial XGBoost prediction model is calculated.
6. The tax data risk detection method based on data mining according to claim 5 is characterized in that: The S3 comprises the following steps: S31, according to the risk rate of the initial XGBoost prediction model, using the risk rate of the initial XGBoost prediction model as a fitness function; optimizing the number and number of layers of decision trees based on the giant armadillo optimization algorithm, when the fitness function is maximum, this corresponds to the optimal fitness function value, and the optimal fitness function value corresponds to the number and number of layers of the optimized decision trees; S32. Use the optimized number and number of layers of decision trees to adjust the decision tree, obtain the optimized decision tree, and generate the final XGBoost prediction model; input the processed tax data set into the final XGBoost prediction model, output the tax data prediction value, and obtain the tax data prediction value set.
7. The tax data risk detection method based on data mining according to claim 6 is characterized in that: The method of optimizing the number and number of layers of decision trees based on the giant armadillo optimization algorithm comprises the following steps: Assume that there is a giant armadillo population in the search space, the population size of the giant armadillo population is M, the dimension of the giant armadillo individuals in the giant armadillo population is N, and each giant armadillo individual is regarded as the number and number of layers of the decision tree. Initialize the initial position of the giant armadillo individual in the search space, set the upper bound of the search space to p′, the lower bound of the search space to p″, e1 represents a random number between [0, 1], then the calculation formula for the j-dimensional position D(i, j) of the i-th giant armadillo individual in the giant armadillo population is as follows: D(i,j)=p″+e1·(p′-p″); Calculate the initial fitness function value corresponding to the position of all giant armadillo individuals in the giant armadillo population; In the exploration phase, the giant armadillo population moves toward the termite mound position and compares the fitness function value corresponding to the termite mound position with the initial fitness function value. When the fitness function value corresponding to the termite mound position is less than the initial fitness function value, the corresponding termite mound position is recorded as the candidate termite mound position. The i-th giant armadillo individual in the giant armadillo population updates its position according to the candidate termite mound position, and obtains the new position D′(i,j) of the i-th giant armadillo individual in the giant armadillo population. The calculation formula is as follows: Among them, e2 represents a random number between [0, 1], and e3 represents a number randomly selected from 1 or 2. represents the candidate termite mound location; Set the current number of iterations to q. At the qth iteration, by comparing the fitness function value at the new position of the giant armadillo individual and the position of the giant armadillo individual, the position of the giant armadillo individual is updated to obtain the current optimal fitness function value. The current optimal fitness function value corresponds to the number and number of layers of the current optimal decision tree. In the development stage of the giant armadillo population, set e4 to represent a random number between [0, 1], and update the new position of the i-th giant armadillo individual in the giant armadillo population within the search space upper bound and the search space lower bound to obtain the updated position D″(i, j). The specific steps are as follows: The fitness function value at the updated position is compared with the current optimal fitness function value again, and the position is updated again. The maximum number of iterations is set. When the current number of iterations reaches the maximum number of iterations, the iteration is stopped to obtain the final position of the i-th giant armadillo individual in the giant armadillo population. The coordinate values of the final position correspond to the number and number of layers of the optimized decision trees.
8. The tax data risk detection method based on data mining according to claim 7 is characterized in that: The S4 comprises the following steps: S41, obtaining a new tax data set again, and using the new tax data set to train a least squares support vector machine to obtain a least squares support vector machine model; S42. Use the least squares support vector machine model to detect whether there is a risk in the set of tax data prediction values; input the set of tax data prediction values into the least squares support vector machine model, output the risk detection result, and set a risk threshold. When the risk detection result is greater than the risk threshold, there is a risk in the tax data, otherwise there is no risk in the tax data, and the tax data risk detection is completed.
9. The tax data risk detection method based on data mining according to claim 8 is characterized in that: The S41 comprises the following steps: S411, setting the kernel function of the least squares support vector machine to a radial basis function, dividing the new tax data set into a sample training set and a sample test set after quality evaluation and dimension reduction processing, inputting the sample training set into the least squares support vector machine for training until the least squares support vector machine converges, thereby obtaining a trained least squares support vector machine; S412, input the sample test set into the trained least squares support vector machine, set an error threshold, and when the output result error is less than the error threshold, stop iteration to obtain the least squares support vector machine model, otherwise adjust the kernel parameters and penalty factors until the output result error is less than the error threshold.
10. A system for implementing the tax data risk detection method based on data mining as claimed in any one of claims 1 to 9, characterized in that: Specifically include: Data quality evaluation module, forecasting model building module, forecasting model decision tree optimization module and tax data risk detection module; The data quality evaluation module is used to evaluate the data quality of the initial tax data set and decompose the data into indicators; The prediction model building module is used to build an initial XGBoost prediction model using a decision tree; The prediction model decision tree optimization module is used to optimize the number and number of layers of decision trees in the initial XGBoost prediction model using the giant armadillo optimization algorithm; The tax data risk detection module is used to train a least squares support vector machine model to detect whether there is a risk.
Citation Information
Patent Citations
A data export security detection method and system
CN112861141B