A data cleaning method and system based on machine learning
Through the data cleaning method based on machine learning, the window sequence segment of the PM2.5 concentration data time series and the weight coefficient of similar data points are used for label correction, which solves the problem of inaccurate data cleaning in the existing technology and improves the air quality time series. Anomaly identification accuracy of data.
Patent Information
- Application Number
- CN202410933762.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-12
AI Technical Summary
When existing data cleaning methods analyze air quality time series data, they only determine correction labels based on the frequency of label occurrences of similar data points, which may lead to inaccurate corrections and affect the analysis results of abnormal data.
Using a data cleaning method based on machine learning, by obtaining the PM2.5 concentration data time series, constructing window sequence segments, calculating the Pearson correlation coefficient, obtaining similar data points, and performing label correction based on the weight coefficients of similar data points, and iterative correction until When the preset quantity threshold is reached, the final label value is determined.
It improves the accuracy of identifying abnormal data, can identify outliers that are inconsistent with the changing trends of most data points, and enhances the accuracy of data analysis and visualization.
Smart Images

Figure CN118469044B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a data cleaning method and system based on machine learning. Background Art
[0002] Air quality is directly related to the health and quality of life of residents. Monitoring urban air quality can timely detect air pollution problems and reduce the harm of pollutants to public health. Analyzing abnormal data of urban air quality can help track pollution sources, conduct relevant supervision and investigation work, and take measures to reduce pollutant emissions. Data cleaning is an important step in data preprocessing, which aims to identify and correct inaccurate, incomplete, repeated or irrelevant abnormal data in the data set. For monitoring abnormal points in air quality time series data, the label of the current data point is usually corrected according to the frequency of occurrence of similar data point labels of the current data point. For real time series environmental data, there are multiple uncertain factors. Therefore, if the corrected label of the current data point is determined only based on the frequency of occurrence of similar data point labels, there may be inaccurate corrected labels, which ultimately affects the analysis of abnormal data. Summary of the invention
[0003] The present invention provides a data cleaning method and system based on machine learning to solve the existing problems.
[0004] The data cleaning method and system based on machine learning of the present invention adopt the following technical solutions:
[0005] An embodiment of the present invention provides a data cleaning method based on machine learning, the method comprising the following steps:
[0006] Acquire the PM2.5 concentration data time series in the air within a preset time period;
[0007] According to the size of the concentration data corresponding to the data point in the PM2.5 concentration data time series, the initial label value of each data point in the PM2.5 concentration data time series is obtained;
[0008] Construct a window sequence segment corresponding to each data point in the PM2.5 concentration data time series, and obtain the Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point; obtain similar data points of each data point based on the Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point;
[0009] According to the initial label value of each data point, a revised label sequence of each data point is formed; according to each label value in the revised label sequence of each data point, each label value in the revised label sequence of each similar data point of each data point, and the time interval between each data point and each similar data point of each data point, a weight coefficient of each similar data point of each data point is obtained;
[0010] According to the weight coefficient of each similar data point of each data point, a corrected label value of each data point is obtained; according to the corrected label value of each data point, several abnormal data points are screened out from all data points.
[0011] Furthermore, the initial label value of each data point in the PM2.5 concentration data time series sequence is obtained according to the size of the concentration data corresponding to the data point in the PM2.5 concentration data time series sequence, and the specific steps include the following:
[0012] According to the size of the concentration data corresponding to the data points in the PM2.5 concentration data time series, the K-means clustering algorithm is used to cluster the PM2.5 concentration data time series to obtain several clusters;
[0013] The number of data points in each cluster is counted, and the initial label value of each data in the cluster with the largest number of data points is set to a first preset value, and the initial label value of each data in the cluster with the smallest number of data points is set to a second preset value.
[0014] Furthermore, the method of obtaining similar data points of each data point according to the Pearson correlation coefficient of each data point with all data in the window sequence segment of each other data point includes the following specific steps:
[0015] In the Among the Pearson correlation coefficients of all data in the window sequence segment between the data point and all other data points, the other data points whose Pearson correlation coefficients are greater than the preset first judgment threshold are recorded as data points that are similar to the data points.
[0016] Furthermore, the step of obtaining the weight coefficient of each similar data point of each data point according to each label value in the corrected label sequence of each data point, each label value in the corrected label sequence of each similar data point of each data point, and the time interval between each data point and each similar data point of each data point includes the following specific steps:
[0017] According to each label value in the corrected label sequence of each data point and each label value in the corrected label sequence of each similar data point of each data point, the stability of the label value of each similar data point of each data point being a first preset value and the stability of the label value being a second preset value are obtained;
[0018] The first The data point The maximum value of the stability of the label value of the similar data point at the first preset value and the stability of the label value at the second preset value is recorded as The data point The final stability of similar data points;
[0019] According to the time interval between each data point and each similar data point of each data point, the time periodicity between each data point and each similar data point of each data point is obtained;
[0020] The product of the final stability of each similar data point of each data point and the time periodicity of each data point and each similar data point of each data point is recorded as the weight coefficient of each similar data point of each data point.
[0021] Furthermore, the specific calculation formula for obtaining the stability of the label value of each similar data point of each data point being the first preset value and the stability of the label value being the second preset value according to each label value in the corrected label sequence of each data point and each label value in the corrected label sequence of each similar data point of each data point is:
[0022]
[0023]
[0024] in, Indicates The data point The label value of similar data points is the stability of the first preset value, Indicates The data point The label value of similar data points is the stability of the second preset value, Indicates The data point The number of label values in the corrected label sequence of similar data points whose label values are the first preset value, Indicates The data point The number of sequence segments consisting of consecutive label values that are the same as the first preset value in the corrected label sequence of similar data points, Indicates The data point The number of label values in the corrected label sequence of similar data points with the second preset value, Indicates The data point The number of sequence segments consisting of consecutive label values that are the same as the second preset value in the modified label sequence of similar data points.
[0025] Furthermore, the specific calculation formula for obtaining the time periodicity between each data point and each similar data point of each data point according to the time interval between each data point and each similar data point of each data point is:
[0026]
[0027] in, Indicates The data point Similar data points to The time periodicity of the data points, Indicates Data points and The data point The remainder of the time interval between similar data points divided by the preset time length.
[0028] Furthermore, the step of obtaining the corrected label value of each data point according to the weight coefficient of each similar data point of each data point includes the following specific steps:
[0029] According to the weight coefficient of each similar data point of each data point, the possibility of obtaining the label value of each data point being the second preset value and the label value being the first preset value;
[0030] The first The label value of the data point is the largest label value among the possibilities of the second preset value and the first preset value, recorded as Corrected label value for each data point.
[0031] Furthermore, the specific calculation formula for obtaining the possibility that the label value of each data point is the second preset value and the label value is the first preset value according to the weight coefficient of each similar data point of each data point is:
[0032]
[0033]
[0034] in, Indicates The probability that the label value of a data point is the second preset value, Indicates The probability that the label value of a data point is the first preset value, Indicates The first of all similar data points whose label value is the second preset value The weight coefficient of similar data points, Indicates The first data point among all similar data points of the data point with the label value of the first preset value The weight coefficient of similar data points, Indicates The number of similar data points whose label value is the second preset value among all similar data points of data points, Indicates The number of similar data points whose label value is the first preset value among all similar data points of the data point.
[0035] Furthermore, the method of screening out a number of abnormal data points from all data points according to the corrected label value of each data point includes the following specific steps:
[0036] Add the corrected label value of each data point to the corrected label sequence of each data point, and iteratively correct the corrected label value of each data point according to the method of obtaining the corrected label value of each data point until the number of iterations is equal to Stop when , and get the final corrected label sequence for each data point, where is a preset quantity threshold;
[0037] The mode of the final corrected label sequence of each data point is recorded as the final label value of each data point;
[0038] The data point whose final label value is the second preset value is recorded as an abnormal data point.
[0039] The present invention also proposes a data cleaning system based on machine learning, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned data cleaning method based on machine learning.
[0040] The beneficial effects of the technical solution of the present invention are:
[0041] In the embodiment of the present invention, within a preset time period, a PM2.5 concentration data time series sequence in the air is obtained; according to the size of the concentration data corresponding to the data point in the PM2.5 concentration data time series sequence, the initial label value of each data point in the PM2.5 concentration data time series sequence is obtained; it can identify abnormal values inconsistent with the change trend of most data points based on the clustering analysis of each data in the first-order difference sequence of all data points, and facilitate subsequent data analysis and visualization. Construct a window sequence segment corresponding to each data point in the PM2.5 concentration data time series sequence, and obtain the Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point; according to the Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point, obtain the similar data point of each data point; according to the analysis of the similar data points of each data point, it can obtain the change law of each data point in the PM2.5 concentration data time series sequence, effectively improving the accuracy of identifying abnormal data. According to the initial label value of each data point, a revised label sequence of each data point is formed; according to each label value in the revised label sequence of each data point, each label value in the revised label sequence of each similar data point of each data point, and the time interval between each data point and each similar data point of each data point, a weight coefficient of each similar data point of each data point is obtained; according to the analysis of each label value in the revised label sequence of each data point, the weight coefficient of each similar data point is determined, thereby further improving the accuracy of identifying abnormal data. According to the weight coefficient of each similar data point of each data point, a revised label value of each data point is obtained; according to the revised label value of each data point, several abnormal data points are screened out from all data points. So far, the present invention improves the accuracy of identifying abnormal data by continuously revising the label value of each data point, combined with the frequency of occurrence of each label value in the revised label sequence of each data point. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] 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.
[0043] Figure 1 This is a flow chart of the steps of a data cleaning method based on machine learning in the present invention. DETAILED DESCRIPTION
[0044] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a data cleaning method and system based on machine learning proposed by the present invention, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0045] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0046] The following is a detailed description of a data cleaning method and system based on machine learning provided by the present invention in conjunction with the accompanying drawings.
[0047] See also Figure 1 , which shows a flowchart of a data cleaning method based on machine learning provided by an embodiment of the present invention, the method comprising the following steps:
[0048] Step S001: Acquire a time series of PM2.5 concentration data in the air within a preset time period.
[0049] During a preset time period, a sensor is used to obtain a time series of PM2.5 concentration data in the air.
[0050] What needs to be explained is: the city center and the most densely populated area of a city are selected for air monitoring. The preset time period is the most recent 10 days, and the collection frequency is once every 6 seconds. This example is used for description.
[0051] Step S002: according to the size of the concentration data corresponding to the data point in the PM2.5 concentration data time series sequence, obtain the initial label value of each data point in the PM2.5 concentration data time series sequence.
[0052] There are only two possible labels for each data point in the PM2.5 concentration data time series, one is a normal data point and the other is an abnormal data point. Therefore, all data points in the PM2.5 concentration data time series can be divided into two categories.
[0053] According to the size of the concentration data corresponding to the data points in the PM2.5 concentration data time series, the K-means clustering algorithm is used to cluster the PM2.5 concentration data time series to obtain several clusters. The number of data points in each cluster is counted, and the initial label value of each data in the cluster with the largest number of data points is set to the first preset value, and the initial label value of each data in the cluster with the smallest number of data points is set to the second preset value.
[0054] It should be noted that there are relatively few abnormal data in the PM2.5 concentration data time series. The K-means clustering algorithm is a well-known technology, and the specific method is not introduced here. In this embodiment, the number of clusters set is 2, the first preset value is 1, and the second preset value is 0. This is used as an example for description. Therefore, the initial label value is 1, indicating that the data point is a normal data point, and the initial label value is 0, indicating that the data point is an abnormal data point.
[0055] Step S003: Construct a window sequence segment corresponding to each data point in the PM2.5 concentration data time series sequence, and obtain the Pearson correlation coefficient between each data point and all the data in the window sequence segment of each other data point; obtain similar data points for each data point based on the Pearson correlation coefficient between each data point and all the data in the window sequence segment of each other data point.
[0056] The initial label value of each data point is corrected by the performance of similar data points of each data point in the PM2.5 concentration data time series. Usually, data points with the same change trend have a certain correlation. Therefore, several similar data points of each data point are determined by the correlation between the window where the data point is located and the data between windows.
[0057] In the PM2.5 concentration data time series, a matrix with a length of centered at each data point is constructed. A linear window is constructed to obtain the window sequence segment corresponding to each data point.
[0058] In the PM2.5 concentration data time series, calculate the The Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point is obtained to obtain the correlation sequence of each data point with all other data ,in and as well as Respectively represent data points except data points, the first data point, the second data point, and the The Pearson correlation coefficient of all data in the window sequence segment corresponding to the data points.
[0059] It should be noted that: the linear window size preset in this embodiment is is 9, and this is used as an example. data points except The data points outside the window sequence segment The closer the Pearson correlation coefficient of all data in the window sequence segment corresponding to the data point is to 1, the data points except The data points outside the window sequence segment The greater the similarity between all data in the window sequence segment corresponding to the data point, the greater the similarity between all data in the window sequence segment corresponding to the data point. data points except The data points outside the window sequence segment The closer the Pearson correlation coefficient of all data in the window sequence segment corresponding to the data point is to 0, the data points except The data points outside the window sequence segment The smaller the similarity between all data in the window sequence segment corresponding to the data point, the smaller the similarity between all data in the window sequence segment corresponding to the data point. Among them, the Pearson correlation coefficient is a well-known technology, and the specific method is not introduced here.
[0060] Preset the first judgment threshold, Among the Pearson correlation coefficients of all data in the window sequence segment between the data point and all other data points, the other data points whose Pearson correlation coefficients are greater than the preset first judgment threshold are recorded as data points that are similar to the data points.
[0061] It should be noted that: the first judgment threshold preset in this embodiment is 0.75, and this is taken as an example for description.
[0062] Step S004: construct a revised label sequence for each data point based on the initial label value of each data point; obtain the weight coefficient of each similar data point of each data point based on each label value in the revised label sequence of each data point, each label value in the revised label sequence of each similar data point of each data point, and the time interval between each data point and each similar data point of each data point.
[0063] When correcting the initial label value of each data point in the PM2.5 concentration data time series, the corrected label value of each data point is usually determined based on the frequency of occurrence of the initial label values of similar data points of each data point, and the corrected label value of each data point is recorded. Finally, the frequency of occurrence of each label value in the corrected label sequence of each data point is calculated to classify the data points. Determining the corrected label value of each data point based solely on the frequency of occurrence of the label values of similar data points of each data point may result in inaccurate corrections. Therefore, further analysis should be performed in combination with the time series characteristics of each data point.
[0064] According to the characteristics that data points are data points with time series changes, there is a change relationship between data points, and the PM2.5 concentrations at the same time points are more likely to be close. By analyzing the stability of the label values of similar data points of each data point and the time periodicity of each data point and the corresponding similar data point, the weight coefficient of each similar data point of each data point is determined, and the updated label of the current data point is determined according to the weight assigned to the similar data points.
[0065] Based on the initial label value of each data point, a revised label sequence for each data point is constructed. For example, the revised label sequence for the first data point is ,in is the initial label value of the first data point.
[0066] It should be noted that the distribution relationship of the label value of each data point in the modified label sequence represents the stability of the label value of the data point, that is, if the label value of each data point appears continuously, it means that the data point tends to be more stable in the modified label sequence. Therefore, the stability of each similar data point of each data point can be analyzed by the average continuous length of the label value in the modified label sequence of the data point.
[0067] First The data point For example, the first The data point The calculation formula for the stability of the label value of similar data points being the first preset value and the stability of the label value being the second preset value is:
[0068]
[0069]
[0070] in, Indicates The data point The label value of similar data points is the stability of the first preset value, Indicates The data point The label value of similar data points is the stability of the second preset value, Indicates The data point The number of label values in the corrected label sequence of similar data points whose label values are the first preset value, Indicates The data point The number of sequence segments consisting of consecutive label values that are the same as the first preset value in the corrected label sequence of similar data points, Indicates The data point The number of label values in the corrected label sequence of similar data points with the second preset value, Indicates The data point The number of sequence segments consisting of consecutive label values that are the same as the second preset value in the modified label sequence of similar data points.
[0071] What needs to be explained is: Indicates The data point The average continuous length of similar data points when the label value is the first preset value, that is, The data point The label value of similar data points is the stability of the first preset value. Indicates The data point The number of sequence segments consisting of consecutive label values that are the same as the second preset value in the corrected label sequence of similar data points. The data point The corrected label sequence of similar data points is 001100010010001, wherein the number of sequence segments consisting of consecutive label values that are the same as the second preset value is 4, and the number of sequence segments consisting of consecutive label values that are the same as the first preset value is 4.
[0072] The first The data point The maximum value of the stability of the label value of the similar data point at the first preset value and the stability of the label value at the second preset value is recorded as The data point The final stability of similar data points.
[0073] Each data point in the PM2.5 concentration data time series may have a periodic change relationship. Specifically, the same time point within a few days may have similar PM2.5 concentrations. Therefore, by analyzing the relationship between the time periodicity of each data point and each corresponding similar data point, the time periodicity of each data point and each corresponding similar data point can be determined.
[0074] First The data point For example, the first The data point Similar data points to The calculation formula for the time periodicity of a data point is:
[0075]
[0076] in, Indicates The data point Similar data points to The time periodicity of the data points, Indicates Data points and The data point The remainder of the time interval between similar data points divided by the preset time length.
[0077] What needs to be explained is: Indicates Data points and The data point The remainder of the time interval between similar data points divided by the preset time length. The closer the remainder is to 0, the closer the remainder is to 0. The data point Similar data points to The greater the time periodicity of the data points, the greater the time periodicity of each data point in the PM2.5 concentration data time series sequence has a time series characteristic, and the adjacent data points may have a change relationship, and the PM2.5 concentration at the same time of each day is more likely to be close. Therefore, according to the time interval between each data point and each similar data point, the time periodicity of each data point and each corresponding similar data point is determined. The denominator is added by 1 to prevent the denominator from being 0. In this embodiment, the preset time length is 24 hours, which is described as an example.
[0078] According to the above method, this embodiment can obtain the first All similar data points of the data point and The time periodicity of the data points.
[0079] First The data point For example, the first The data point The calculation formula for the weight coefficient of similar data points is:
[0080]
[0081] in, Indicates The data point The weight coefficient of similar data points, Indicates The data point The final stability of similar data points, Indicates The data point Similar data points to The time periodicity of the data points.
[0082] According to the above method, this embodiment can obtain the first The weight coefficients of all similar data points of the data point.
[0083] Step S005: Obtain a corrected label value for each data point based on the weight coefficient of each similar data point of each data point; and select a number of abnormal data points from all data points based on the corrected label value of each data point.
[0084] Similar data points with the same label value are weighted according to the weight coefficients of all similar data points to obtain the possibility that the label value of each data point is the second preset value and the label value is the first preset value.
[0085] First For example, the first data point The calculation formula for the probability that the label value of a data point is the second preset value and the label value is the first preset value is:
[0086]
[0087]
[0088] in, Indicates The probability that the label value of a data point is the second preset value, Indicates The probability that the label value of a data point is the first preset value, Indicates The first of all similar data points whose label value is the second preset value The weight coefficient of similar data points, Indicates The first data point among all similar data points of the data point with the label value of the first preset value The weight coefficient of similar data points, Indicates The number of similar data points whose label value is the second preset value among all similar data points of data points, Indicates The number of similar data points whose label value is the first preset value among all similar data points of the data point.
[0089] According to the above manner, this embodiment can obtain the possibility that the label value of each data point is the second preset value and the label value is the first preset value.
[0090] The first The label value of the data point is the largest label value among the possibilities of the second preset value and the first preset value, recorded as Corrected label value for each data point.
[0091] Add the corrected label value of each data point to the corrected label sequence of each data point. For example, the corrected label sequence of the first data point after addition is ,in, represents the initial label value of the first data point, Indicates the revised label value for the second data point.
[0092] According to the method of obtaining the corrected label value of each data point, the corrected label value of each data point is iteratively corrected until the number of iterations is equal to Stop when.
[0093] The corrected label value of each data point at each iteration is sequentially added to the corrected label sequence of each data point to obtain the final corrected label sequence of each data point.
[0094] It should be noted that each data point has a final revised label sequence. For example, the final revised label sequence of the first data point is ,in, as well as They represent the initial label value, the revised label value, the second revised label value, and the The number of correction label values is set as follows. The value is 30, and this is used as an example for description.
[0095] The mode of the final corrected label sequence for each data point is recorded as the final label value of each data point.
[0096] The data points whose final label values are the second preset values are recorded as abnormal data points, and a number of abnormal data points are screened out from all the data points.
[0097] It should be noted that the data points whose final label value is the second preset value are abnormal data points. Abnormal data points may be caused by emission problems from certain pollution sources. Analyzing these data can help track pollution sources, conduct relevant supervision and investigation work, and take measures to reduce pollutant emissions.
[0098] So far, the present invention is completed.
[0099] In summary, in an embodiment of the present invention, within a preset time period, a time series sequence of PM2.5 concentration data in the air is obtained; according to the size of the concentration data corresponding to the data point in the time series sequence of PM2.5 concentration data, an initial label value of each data point in the time series sequence of PM2.5 concentration data is obtained; a window sequence segment corresponding to each data point in the time series sequence of PM2.5 concentration data is constructed, and the Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point is obtained; according to the Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point, similar data points of each data point are obtained; according to the initial label value of each data point, a revised label sequence of each data point is constructed; according to each label value in the revised label sequence of each data point, each label value in the revised label sequence of each similar data point of each data point, and the time interval between each data point and each similar data point of each data point, a weight coefficient of each similar data point of each data point is obtained; according to the weight coefficient of each similar data point of each data point, a revised label value of each data point is obtained; according to the revised label value of each data point, a number of abnormal data points are screened out from all data points. Thus, the present invention improves the accuracy of identifying abnormal data by continuously correcting the label value of each data point and combining the frequency of occurrence of each label value in the corrected label sequence of each data point.
[0100] The present invention also provides a data cleaning system based on machine learning, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned data cleaning method based on machine learning.
[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A data cleaning method based on machine learning, characterized in that: The method comprises the following steps: Acquire the PM2.5 concentration data time series in the air within a preset time period; According to the size of the concentration data corresponding to the data point in the PM2.5 concentration data time series, the initial label value of each data point in the PM2.5 concentration data time series is obtained; Construct a window sequence segment corresponding to each data point in the PM2.5 concentration data time series, and obtain the Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point; obtain similar data points of each data point based on the Pearson correlation coefficient of each data point with all the data in the window sequence segment of each other data point; According to the initial label value of each data point, a revised label sequence of each data point is formed; according to each label value in the revised label sequence of each data point, each label value in the revised label sequence of each similar data point of each data point, and the time interval between each data point and each similar data point of each data point, a weight coefficient of each similar data point of each data point is obtained; According to the weight coefficient of each similar data point of each data point, a corrected label value of each data point is obtained; according to the corrected label value of each data point, several abnormal data points are screened out from all data points; The step of obtaining the weight coefficient of each similar data point of each data point according to each label value in the corrected label sequence of each data point, each label value in the corrected label sequence of each similar data point of each data point, and the time interval between each data point and each similar data point of each data point includes the following specific steps: According to each label value in the corrected label sequence of each data point and each label value in the corrected label sequence of each similar data point of each data point, the stability of the label value of each similar data point of each data point being a first preset value and the stability of the label value being a second preset value are obtained; The first The data point The maximum value of the stability of the label value of the similar data point at the first preset value and the stability of the label value at the second preset value is recorded as The data point The final stability of similar data points; According to the time interval between each data point and each similar data point of each data point, the time periodicity between each data point and each similar data point of each data point is obtained; The product of the final stability of each similar data point of each data point and the time periodicity of each data point and each similar data point of each data point is recorded as the weight coefficient of each similar data point of each data point; According to each label value in the corrected label sequence of each data point and each label value in the corrected label sequence of each similar data point of each data point, the specific calculation formula for obtaining the stability of the label value of each similar data point of each data point as the first preset value and the stability of the label value as the second preset value is: in, Indicates The data point The label value of similar data points is the stability of the first preset value, Indicates The data point The label value of similar data points is the stability of the second preset value, Indicates The data point The number of label values in the corrected label sequence of similar data points whose label values are the first preset value, Indicates The data point The number of sequence segments consisting of consecutive label values that are the same as the first preset value in the corrected label sequence of similar data points, Indicates The data point The number of label values in the corrected label sequence of similar data points with the second preset value, Indicates The data point The number of sequence segments consisting of consecutive label values that are the same as the second preset value in the corrected label sequence of similar data points; The specific calculation formula for obtaining the time periodicity between each data point and each similar data point of each data point according to the time interval between each data point and each similar data point of each data point is: in, Indicates The data point Similar data points to The time periodicity of the data points, Indicates Data points and The data point The remainder of the time interval between similar data points divided by the preset time length.
2. According to the data cleaning method based on machine learning in claim 1, it is characterized in that: The method of obtaining the initial label value of each data point in the PM2.5 concentration data time series according to the size of the concentration data corresponding to the data point in the PM2.5 concentration data time series includes the following specific steps: According to the size of the concentration data corresponding to the data points in the PM2.5 concentration data time series, the K-means clustering algorithm is used to cluster the PM2.5 concentration data time series to obtain several clusters; The number of data points in each cluster is counted, and the initial label value of each data in the cluster with the largest number of data points is set to a first preset value, and the initial label value of each data in the cluster with the smallest number of data points is set to a second preset value.
3. The data cleaning method based on machine learning according to claim 1, characterized in that: The specific steps of obtaining similar data points of each data point according to the Pearson correlation coefficient of each data point with all data in the window sequence segment of each other data point are as follows: In the Among the Pearson correlation coefficients of all data in the window sequence segment between the data point and all other data points, the other data points whose Pearson correlation coefficients are greater than the preset first judgment threshold are recorded as data points that are similar to the data points.
4. The data cleaning method based on machine learning according to claim 1, characterized in that: The specific steps of obtaining the corrected label value of each data point according to the weight coefficient of each similar data point of each data point are as follows: According to the weight coefficient of each similar data point of each data point, the possibility of obtaining the label value of each data point being the second preset value and the label value being the first preset value; The first The label value of the data point is the largest label value among the possibilities of the second preset value and the first preset value, recorded as Corrected label value of data points; The specific calculation formula for obtaining the possibility that the label value of each data point is the second preset value and the label value is the first preset value according to the weight coefficient of each similar data point of each data point is: in, Indicates The probability that the label value of a data point is the second preset value, Indicates The probability that the label value of a data point is the first preset value, Indicates The first of all similar data points whose label value is the second preset value The weight coefficient of similar data points, Indicates The first data point among all similar data points of the data point with the label value of the first preset value The weight coefficient of similar data points, Indicates The number of similar data points whose label value is the second preset value among all similar data points of data points, Indicates The number of similar data points whose label value is the first preset value among all similar data points of the data point.
5. The data cleaning method based on machine learning according to claim 1, characterized in that: The specific steps of screening out a number of abnormal data points from all data points according to the corrected label value of each data point are as follows: Add the corrected label value of each data point to the corrected label sequence of each data point, and iteratively correct the corrected label value of each data point according to the method of obtaining the corrected label value of each data point until the number of iterations is equal to Stop when , and get the final corrected label sequence for each data point, where is a preset quantity threshold; The mode of the final corrected label sequence of each data point is recorded as the final label value of each data point; The data point whose final label value is the second preset value is recorded as an abnormal data point.
6. A data cleaning system based on machine learning, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by a processor, the steps of a data cleaning method based on machine learning are implemented as described in any one of claims 1 to 5.
