A method and system for automatic statistical analysis of economic information
The statistical analysis method of economic information through automated scripts and wrapped feature selection combined with decision tree algorithms solves the problem of low efficiency of manual statistical analysis, achieves efficient and intuitive economic information analysis, and saves labor costs.
Patent Information
- Application Number
- CN202311349687.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-10-17
AI Technical Summary
In the existing technology, manual statistical analysis is inefficient, difficult to meet the needs of a large amount of economic information processing, and relies on professionalism, resulting in low efficiency and difficulty in ensuring quality.
Use automated scripts to regularly obtain economic information data, perform data mining through wrapped feature selection and decision tree algorithms, and combine statistical analysis and data visualization to form an automated statistical analysis system.
It improves the efficiency of statistical analysis of economic information, saves labor costs, and enables a clearer and more intuitive understanding of the statistical analysis of economic information.
Smart Images

Figure CN117349658B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an automated statistical analysis method and system for economic information. Background Art
[0002] With the development of information technology, people have higher and higher requirements for the efficiency and quality of statistical analysis of economic information. However, in many industries, the mode of manual statistical analysis is still adopted. However, with the continuous increase of economic information, the mode of manual statistical analysis can no longer meet the requirements of processing a large amount of economic information, and the mode of manual statistical analysis is extremely dependent on the professional level of relevant personnel, which leads to the shortcomings of low efficiency and difficulty in ensuring quality. In this regard, a technology for automated statistical analysis of economic information is proposed, which makes the statistical analysis of economic information automated, which not only improves the efficiency of statistical analysis of economic information and saves the investment of manpower costs, but also can more clearly and intuitively understand the statistical analysis of economic information. Summary of the invention
[0003] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides an automated statistical analysis method and system for economic information, which enables the statistical analysis of economic information to be automated, thereby improving the efficiency of the statistical analysis of economic information and saving manpower costs, and providing a clearer and more intuitive understanding of the statistical analysis of economic information.
[0004] In order to solve the above technical problems, the present invention provides an automated statistical analysis method for economic information, the method comprising:
[0005] Setting an automated script, and periodically acquiring an economic information data set based on the automated script;
[0006] Preprocessing the economic information data set to obtain a preprocessed economic information data set;
[0007] Based on the package feature selection method, feature selection is performed on the preprocessed economic information data set to obtain the target features;
[0008] Performing data mining on the target features based on a decision tree algorithm to obtain classification mining results;
[0009] Performing statistical analysis on the classification mining results based on a statistical analysis method to obtain statistical analysis results;
[0010] The statistical analysis results are subjected to data visualization processing to obtain visualized economic information.
[0011] Optionally, the setting of an automated script and obtaining an economic information dataset periodically based on the automated script includes:
[0012] An automation script is set, a data collection task is created based on the automation script, and the data collection task is called regularly using a preset time period to obtain an economic information data set.
[0013] Optionally, preprocessing the economic information data set to obtain a preprocessed economic information data set includes:
[0014] Performing data cleaning on the economic information data set to obtain an economic information data set after data cleaning;
[0015] Performing data integration processing on the economic information data set after data cleaning processing to obtain the economic information data set after data integration processing;
[0016] Performing data transformation processing on the economic information data set after data integration processing to obtain the economic information data set after data transformation processing;
[0017] The economic information data set after data transformation is subjected to data reduction processing to obtain the preprocessed economic information data set.
[0018] Optionally, the wrapper-based feature selection method is used to perform feature selection processing on the preprocessed economic information data set to obtain target features, including:
[0019] Based on the feature extraction method, preliminary feature extraction is performed on the preprocessed economic information data set to obtain several initial features;
[0020] Inputting a number of initial features as a first feature subset into a preset random forest classifier, calculating the weight of each initial feature in the first feature subset, and calculating the classification accuracy of the first feature subset based on a cross-validation method;
[0021] Remove the initial feature with the lowest weight in the first feature subset to obtain the second feature subset;
[0022] The second feature subset is input into the preset random forest classifier again, the weight of each feature in the second feature subset is calculated, and the classification accuracy of the second feature subset is calculated based on the cross-validation algorithm, and the feature with the lowest weight in the second feature subset is removed to obtain a third feature subset;
[0023] The obtained feature subsets are processed in turn through calculation of weights, classification accuracy and feature removal until the preset termination condition is reached, and several feature subsets are obtained. The feature subset with the highest classification accuracy is taken as the target feature.
[0024] Optionally, calculating the weight of each initial feature in the first feature subset includes:
[0025] Normalizing each initial feature in the first feature subset to obtain a number of normalized initial features;
[0026] Calculating the information entropy of a plurality of normalized initial features, and calculating the information utility value of each normalized initial feature based on the information entropy;
[0027] The information utility value of each normalized initial feature is normalized to obtain the weight of each initial feature in the first feature subset.
[0028] Optionally, performing data mining processing on the target feature based on a decision tree algorithm to obtain a classification mining result includes:
[0029] Selecting attributes of the target features based on preset feature attributes to obtain a training set and a test set;
[0030] Perform data mining on the training set based on the decision tree algorithm to obtain an initial decision tree;
[0031] Performing pruning optimization processing on the initial decision tree based on the test set to obtain a target decision tree;
[0032] Based on the target decision tree, the target features are subjected to classification mining processing to obtain classification mining results.
[0033] Optionally, the performing pruning optimization processing on the initial decision tree based on the test set to obtain a target decision tree includes:
[0034] Inputting the test set into the initial decision tree, and calculating a first error growth rate;
[0035] Calculating the error of each node in the initial decision tree and the number of nodes in each subtree, calculating a second error growth rate based on the error of each node in the initial decision tree and the number of nodes in each subtree, comparing the first error growth rate and the second error growth rate, and taking the minimum value of the first error growth rate and the second error growth rate as the new error growth rate;
[0036] Pruning the internal nodes of the initial decision tree based on the new error growth rate to obtain a new decision tree;
[0037] Traverse the new decision tree to determine whether the new decision tree is composed only of root nodes. If the new decision tree is composed only of root nodes, use the new decision tree as the target decision tree. If the new decision tree is not composed only of root nodes, use the new decision tree as the initial decision tree to re-perform pruning optimization processing until the regenerated decision tree is composed only of root nodes.
[0038] Optionally, performing statistical analysis on the classification mining results based on a statistical analysis method to obtain statistical analysis results includes:
[0039] Performing frequency analysis on the classification mining results based on a statistical analysis method to obtain a frequency analysis result;
[0040] Performing trend analysis on the classification mining results based on a statistical analysis method to obtain trend analysis results;
[0041] Performing distribution analysis on the classification mining results based on a statistical analysis method to obtain distribution analysis results;
[0042] Perform an overview of the frequency analysis results, trend analysis results, and distribution analysis results to obtain statistical analysis results.
[0043] Optionally, performing data visualization processing on the statistical analysis results to obtain visualized economic information includes:
[0044] Performing visual marking processing on the statistical analysis results to obtain statistical analysis results after visual marking processing;
[0045] The statistical analysis results after visual marking are processed by visual mapping to obtain visual economic information.
[0046] In addition, the present invention also provides an economic information automated statistical analysis system, the system comprising:
[0047] A data set acquisition module, used to set an automation script and regularly acquire an economic information data set based on the automation script;
[0048] A preprocessing module, used to preprocess the economic information data set to obtain a preprocessed economic information data set;
[0049] A feature selection module is used to perform feature selection processing on the preprocessed economic information data set based on a wrapper feature selection method to obtain target features;
[0050] A data mining module is used to perform data mining processing on the target features based on a decision tree algorithm to obtain classification mining results;
[0051] A statistical analysis module, used to perform statistical analysis on the classification mining results based on a statistical analysis method to obtain statistical analysis results;
[0052] The data visualization module is used to perform data visualization processing on the statistical analysis results to obtain visualized economic information.
[0053] In an embodiment of the present invention, firstly, economic information data can be obtained regularly through an automated script, thus saving data collection time. Feature selection can be performed on economic information data through a wrapped feature selection method to obtain target features in a targeted manner. A decision tree algorithm is used to perform data mining on the target features, which can automatically screen out valuable information and form results with accurate information. Statistical analysis is performed on the classification mining results to more clearly understand the trends and distribution of the data mining results. Finally, data visualization processing can be used to intuitively display economic information. The present invention can automate the statistical analysis of economic information, which not only improves the efficiency of the statistical analysis of economic information and saves the investment in manpower costs, but also allows a clearer and more intuitive understanding of the statistical analysis of economic information. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 is a flow chart of an automated statistical analysis method for economic information in an embodiment of the present invention;
[0056] Figure 2 It is a schematic diagram of the structural composition of the economic information automatic statistical analysis system in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] 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.
[0058] Embodiment 1
[0059] See also Figure 1 , Figure 1 It is a flowchart of the method for automatic statistical analysis of economic information in an embodiment of the present invention.
[0060] like Figure 1 As shown, a method for automatic statistical analysis of economic information, the method comprising:
[0061] S11: Setting an automation script, and periodically acquiring an economic information data set based on the automation script;
[0062] In the specific implementation process of the present invention, the setting of the automation script and the periodic acquisition of the economic information data set based on the automation script include: setting the automation script, creating a data collection task based on the automation script, and periodically calling the data collection task using a preset time period to obtain the economic information data set.
[0063] Specifically, select a suitable scripting language to set variables and write instructions to complete the setting of automated scripts. Automated scripts can simplify the collection of economic information data. Data collection tasks can be created according to automated scripts, and data collection tasks can be called regularly during preset time periods to obtain economic information data sets. Economic information data can be collected every time period, which can not only prevent economic information data from not being updated for too long, but also save labor costs through automated scripts and improve the efficiency of economic information data collection.
[0064] S12: preprocessing the economic information data set to obtain a preprocessed economic information data set;
[0065] In the specific implementation process of the present invention, the preprocessing of the economic information data set to obtain the preprocessed economic information data set includes: performing data cleaning processing on the economic information data set to obtain the economic information data set after data cleaning processing; performing data integration processing on the economic information data set after data cleaning processing to obtain the economic information data set after data integration processing; performing data transformation processing on the economic information data set after data integration processing to obtain the economic information data set after data transformation processing; performing data reduction processing on the economic information data set after data transformation processing to obtain the preprocessed economic information data set.
[0066] Specifically, firstly, the economic information data set is cleaned and processed to check whether there are duplicate data in the economic information data set. If there are duplicate data, one or more of the data are deleted. After deleting the duplicate data, the economic information data set is processed for missing values. For the processing of missing values, the missing values in the data are identified and the type and distribution of the missing values are analyzed. Appropriate methods are used according to the type and distribution of the missing values. If there are few missing values, the interpolation method is used to fill the missing values. If there are a large number of missing values, the average filling method should be used to fill the missing values. After all the missing values are filled, the missing value processing is completed. After the missing value processing is completed, the outlier processing is performed. For the processing of outliers, the outliers can also be replaced by the interpolation method. Then check whether there are errors in the data set. If there are, correct the erroneous values. After the error values are corrected, the data cleaning is completed. Data integration processing is performed on the economic information data set after data cleaning. The economic information data set after data cleaning is integrated. Merge and unify the storage to complete the data integration processing; perform data transformation processing on the economic information data set after the data integration processing, convert the economic information data set after the data integration processing into a readable format, and unify its unit and time format. After the unification processing is completed, perform data normalization processing on the economic information data set, adopt the maximum-minimum normalization method, change the economic information data set to a new specific regional space, convert the economic information data set into a numerical type according to the numerical value in the new specific regional space, and complete the data transformation processing; perform data reduction processing on the economic information data set after the data transformation processing, aggregate the economic information data set after the data transformation processing according to specific attributes, and obtain a reduced representation of the data set, which occupies a smaller capacity but still maintains the integrity of the original data set. After the data reduction processing is completed, the preprocessing process is completed. Preprocessing the economic information data set can improve the data quality of the economic information data set, reduce the difficulty of subsequent analysis and processing, and improve the accuracy and reliability of subsequent analysis and processing.
[0067] S13: Perform feature selection processing on the preprocessed economic information data set based on the package feature selection method to obtain target features;
[0068] In the specific implementation process of the present invention, the feature selection process is performed on the preprocessed economic information data set based on the wrapper feature selection method to obtain the target feature, including: performing preliminary feature extraction on the preprocessed economic information data set based on the feature extraction method to obtain a number of initial features; inputting the several initial features into the preset random forest classifier as the first feature subset, calculating the weight of each initial feature in the first feature subset, and calculating the classification accuracy of the first feature subset based on the cross-validation method; removing the initial feature with the lowest weight in the first feature subset to obtain a second feature subset; inputting the second feature subset into the preset random forest classifier again, calculating the weight of each feature in the second feature subset, and calculating the classification accuracy of the second feature subset based on the cross-validation algorithm, removing the feature with the lowest weight in the second feature subset to obtain a third feature subset; cyclically calculating the weight, calculating the classification accuracy and removing the features for the obtained feature subsets until the preset termination condition is reached, obtaining a number of feature subsets, and taking the feature subset with the highest classification accuracy as the target feature.
[0069] Furthermore, the calculation of the weight of each initial feature in the first feature subset includes: normalizing each initial feature in the first feature subset to obtain a number of normalized initial features; calculating the information entropy of the several normalized initial features, and calculating the information utility value of each normalized initial feature based on the information entropy; normalizing the information utility value of each normalized initial feature to obtain the weight of each initial feature in the first feature subset.
[0070] Specifically, firstly, a preliminary feature extraction process is performed on the preprocessed economic information data set, the covariance matrix of the preprocessed economic information data set is calculated, the eigenvalue decomposition is performed on the covariance matrix to obtain eigenvalues and eigenvectors, and the eigenvectors corresponding to the corresponding eigenvalues are selected using the preset principal components. According to the selected eigenvalues and eigenvectors, dimensionality reduction mapping is performed to obtain several initial features; the several initial features are input into the preset random forest classifier as the first feature subset, and the preset random forest classifier will classify all the initial features. According to the number and depth of the trees in the random forest classifier and the division of the internal nodes, the initial features are classified. All the initial features are classified according to the classification rules, and then the weight of each initial feature in the first feature subset is calculated, each initial feature in the first feature subset is normalized, each initial feature is mapped to a specific interval, the expression form of the initial feature is changed to dimensionless, and several normalized initial features are obtained; the information entropy of several normalized initial features is calculated, firstly a forward matrix is constructed according to several normalized initial features, and it is determined whether there are negative values in the forward matrix. If so, the matrix is re-normalized to a non-negative interval, and then each normalized initial feature is calculated according to the forward matrix. The weight of each feature is calculated by differential accumulation according to the weight, and the information entropy is obtained. According to the definition of information utility value, the calculation of information utility value depends on the difference between information entropy and the fixed constant in the definition of information utility value, and the information utility value of each normalized initial feature is obtained; the information utility value of each normalized initial feature is normalized, and the information utility value is divided by the limiting sum value of the information utility value to obtain the weight of each initial feature in the first feature subset; the classification accuracy of the first feature subset is calculated based on the cross-validation method, and the classification accuracy of the first feature subset is obtained according to the preset random forest classifier. The classification result corresponding to the set is returned through the cross-validation method, and each index of the first feature subset split in the classification is returned. The slice calculation is performed by rotating each index, and the calculation result is calculated again with the preset hyperparameter value to obtain the classification accuracy of the first feature subset; the initial feature with the lowest weight in the first feature subset is removed to obtain the second feature subset; the second feature subset is input into the preset random forest classifier again, the weight of each feature in the second feature subset is calculated again, and the classification accuracy of the second feature subset is calculated again based on the cross-validation algorithm. Similarly, the feature with the lowest weight is removed to obtain the third feature subset;The above process is repeated for each feature subset obtained, and each newly obtained feature subset is input into the random forest classifier to calculate the weight, classification accuracy and feature removal process. The above steps are repeated until the preset termination condition is reached to end the process, and several feature subsets are obtained. The classification accuracy of all feature subsets is compared, and the feature subset with the highest classification accuracy is used as the target feature. The feature selection of economic information data is performed through the wrapper feature selection method, which can obtain the target feature in a targeted manner and avoid selecting too many useless features. ;
[0071] S14: performing data mining processing on the target features based on a decision tree algorithm to obtain classification mining results;
[0072] In the specific implementation process of the present invention, the target features are subjected to data mining processing based on the decision tree algorithm to obtain classification mining results, including: attribute selection of the target features based on preset feature attributes to obtain a training set and a test set; data mining processing of the training set based on the decision tree algorithm to obtain an initial decision tree; pruning and optimizing the initial decision tree based on the test set to obtain a target decision tree; classification mining processing of the target features based on the target decision tree to obtain classification mining results.
[0073] Furthermore, the pruning optimization processing is performed on the initial decision tree based on the test set to obtain the target decision tree, including: inputting the test set into the initial decision tree to calculate a first error growth rate; calculating the error of each node in the initial decision tree and the number of nodes in each subtree, calculating a second error growth rate based on the error of each node in the initial decision tree and the number of nodes in each subtree, comparing the first error growth rate with the second error growth rate, and taking the minimum of the first error growth rate and the second error growth rate as the new error growth rate; pruning the internal nodes of the initial decision tree based on the new error growth rate to obtain a new decision tree; traversing the new decision tree to determine whether the new decision tree is composed of only root nodes, if the new decision tree is composed of only root nodes, taking the new decision tree as the target decision tree, if the new decision tree is not composed of only root nodes, re-pruning and optimizing the new decision tree as the initial decision tree until the regenerated decision tree is composed of only root nodes.
[0074] Specifically, the target features are selected according to the preset feature attributes to obtain the training set and the test set. The target features are selected according to the feature attributes so that the similarity within each set is high and the similarity between different sets is low. The training set is processed for data mining based on the decision tree algorithm. The tree starts with a single node representing the training set. If the training sets are all in the same category, the node becomes a leaf. According to the different values of the node attributes, the training set is divided into several subsets to form several branches. The number of leaves on each formed branch is calculated. The above steps are recursively processed until the training set can no longer be divided to obtain the initial decision tree. , wherein the formation of the initial decision tree is to continuously mine the data of the training set to form the branches and leaves of the initial decision tree, thereby forming a complete decision tree; after obtaining the initial decision tree, the test set is input into the initial decision tree, and the initial decision tree is processed according to the test set to obtain the root node error number and the leaf node error number, and the first error rate is obtained by subtracting the leaf node error number from the root node error number and dividing it by the absolute value of the leaf node number minus one; the error of each node in the initial decision tree and the number of nodes in each subtree are calculated, and the second error growth rate is calculated according to the error of each node in the initial decision tree and the number of nodes in each subtree; the first error growth rate and the second error growth rate, and the minimum of the two is taken as the new error growth rate; the nodes in the initial decision tree are pruned according to the new error growth rate, and the prediction error rate of each node is calculated. If the prediction error rate is greater than or equal to the new error growth rate, the branch is pruned; if the prediction error rate is less than the error growth rate, the branch is retained until the pruning of each internal node is completed to obtain a new decision tree; the new decision tree is traversed to determine whether the new decision tree is composed of only root nodes. If the new decision tree is composed of only root nodes, the new decision tree is used as the target decision tree. If the new decision tree is not composed of only root nodes, the new decision tree is used as Initial decision tree, input the test set into the new decision tree, calculate the error growth rate and perform pruning until the regenerated decision tree consists of only the root node, then the pruning process can be ended to obtain the target decision tree; according to the target decision tree, the target features are classified and mined, starting from the root node of the target decision tree and traversing downward in sequence until the leaf node, the category represented by the leaf node is used as the classification category to obtain the classification mining result, and the decision tree algorithm is used for data mining, which can make feasible and effective results in a relatively short time, and can automatically filter out valuable information to form results with accurate information.
[0075] S15: Performing statistical analysis on the classification mining results based on a statistical analysis method to obtain statistical analysis results;
[0076] In the specific implementation process of the present invention, the classification mining results are statistically analyzed based on the statistical analysis method to obtain statistical analysis results, including: performing frequency analysis on the classification mining results based on the statistical analysis method to obtain frequency analysis results; performing trend analysis on the classification mining results based on the statistical analysis method to obtain trend analysis results; performing distribution analysis on the classification mining results based on the statistical analysis method to obtain distribution analysis results; and performing overview statistics on the frequency analysis results, trend analysis results and distribution analysis results to obtain statistical analysis results.
[0077] Specifically, frequency analysis is performed on the classification mining results according to the statistical analysis method. Frequency analysis is to count the frequency of economic information data in the classification mining results falling into the specified area. Frequency analysis can reflect whether the classification mining results are representative of the whole; trend analysis is performed on the classification mining results based on the statistical analysis method, which are central trend analysis and deviation trend analysis. Central trend analysis mainly relies on statistical indicators such as mean, median and mode to represent the central trend of data, and deviation trend analysis mainly relies on statistical indicators such as full range, interquartile range, mean deviation, variance and standard deviation to study the deviation trend of data; distribution analysis is performed on the classification mining results based on the statistical analysis method to understand whether the economic information data in the classification mining results presents a normal distribution or a skewed distribution, and understand its specific distribution situation; overview statistics are performed on the frequency analysis results, trend analysis results and distribution analysis results, so as to more intuitively understand the statistical analysis situation of the classification mining results and obtain statistical analysis results. Statistical analysis of the classification mining results can quickly and accurately understand the specific situation of the economic information data in the classification mining results.
[0078] S16: Perform data visualization processing on the statistical analysis results to obtain visualized economic information.
[0079] In the specific implementation process of the present invention, the data visualization processing of the statistical analysis results to obtain visualized economic information includes: visually marking the statistical analysis results to obtain the statistical analysis results after the visual marking processing; and visually mapping the statistical analysis results after the visual marking processing to obtain visualized economic information.
[0080] Specifically, visual marking processing is performed on the statistical analysis results, which is to map data attributes to visual set elements to obtain statistical analysis results after visual marking processing; visual mapping processing is performed on the statistical analysis results after visual marking processing, which is to map the visual set elements to visual presentation parameters. Charts and graphs of economic information, classification categories, directions and trends of economic information, etc. can be presented through data visualization. Through the combination of visual marking and visual mapping, economic information can be fully visualized and expressed, thereby obtaining visualized economic information. Data visualization processing can make economic information intuitive and accurate.
[0081] In an embodiment of the present invention, firstly, economic information data can be obtained regularly through an automated script, thus saving data collection time. Feature selection can be performed on economic information data through a wrapped feature selection method to obtain target features in a targeted manner. A decision tree algorithm is used to perform data mining on the target features, which can automatically screen out valuable information and form results with accurate information. Statistical analysis is performed on the classification mining results to more clearly understand the trends and distribution of the data mining results. Finally, data visualization processing can be used to intuitively display economic information. The present invention can automate the statistical analysis of economic information, which not only improves the efficiency of the statistical analysis of economic information and saves the investment in manpower costs, but also allows a clearer and more intuitive understanding of the statistical analysis of economic information.
[0082] Embodiment 2
[0083] See also Figure 2 , Figure 2 It is a schematic diagram of the structural composition of the economic information automatic statistical analysis system in an embodiment of the present invention.
[0084] like Figure 2 As shown, an automatic statistical analysis system for economic information comprises:
[0085] Dataset acquisition module 21: used to set an automation script and regularly acquire economic information datasets based on the automation script;
[0086] In the specific implementation process of the present invention, the setting of the automation script and the periodic acquisition of the economic information data set based on the automation script include: setting the automation script, creating a data collection task based on the automation script, and periodically calling the data collection task using a preset time period to obtain the economic information data set.
[0087] Specifically, select a suitable scripting language to set variables and write instructions to complete the setting of automated scripts. Automated scripts can simplify the collection of economic information data. Data collection tasks can be created according to automated scripts, and data collection tasks can be called regularly during preset time periods to obtain economic information data sets. Economic information data can be collected every time period, which can not only prevent economic information data from not being updated for too long, but also save labor costs through automated scripts and improve the efficiency of economic information data collection.
[0088] Preprocessing module 22: used to preprocess the economic information data set to obtain a preprocessed economic information data set;
[0089] In the specific implementation process of the present invention, the preprocessing of the economic information data set to obtain the preprocessed economic information data set includes: performing data cleaning processing on the economic information data set to obtain the economic information data set after data cleaning processing; performing data integration processing on the economic information data set after data cleaning processing to obtain the economic information data set after data integration processing; performing data transformation processing on the economic information data set after data integration processing to obtain the economic information data set after data transformation processing; performing data reduction processing on the economic information data set after data transformation processing to obtain the preprocessed economic information data set.
[0090] Specifically, firstly, the economic information data set is cleaned and processed to check whether there are duplicate data in the economic information data set. If there are duplicate data, one or more of the data are deleted. After deleting the duplicate data, the economic information data set is processed for missing values. For the processing of missing values, the missing values in the data are identified and the type and distribution of the missing values are analyzed. Appropriate methods are used according to the type and distribution of the missing values. If there are few missing values, the interpolation method is used to fill the missing values. If there are a large number of missing values, the average filling method should be used to fill the missing values. After all the missing values are filled, the missing value processing is completed. After the missing value processing is completed, the outlier processing is performed. For the processing of outliers, the outliers can also be replaced by the interpolation method. Then check whether there are errors in the data set. If there are, correct the erroneous values. After the error values are corrected, the data cleaning is completed. Data integration processing is performed on the economic information data set after data cleaning. The economic information data set after data cleaning is integrated. Merge and unify the storage to complete the data integration processing; perform data transformation processing on the economic information data set after the data integration processing, convert the economic information data set after the data integration processing into a readable format, and unify its unit and time format. After the unification processing is completed, perform data normalization processing on the economic information data set, adopt the maximum-minimum normalization method, change the economic information data set to a new specific regional space, convert the economic information data set into a numerical type according to the numerical value in the new specific regional space, and complete the data transformation processing; perform data reduction processing on the economic information data set after the data transformation processing, aggregate the economic information data set after the data transformation processing according to specific attributes, and obtain a reduced representation of the data set, which occupies a smaller capacity but still maintains the integrity of the original data set. After the data reduction processing is completed, the preprocessing process is completed. Preprocessing the economic information data set can improve the data quality of the economic information data set, reduce the difficulty of subsequent analysis and processing, and improve the accuracy and reliability of subsequent analysis and processing.
[0091] Feature selection module 23: used to perform feature selection processing on the preprocessed economic information data set based on the package feature selection method to obtain target features;
[0092] In the specific implementation process of the present invention, the feature selection process is performed on the preprocessed economic information data set based on the wrapper feature selection method to obtain the target feature, including: performing preliminary feature extraction on the preprocessed economic information data set based on the feature extraction method to obtain a number of initial features; inputting the several initial features into the preset random forest classifier as the first feature subset, calculating the weight of each initial feature in the first feature subset, and calculating the classification accuracy of the first feature subset based on the cross-validation method; removing the initial feature with the lowest weight in the first feature subset to obtain a second feature subset; inputting the second feature subset into the preset random forest classifier again, calculating the weight of each feature in the second feature subset, and calculating the classification accuracy of the second feature subset based on the cross-validation algorithm, removing the feature with the lowest weight in the second feature subset to obtain a third feature subset; cyclically calculating the weight, calculating the classification accuracy and removing the features for the obtained feature subsets until the preset termination condition is reached, obtaining a number of feature subsets, and taking the feature subset with the highest classification accuracy as the target feature.
[0093] Furthermore, the calculation of the weight of each initial feature in the first feature subset includes: normalizing each initial feature in the first feature subset to obtain a number of normalized initial features; calculating the information entropy of the several normalized initial features, and calculating the information utility value of each normalized initial feature based on the information entropy; normalizing the information utility value of each normalized initial feature to obtain the weight of each initial feature in the first feature subset.
[0094] Specifically, firstly, a preliminary feature extraction process is performed on the preprocessed economic information data set, the covariance matrix of the preprocessed economic information data set is calculated, the eigenvalue decomposition is performed on the covariance matrix to obtain eigenvalues and eigenvectors, and the eigenvectors corresponding to the corresponding eigenvalues are selected using the preset principal components. According to the selected eigenvalues and eigenvectors, dimensionality reduction mapping is performed to obtain several initial features; the several initial features are input into the preset random forest classifier as the first feature subset, and the preset random forest classifier will classify all the initial features. According to the number and depth of the trees in the random forest classifier and the division of the internal nodes, the initial features are classified. All the initial features are classified according to the classification rules, and then the weight of each initial feature in the first feature subset is calculated, each initial feature in the first feature subset is normalized, each initial feature is mapped to a specific interval, the expression form of the initial feature is changed to dimensionless, and several normalized initial features are obtained; the information entropy of several normalized initial features is calculated, firstly a forward matrix is constructed according to several normalized initial features, and it is determined whether there are negative values in the forward matrix. If so, the matrix is re-normalized to a non-negative interval, and then each normalized initial feature is calculated according to the forward matrix. The weight of each feature is calculated by differential accumulation according to the weight, and the information entropy is obtained. According to the definition of information utility value, the calculation of information utility value depends on the difference between information entropy and the fixed constant in the definition of information utility value, and the information utility value of each normalized initial feature is obtained; the information utility value of each normalized initial feature is normalized, and the information utility value is divided by the limiting sum value of the information utility value to obtain the weight of each initial feature in the first feature subset; the classification accuracy of the first feature subset is calculated based on the cross-validation method, and the classification accuracy of the first feature subset is obtained according to the preset random forest classifier. The classification result corresponding to the set is returned through the cross-validation method, and each index of the first feature subset split in the classification is returned. The slice calculation is performed by rotating each index, and the calculation result is calculated again with the preset hyperparameter value to obtain the classification accuracy of the first feature subset; the initial feature with the lowest weight in the first feature subset is removed to obtain the second feature subset; the second feature subset is input into the preset random forest classifier again, the weight of each feature in the second feature subset is calculated again, and the classification accuracy of the second feature subset is calculated again based on the cross-validation algorithm. Similarly, the feature with the lowest weight is removed to obtain the third feature subset;The above process is repeated for each feature subset obtained, and each newly obtained feature subset is input into the random forest classifier to calculate the weight, classification accuracy and feature removal process. The above steps are repeated until the preset termination condition is reached to end the process, and several feature subsets are obtained. The classification accuracy of all feature subsets is compared, and the feature subset with the highest classification accuracy is used as the target feature. The feature selection of economic information data is performed through the wrapper feature selection method, which can obtain the target feature in a targeted manner and avoid selecting too many useless features. ;
[0095] Data mining module 24: used to perform data mining processing on the target features based on a decision tree algorithm to obtain classification mining results;
[0096] In the specific implementation process of the present invention, the target features are subjected to data mining processing based on the decision tree algorithm to obtain classification mining results, including: attribute selection of the target features based on preset feature attributes to obtain a training set and a test set; data mining processing of the training set based on the decision tree algorithm to obtain an initial decision tree; pruning and optimizing the initial decision tree based on the test set to obtain a target decision tree; classification mining processing of the target features based on the target decision tree to obtain classification mining results.
[0097] Furthermore, the pruning optimization processing is performed on the initial decision tree based on the test set to obtain the target decision tree, including: inputting the test set into the initial decision tree to calculate a first error growth rate; calculating the error of each node in the initial decision tree and the number of nodes in each subtree, calculating a second error growth rate based on the error of each node in the initial decision tree and the number of nodes in each subtree, comparing the first error growth rate with the second error growth rate, and taking the minimum of the first error growth rate and the second error growth rate as the new error growth rate; pruning the internal nodes of the initial decision tree based on the new error growth rate to obtain a new decision tree; traversing the new decision tree to determine whether the new decision tree is composed of only root nodes, if the new decision tree is composed of only root nodes, taking the new decision tree as the target decision tree, if the new decision tree is not composed of only root nodes, re-pruning and optimizing the new decision tree as the initial decision tree until the regenerated decision tree is composed of only root nodes.
[0098] Specifically, the target features are selected according to the preset feature attributes to obtain the training set and the test set. The target features are selected according to the feature attributes so that the similarity within each set is high and the similarity between different sets is low. The training set is processed for data mining based on the decision tree algorithm. The tree starts with a single node representing the training set. If the training sets are all in the same category, the node becomes a leaf. According to the different values of the node attributes, the training set is divided into several subsets to form several branches. The number of leaves on each formed branch is calculated. The above steps are recursively processed until the training set can no longer be divided to obtain the initial decision tree. , wherein the formation of the initial decision tree is to continuously mine the data of the training set to form the branches and leaves of the initial decision tree, thereby forming a complete decision tree; after obtaining the initial decision tree, the test set is input into the initial decision tree, and the initial decision tree is processed according to the test set to obtain the root node error number and the leaf node error number, and the first error rate is obtained by subtracting the leaf node error number from the root node error number and dividing it by the absolute value of the leaf node number minus one; the error of each node in the initial decision tree and the number of nodes in each subtree are calculated, and the second error growth rate is calculated according to the error of each node in the initial decision tree and the number of nodes in each subtree; the first error growth rate and the second error growth rate, and the minimum of the two is taken as the new error growth rate; the nodes in the initial decision tree are pruned according to the new error growth rate, and the prediction error rate of each node is calculated. If the prediction error rate is greater than or equal to the new error growth rate, the branch is pruned; if the prediction error rate is less than the error growth rate, the branch is retained until the pruning of each internal node is completed to obtain a new decision tree; the new decision tree is traversed to determine whether the new decision tree is composed of only root nodes. If the new decision tree is composed of only root nodes, the new decision tree is used as the target decision tree. If the new decision tree is not composed of only root nodes, the new decision tree is used as Initial decision tree, input the test set into the new decision tree, calculate the error growth rate and perform pruning until the regenerated decision tree consists of only the root node, then the pruning process can be ended to obtain the target decision tree; according to the target decision tree, the target features are classified and mined, starting from the root node of the target decision tree and traversing downward in sequence until the leaf node, the category represented by the leaf node is used as the classification category to obtain the classification mining result, and the decision tree algorithm is used for data mining, which can make feasible and effective results in a relatively short time, and can automatically filter out valuable information to form results with accurate information.
[0099] Statistical analysis module 25: used to perform statistical analysis on the classification mining results based on a statistical analysis method to obtain statistical analysis results;
[0100] In the specific implementation process of the present invention, the classification mining results are statistically analyzed based on the statistical analysis method to obtain statistical analysis results, including: performing frequency analysis on the classification mining results based on the statistical analysis method to obtain frequency analysis results; performing trend analysis on the classification mining results based on the statistical analysis method to obtain trend analysis results; performing distribution analysis on the classification mining results based on the statistical analysis method to obtain distribution analysis results; and performing overview statistics on the frequency analysis results, trend analysis results and distribution analysis results to obtain statistical analysis results.
[0101] Specifically, frequency analysis is performed on the classification mining results according to the statistical analysis method. Frequency analysis is to count the frequency of economic information data in the classification mining results falling into the specified area. Frequency analysis can reflect whether the classification mining results are representative of the whole; trend analysis is performed on the classification mining results based on the statistical analysis method, which are central trend analysis and deviation trend analysis. Central trend analysis mainly relies on statistical indicators such as mean, median and mode to represent the central trend of data, and deviation trend analysis mainly relies on statistical indicators such as full range, interquartile range, mean deviation, variance and standard deviation to study the deviation trend of data; distribution analysis is performed on the classification mining results based on the statistical analysis method to understand whether the economic information data in the classification mining results presents a normal distribution or a skewed distribution, and understand its specific distribution situation; overview statistics are performed on the frequency analysis results, trend analysis results and distribution analysis results, so as to more intuitively understand the statistical analysis situation of the classification mining results and obtain statistical analysis results. Statistical analysis of the classification mining results can quickly and accurately understand the specific situation of the economic information data in the classification mining results.
[0102] Data visualization module 26: used to perform data visualization processing on the statistical analysis results to obtain visualized economic information.
[0103] In the specific implementation process of the present invention, the data visualization processing of the statistical analysis results to obtain visualized economic information includes: visually marking the statistical analysis results to obtain the statistical analysis results after the visual marking processing; and visually mapping the statistical analysis results after the visual marking processing to obtain visualized economic information.
[0104] Specifically, visual marking processing is performed on the statistical analysis results, which is to map data attributes to visual set elements to obtain statistical analysis results after visual marking processing; visual mapping processing is performed on the statistical analysis results after visual marking processing, which is to map the visual set elements to visual presentation parameters. Charts and graphs of economic information, classification categories, directions and trends of economic information, etc. can be presented through data visualization. Through the combination of visual marking and visual mapping, economic information can be fully visualized and expressed, thereby obtaining visualized economic information. Data visualization processing can make economic information intuitive and accurate.
[0105] In an embodiment of the present invention, firstly, economic information data can be obtained regularly through an automated script, thus saving data collection time. Feature selection can be performed on economic information data through a wrapped feature selection method to obtain target features in a targeted manner. A decision tree algorithm is used to perform data mining on the target features, which can automatically screen out valuable information and form results with accurate information. Statistical analysis is performed on the classification mining results to more clearly understand the trends and distribution of the data mining results. Finally, data visualization processing can be used to intuitively display economic information. The present invention can automate the statistical analysis of economic information, which not only improves the efficiency of the statistical analysis of economic information and saves the investment in manpower costs, but also allows a clearer and more intuitive understanding of the statistical analysis of economic information.
[0106] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0107] In addition, the above is a detailed introduction to an automated statistical analysis method and system for economic information provided by an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. An automated statistical analysis method for economic information, characterized in that: The method comprises: Setting an automated script, and periodically acquiring an economic information data set based on the automated script; Preprocessing the economic information data set to obtain a preprocessed economic information data set; Based on the package feature selection method, feature selection is performed on the preprocessed economic information data set to obtain the target features; Performing data mining on the target features based on a decision tree algorithm to obtain classification mining results; Performing statistical analysis on the classification mining results based on a statistical analysis method to obtain statistical analysis results; Performing data visualization processing on the statistical analysis results to obtain visualized economic information; The method of performing feature selection on the preprocessed economic information data set based on the wrapper feature selection method to obtain target features includes: performing preliminary feature extraction on the preprocessed economic information data set based on the feature extraction method to obtain a number of initial features; inputting the several initial features into a preset random forest classifier as a first feature subset, calculating the weight of each initial feature in the first feature subset, and calculating the classification accuracy of the first feature subset based on a cross-validation method; performing classification processing on the first feature subset according to the preset random forest classifier to obtain a classification result corresponding to the first feature subset, returning each index of the first feature subset split in the classification result through a cross-validation method, and using the first feature subset in rotation. Each index is sliced and calculated, and the calculation result and the preset hyperparameter value are calculated again to obtain the classification accuracy of the first feature subset; the initial feature with the lowest weight in the first feature subset is removed to obtain the second feature subset; the second feature subset is input into the preset random forest classifier again, the weight of each feature in the second feature subset is calculated, and the classification accuracy of the second feature subset is calculated based on the cross-validation algorithm, and the feature with the lowest weight in the second feature subset is removed to obtain the third feature subset; the obtained feature subsets are cyclically processed in turn to calculate weights, calculate classification accuracy and remove features until the preset termination condition is reached, and several feature subsets are obtained, and the feature subset with the highest classification accuracy is used as the target feature; The data mining process of the target feature is performed based on a decision tree algorithm to obtain a classification mining result, including: selecting attributes of the target feature based on preset feature attributes to obtain a training set and a test set; performing data mining process on the training set based on a decision tree algorithm to obtain an initial decision tree; performing pruning optimization process on the initial decision tree based on the test set to obtain a target decision tree; and performing classification mining process on the target feature based on the target decision tree to obtain a classification mining result.
2. The method for automatic statistical analysis of economic information according to claim 1, characterized in that: The setting of the automation script and obtaining the economic information data set regularly based on the automation script include: An automation script is set, a data collection task is created based on the automation script, and the data collection task is called regularly using a preset time period to obtain an economic information data set.
3. The method for automatic statistical analysis of economic information according to claim 1, characterized in that: The preprocessing of the economic information data set to obtain the preprocessed economic information data set includes: Performing data cleaning on the economic information data set to obtain an economic information data set after data cleaning; Performing data integration processing on the economic information data set after data cleaning processing to obtain the economic information data set after data integration processing; Performing data transformation processing on the economic information data set after data integration processing to obtain the economic information data set after data transformation processing; The economic information data set after data transformation is subjected to data reduction processing to obtain the preprocessed economic information data set.
4. The method for automatic statistical analysis of economic information according to claim 1, characterized in that: The calculating the weight of each initial feature in the first feature subset includes: Normalizing each initial feature in the first feature subset to obtain a number of normalized initial features; Calculating the information entropy of a plurality of normalized initial features, and calculating the information utility value of each normalized initial feature based on the information entropy; The information utility value of each normalized initial feature is normalized to obtain the weight of each initial feature in the first feature subset.
5. The method for automatic statistical analysis of economic information according to claim 1, characterized in that: The pruning optimization process is performed on the initial decision tree based on the test set to obtain a target decision tree, including: Inputting the test set into the initial decision tree, and calculating a first error growth rate; Calculating the error of each node in the initial decision tree and the number of nodes in each subtree, calculating a second error growth rate based on the error of each node in the initial decision tree and the number of nodes in each subtree, comparing the first error growth rate and the second error growth rate, and taking the minimum value of the first error growth rate and the second error growth rate as the new error growth rate; Pruning the internal nodes of the initial decision tree based on the new error growth rate to obtain a new decision tree; Traverse the new decision tree to determine whether the new decision tree is composed only of root nodes. If the new decision tree is composed only of root nodes, use the new decision tree as the target decision tree. If the new decision tree is not composed only of root nodes, use the new decision tree as the initial decision tree to re-perform pruning optimization processing until the regenerated decision tree is composed only of root nodes.
6. The method for automatic statistical analysis of economic information according to claim 1, characterized in that: The method of performing statistical analysis on the classification mining results based on the statistical analysis method to obtain the statistical analysis results includes: Performing frequency analysis on the classification mining results based on a statistical analysis method to obtain a frequency analysis result; Performing trend analysis on the classification mining results based on a statistical analysis method to obtain trend analysis results; Performing distribution analysis on the classification mining results based on a statistical analysis method to obtain distribution analysis results; Perform an overview of the frequency analysis results, trend analysis results, and distribution analysis results to obtain statistical analysis results.
7. The method for automatic statistical analysis of economic information according to claim 1, characterized in that: The performing data visualization processing on the statistical analysis results to obtain visualized economic information includes: Performing visual marking processing on the statistical analysis results to obtain statistical analysis results after visual marking processing; The statistical analysis results after visual marking are processed by visual mapping to obtain visual economic information.
8. An automated statistical analysis system for economic information, characterized in that: The system comprises: A data set acquisition module, used to set an automation script and regularly acquire an economic information data set based on the automation script; A preprocessing module, used to preprocess the economic information data set to obtain a preprocessed economic information data set; A feature selection module is used to perform feature selection processing on the preprocessed economic information data set based on a wrapper feature selection method to obtain target features; A data mining module is used to perform data mining processing on the target features based on a decision tree algorithm to obtain classification mining results; A statistical analysis module, used to perform statistical analysis on the classification mining results based on a statistical analysis method to obtain statistical analysis results; A data visualization module is used to perform data visualization processing on the statistical analysis results to obtain visualized economic information; The method of performing feature selection on the preprocessed economic information data set based on the wrapper feature selection method to obtain target features includes: performing preliminary feature extraction on the preprocessed economic information data set based on the feature extraction method to obtain a number of initial features; inputting the several initial features into a preset random forest classifier as a first feature subset, calculating the weight of each initial feature in the first feature subset, and calculating the classification accuracy of the first feature subset based on a cross-validation method; performing classification processing on the first feature subset according to the preset random forest classifier to obtain a classification result corresponding to the first feature subset, returning each index of the first feature subset split in the classification result through a cross-validation method, and using the first feature subset in rotation. Each index is sliced and calculated, and the calculation result and the preset hyperparameter value are calculated again to obtain the classification accuracy of the first feature subset; the initial feature with the lowest weight in the first feature subset is removed to obtain the second feature subset; the second feature subset is input into the preset random forest classifier again, the weight of each feature in the second feature subset is calculated, and the classification accuracy of the second feature subset is calculated based on the cross-validation algorithm, and the feature with the lowest weight in the second feature subset is removed to obtain the third feature subset; the obtained feature subsets are cyclically processed in turn to calculate weights, calculate classification accuracy and remove features until the preset termination condition is reached, and several feature subsets are obtained, and the feature subset with the highest classification accuracy is used as the target feature; The data mining process of the target feature is performed based on a decision tree algorithm to obtain a classification mining result, including: selecting attributes of the target feature based on preset feature attributes to obtain a training set and a test set; performing data mining process on the training set based on a decision tree algorithm to obtain an initial decision tree; performing pruning optimization process on the initial decision tree based on the test set to obtain a target decision tree; and performing classification mining process on the target feature based on the target decision tree to obtain a classification mining result.
