A method for obtaining automatic feature engineering for structured data in a time series arrangement
By using automatic feature engineering methods, new features containing historical information are generated through inter-group and temporal feature transformation operations. This solves the problem of unutilized feature relationships in time-series structured data and improves the predictive performance of machine learning algorithms.
Patent Information
- Application Number
- CN202411313477.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-09-20
AI Technical Summary
Existing automated feature engineering methods fail to effectively utilize structured data with temporal relationships, resulting in inadequate performance of machine learning algorithms on evaluation metrics.
An automatic feature engineering approach is adopted, which generates new features containing historical information through inter-group and temporal feature transformation operations, combined with a policy network and a temporal convolutional network. The feature transformation operation is optimized using a proximal optimization strategy to improve the performance of the machine learning algorithm.
It improves the performance of machine learning algorithms on time-series structured data, especially significantly improving prediction accuracy in classification and regression tasks.
Smart Images

Figure CN119202647B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computers and machine learning, and in particular to a method for automatic feature engineering of structured data arranged in time sequence. Background Technology
[0002] Over the past few decades, research tasks surrounding structured data (also known as tabular data) have proliferated, significantly advancing several domain-specific tasks such as fraud detection, risk management, advertising recommendation, and marketing technology. A common characteristic of these is that they involve a complete machine learning pipeline built upon structured data.
[0003] Automated feature engineering plays a crucial role in a complete machine learning pipeline built upon structured data. By automatically identifying and constructing the most valuable features from raw data through algorithms, it significantly reduces the time and effort required for manual feature selection and construction. Automated feature selection and construction allow for more accurate capture of information from structured data, thereby improving the accuracy and generalization ability of machine learning algorithms. Good features are the foundation of a complete machine learning pipeline, and automated feature engineering helps improve the performance of machine learning algorithms across various evaluation metrics.
[0004] However, previous automated feature engineering focused on structured data where there were no clear relationships between samples. By analyzing the complex relationships between features, new extended features were generated using different features from a single sample, improving the performance of machine learning algorithms on various evaluation metrics of the new feature set. This invention focuses on feature engineering operations on structured data where samples exhibit temporal relationships. Specifically, it deals with structured data sampled at regular time intervals, where the data samples are arranged chronologically with equal time intervals between different samples. For such data, extracting information from historical samples to construct new features is necessary to better improve the performance of machine learning algorithms on various evaluation metrics.
[0005] This invention addresses the shortcomings of existing technologies by proposing an automatic feature engineering method for time-series structured data. While using different feature combinations to form new features, it simultaneously constructs time series data using features from historical samples, generating features containing historical information. This invention targets structured data where there are clear time-series relationships between samples; specifically, these data sets contain sampling information from different samples at equal time intervals. Summary of the Invention
[0006] The Automated Feature Engineering (AutoFE) of this invention aims to automate this process. Given a dataset D containing original features X and target variable Y, a pre-selected learning algorithm L, and a performance evaluation metric E, the goal of Automated Feature Engineering is to find a feature transformation operation plan T that transforms the original feature set X into a new feature set through a series of feature transformation operations. This allows the learning algorithm L to be used on the new feature set. The model trained above reaches its maximum value on the performance evaluation metric E.
[0007] This invention is achieved through the following technical solution: A method for automatically obtaining feature engineering for structured data arranged in time sequence is provided, the method comprising the following steps:
[0008] (1) Obtain tabular data X that shows the temporal relationship between samples; where X is a two-dimensional table, with different feature columns in the vertical direction and different samples in the horizontal direction, and adjacent sampling times are spaced at the same time interval.
[0009] (2) Calculate the action probability of feature transformation operations for each feature using an automatic feature engineering strategy network;
[0010] (3) Sample multiple automatic feature engineering plans based on the action probabilities of different feature transformation operations; use the automatic feature engineering plans to generate several tables containing extended features;
[0011] (4) Evaluate the pre-selected machine learning on each table with extended features, record the automatic feature engineering plan that generates the table with extended features that has the best pre-selected evaluation metrics, and calculate the reward by weighting the pre-selected evaluation metrics on all tables.
[0012] (5) Iteratively use the optimized strategy network to sample feature engineering plans, calculate rewards, record the feature engineering plan with the best pre-selected evaluation index, and optimize the strategy network until multiple iterations fail to obtain a feature engineering plan with a better pre-selected evaluation index or the number of iterations is reached.
[0013] (6) Use the weighted average of the evaluation metrics of the k-fold cross-validation of the pre-selected machine learning algorithm on each validation set containing extended features as the reward, and use the proximal optimization strategy PPO to optimize the policy network so that the policy network gives a better feature transformation operation set in terms of the evaluation metrics of the pre-selected machine learning algorithm. Repeat steps (1) to (5) until the feature engineering plan with the best evaluation metrics obtained during the iteration process is output.
[0014] Specifically, the feature transformation operation in step (2) includes a feature transformation function and the input features of the transformation function.
[0015] Furthermore, the policy network in step (2) includes an inter-group policy network and a temporal policy network, specifically:
[0016] The inter-group feature policy network is used to calculate the probability of inter-group feature transformation operation on each feature. The inter-group feature transformation operation refers to the feature transformation operation that uses the inter-group feature transformation function to apply the inter-group feature transformation operation to the feature and several other features as input features.
[0017] The temporal feature strategy network is used to calculate the probability of temporal feature transformation operation; the temporal feature transformation operation refers to the temporal feature transformation operation on the feature of the temporal feature transformation function, specifically, it is to treat a sample of a fixed-length time window on the feature on which the temporal feature transformation operation is applied as a time series, and use the temporal feature function that extracts a feature value from the time series to extract the temporal feature of the feature.
[0018] Furthermore, the inter-group feature policy network adopts the policy network of the FETCH automatic feature engineering framework, including a dense layer, a multi-head attention layer, an action decoding layer, and a softmax layer. The dense layer is a fully convolutional network that transforms 1xm feature vectors in structured data into fixed-length feature vectors, reducing the dimensionality of the feature vectors. At the same time, a fully convolutional network with the same weights is used to reduce the dimensionality of feature vectors of different features, ensuring the effectiveness of the dimensionality reduction operation for new extended features. The multi-head attention layer extracts the relationships between table features. It first uses the feature vectors after dimensionality reduction by the dense layer to calculate the attention matrix, mines the interrelationships between features in the table, encodes the relationship between feature columns, and uses the attention matrix to perform a linear transformation on the feature vector group to obtain a feature vector that can reflect the relationship between other features. Then, the feature vector obtained by an attention layer containing an action decoding layer and a softmax layer is transformed into the probability of specific feature transformation operations.
[0019] Furthermore, the temporal policy network adds a temporal information extraction module before the dense layer of the policy network in the FETCH framework. This module includes a TCN layer, a dense layer, a multi-head attention layer, an action decoding layer, and a softmax layer. The temporal information extraction module is a temporal convolutional network (TCN) module, i.e., the TCN layer. The TCN uses causal convolution to perform convolution operations only on historical data, ensuring that the output at any given time point depends only on information prior to that time point. The TCN uses dilated convolutions that skip parts of the input, allowing the model to increase its receptive field and expand the range of input sequences that the model can observe while keeping the number of parameters constant.
[0020] Furthermore, the inter-group feature transformation operation on the feature refers to the feature transformation operation that uses the feature or the feature and other features as input features by using an inter-group feature transformation function; the feature transformation function includes unary feature transformation function and binary feature transformation function;
[0021] Feature transformation functions between unary tuples include: tanh, square, inverse, log, sqrt, and sigmoid value transformation functions;
[0022] Feature transformation functions between tuples include: addition, subtraction, multiplication, division, and combination arithmetic functions;
[0023] For an inter-group feature transformation operation on a feature, if its feature transformation function is a unary inter-group feature transformation function, then the feature is the input feature of the transformation function; if its feature transformation function is a binary inter-group feature transformation function that requires two input features, then the feature is used as the first input feature of the transformation function, and the other features are used as the second input features of the transformation function. Different second input features correspond to different feature transformation operations. That is, a binary inter-group feature transformation function has n-1 inter-group transformation operations on a feature.
[0024] Furthermore, the temporal feature transformation operation on the feature refers to the operation of extracting temporal features by taking a sample of a fixed-length time window on the feature as a time series and using a temporal feature function that extracts a feature value from a time series; the temporal feature transformation function is all the temporal feature functions in the EfficientFCParameters class in the Python library tsfresh0.20.1, with a total of 784 candidate temporal feature transformation functions.
[0025] Furthermore, the sampling in step (3) specifically involves: selecting a multinomial sampling method, during which multiple feature transformation operation sets (t1, t3, ... t) are sampled for the features. e ), used to fully explore the feature space, where e is the number of feature transformation operation sets for each sample, one of which includes an inter-group feature transformation operation and a temporal feature transformation operation on each feature sample.
[0026] Further, step (4) specifically involves replacing table X with a table containing extended features, continuing the operations from step (2) to step (4), obtaining a table containing second-order extended features, iterating to obtain a table containing higher-order extended features, and setting the highest order of the extended features; the higher-order extended features refer to features that use feature transformation operations on extended features, wherein the extended features generated by using the original features through feature transformation operations are first-order extended features, and the features generated by using i-order extended features through feature transformation operations are called i+1-order features; in the process of iteratively generating tables containing higher-order extended features, each table containing extended features only samples and selects one set of feature transformation operations, so that when generating higher-order features each time, a total of e feature sets are still sampled and selected.
[0027] Furthermore, in step (6), when selecting a set of feature transformation operations with better pre-selected machine learning algorithm evaluation metrics, for classification tasks, the pre-selected machine learning algorithms are selected from linear support vector machines, logistic regression, random forests, gradient boosting trees (XGBOOST), and light gradient boosting trees (LightGBM); for regression tasks, the pre-selected machine learning algorithms are selected from linear support vector machines, linear regression, random forests, gradient boosting trees, and light gradient boosting trees; the pre-selected evaluation metric E for classification tasks is the F1-score, and its calculation formula is as follows:
[0028]
[0029] Where TP represents the number of true positives, i.e. the number of instances that the model correctly predicts as positive; FP represents the number of false positives, i.e. the number of instances that the model incorrectly predicts as positive; and FN represents the number of false negatives, i.e. the number of instances that the model incorrectly predicts as negative.
[0030] Then, substitute these values into the formula for the F1 score to calculate the model's performance metrics.
[0031] The pre-selected evaluation index for regression tasks is 1 - relative absolute error rae, and its calculation formula is as follows:
[0032]
[0033] in, y represents the predicted value of the label, and y represents the actual value of the label. This represents the average of the actual values of the labels.
[0034] The beneficial effects of this method are as follows:
[0035] This invention breaks through the assumption in previous automatic feature engineering of structured data that the arrangement of structured data samples does not affect the prediction of structured data. It focuses on structured data arranged chronologically, where the order of samples contains important information. While constructing new features using different features on chronologically arranged structured data, it also constructs chronological features using historical sample data. This solves the problems of previous feature engineering on structured data not considering the impact of sample data on prediction performance, and automatic feature engineering on chronological data lacking consideration of the mutual influence of different features. Using this method to construct new features on chronologically arranged structured data helps to grasp the relationship between different features and historical data, improving the performance of various pre-selected machine learning metrics in the pre-selected machine learning algorithm. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the process in this invention;
[0037] Figure 2 This is a schematic diagram of the automatic feature engineering technology framework used in this invention;
[0038] Figure 3 This is a schematic diagram of the inter-group strategy network of the present invention;
[0039] Figure 4 This is a schematic diagram of the timing strategy network for this aspect. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0041] Automated Feature Engineering (AutoFE) aims to automate the process of feature transformation. Given a dataset D containing original features X and target variable Y, a pre-selected learning algorithm L, and a performance evaluation metric E, the goal of AutoFE is to find a feature transformation operation plan T that transforms the original feature set X into a new feature set through a series of feature transformation operations. This allows the learning algorithm L to be used on the new feature set. The model trained above reaches its maximum value on the performance evaluation metric E. For example... Figure 1 As shown, this invention provides a method for automatic feature engineering of structured data arranged in time sequence, which mainly consists of the following steps:
[0042] Step 1: Obtain tabular data X showing the temporal relationship between samples, where X is a two-dimensional m×n table with vertical columns (c1, c2, ..., cn). n Composed of different feature columns, where c i This is the i-th feature, and n is the number of features. The vertical axis consists of (s1,…s…) m Different sample compositions, s i The samples are taken at time i, where m is the number of samples. Adjacent sampling times are spaced out by the same amount of time.
[0043] Step Two: As Figure 2 As shown, this invention uses an automatic feature engineering framework to extract features from time-series data and calculates the reward for feature extraction. This automatic feature engineering framework includes a policy network, sampling actions, feature extraction, and a downstream machine learning model. The specific operations for extracting features and calculating rewards using the automatic feature engineering framework are as follows:
[0044] Step 2.1. Use the automatic feature engineering strategy network to calculate the action probability of different feature transformation operations for each feature, use the inter-group feature strategy network to calculate the probability of each inter-group feature transformation operation for each feature, and use the temporal feature strategy network to calculate the probability of each temporal feature transformation operation for each feature.
[0045] Specifically, the feature transformation operation includes a feature transformation function and the input features of the transformation function;
[0046] Specifically, an inter-group feature transformation operation on a single feature refers to a feature transformation operation that uses an inter-group feature transformation function to transform the feature or the feature along with other features as input features. The feature transformation function includes unary feature transformation functions and binary feature transformation functions.
[0047] Feature transformation functions between unary tuples include: tanh, square, inverse, log, sqrt, sigmoid, and other equivalent transformation functions;
[0048] Feature transformation functions between tuples include combination arithmetic functions such as addition, subtraction, multiplication, division, and combination.
[0049] Specifically, for an inter-group feature transformation operation on a feature, if its feature transformation function is a unary inter-group feature transformation function, then that feature is the input feature of the transformation function; if its feature transformation function is a binary inter-group feature transformation function that requires two input features, then that feature is used as the first input feature of the transformation function, and other features are used as the second input features of the transformation function. Different second input features correspond to different feature transformation operations. That is to say, a binary inter-group feature transformation function has n-1 inter-group transformation operations on a feature.
[0050] Specifically, a temporal feature transformation operation on a feature refers to treating a sample of a fixed-length time window on that feature as a time series and using a temporal feature function that extracts a feature value from a time series to extract temporal features.
[0051] The candidate time series feature transformation functions for this method are all the time series feature functions in the EfficientFCParameters class of the Python library tsfresh0.20.1, totaling 784 candidate time series feature transformation functions.
[0052] Step 2.2: The sampling process yields multiple feature transformation operation sets. The sampling method chosen in this method is multinomial sampling. During the sampling process, multiple feature transformation operation sets (t1, t3, ... t) are sampled for each feature. e ) is used to fully explore the feature space, and e is the number of feature transformation operation sets for each sample. One of the feature transformation operation sets includes an inter-group feature transformation operation and a temporal feature transformation operation on each feature sample.
[0053] Step 2.3: Extract Extended Features from the Sampled Feature Operation Set. Step 3: Each feature transformation operation set selected in the sampling will generate a table containing extended features. Each feature engineering operation in the feature transformation operation set will generate a feature for each sample. When using the inter-group feature engineering operation to generate an extended feature for a sample, the input feature of the component feature engineering operation on that sample will be used directly, and the feature transformation function of the inter-group feature engineering operation will be called to generate a new extended feature. When using a time-series feature engineering operation to generate an extended feature for a sample, a time series will be constructed using the sample and the input feature of the time-series feature engineering operation on a continuous historical sample of that sample, and an extended feature for that sample will be calculated using the time feature transformation function.
[0054] Step 2.4: Transfer the table X containing extended features 1,1 ,…X 1,e Replacing table X, continue with steps 2.1 to 2.3 to obtain table X containing second-order extended features. 2,1 ,…X2,e Iteration yields a table X containing higher-order extended features. i,1 , ...X p,q , ...X k,e k is the highest order of the extended features; the higher-order extended features refer to features that have undergone feature transformation operations on the extended features. The extended features generated by the feature transformation operation using the original features are called first-order extended features, and the features generated by the feature transformation operation using the i-th-order extended features are called i+1-th-order features. In the process of iteratively generating tables containing higher-order extended features, each table containing extended features only samples one set of feature transformation operations. In this way, when generating higher-order features each time, a total of e feature sets are still sampled.
[0055] Step 2.5: Calculate the reward on the downstream machine learning model using the multi-level extended feature table obtained in steps 2.1 to 2.5. Use the extended feature table X generated by the feature transformation operation obtained in step 5. 1,1 , ...X p,q , ...X k,e The training set is used to train the downstream machine learning model, and the performance of the machine learning algorithm on the test set is evaluated using pre-selected evaluation metrics. The evaluation metrics for each validation set containing an extended feature table and the sequence of feature transformation operations generated for them are recorded. The extended feature table X is generated... p,q The automatic feature engineering plan refers to the iterative generation of X in step five. p,1 To X p,q The feature engineering plan, which consists of the selected set of feature transformation operations, can be used to transform table X into X by sequentially operating on the feature sets within the feature engineering plan. p,q .
[0056] Step 3: Use the weighted average of the evaluation metrics of k-fold cross-validation of the pre-selected machine learning algorithm on each validation set containing extended feature tables as the reward, and use the Proximal Optimization (PPO) strategy to optimize the policy network so that the policy network can provide a better set of feature transformation operations on the evaluation metrics of the pre-selected machine learning algorithm.
[0057] Specifically, for classification tasks, the pre-selected machine learning algorithm L in this method is selected from linear support vector machine, logistic regression, random forest, gradient boosting tree (XGBOOST), and light gradient boosting tree (LightGBM); for regression tasks, the pre-selected machine learning algorithm L in this method is selected from linear support vector machine, linear regression, random forest, gradient boosting tree, and light gradient boosting tree.
[0058] The pre-selected evaluation metric E for this method on classification tasks is the F1-score, which is calculated as follows:
[0059]
[0060] Here, TP represents the number of true positives, i.e., the number of instances correctly predicted as positive by the model. FP represents the number of false positives, i.e., the number of instances incorrectly predicted as positive by the model. FN represents the number of false negatives, i.e., the number of instances incorrectly predicted as negative by the model.
[0061] Then, by substituting these values into the formula for the F1 score, the performance index of the model can be calculated.
[0062] The pre-selected evaluation index for the regression task in this method is 1 - relative absolute error (rae), and its calculation formula is as follows:
[0063]
[0064] in, y represents the predicted value of the label, and y represents the actual value of the label. This represents the average of the actual values of the labels.
[0065] Step 4: Repeat steps 2 to 4 until the set number of iterations is reached or multiple iterations fail to find a better feature engineering plan for the pre-selected machine learning algorithm's pre-selected evaluation metric. The feature engineering plan with the best pre-selected evaluation metric for the pre-selected machine learning algorithm during the iteration process is given as the feature transformation operation sequence found by automatic feature engineering. A new set of structured data containing the same features can use this feature engineering plan to generate extended features, improving the value of the pre-selected machine learning algorithm's pre-selected evaluation metric.
[0066] Furthermore, such as Figure 3 As shown, the policy network used in step 2.1 to calculate the probability of inter-group feature transformation operations uses the same policy network as the FETCH framework. It consists of four parts: a dense layer, an attention layer, an action decoding layer, and a softmax layer. The dense layer is a fully convolutional network that transforms the 1xm feature vectors in the structured data into fixed-length feature vectors, reducing the dimensionality of the feature vectors. At the same time, a fully convolutional network with the same weights is used to reduce the dimensionality of feature vectors of different features, ensuring the effectiveness of the dimensionality reduction operation for new extended features. The multi-head attention layer extracts the relationships between table features. It first uses the feature vectors after dimensionality reduction by the dense layer to calculate the attention matrix, mining the complex interrelationships between features in the table and encoding the relationship between feature columns. Then, it uses the attention matrix to perform a linear transformation on the feature vector group to obtain a feature vector that can reflect the relationship between other features. Finally, a feature vector containing an action decoding layer and a softmax layer is used to transform the feature vectors obtained by the attention layer into the probability of specific feature transformation operations.
[0067] Furthermore, such as Figure 4 As shown, the policy network used to calculate the temporal feature transition probability in step 2.1 uses the FETCH framework policy network, with a temporal information extraction module added before the dense layers of the FETCH framework policy network. The module used in this method to extract temporal information is the Temporal Convolutional Network (TCN) module. TCN uses causal convolution to perform convolution operations only on historical data, ensuring that the output at any given time point depends only on information prior to that time point. TCN uses dilated convolutions that skip parts of the input, allowing the model to increase its receptive field while keeping the number of parameters constant, thus expanding the range of input sequences that the model can observe.
[0068] The following embodiments use the same hyperparameters for the policy network, where the feature vector dimension after dimensionality reduction is 128, the TCN convolution kernel size is 2, and the Q, K, and V vectors in the multi-head attention mechanism have a dimension of 32 (6 heads in total). After passing through the multi-head attention layer, the feature vector dimension is 64. The maximum number of search iterations is set to 300, and the proximal optimization strategy (PPO) is used for 10 iterations per iteration. The Adam optimizer is used to train the agent. Each time a higher-order extended feature is generated, the number of sampled feature transformation operations is 4, and the highest order of the sampled extended features is 3. The learning rate is 0.001.
[0069] This invention uses the Room Occupancy Estimation dataset for feature engineering operations, which is a structured dataset containing 16 initial features: <S1_Temp,S2_Temp,S3_Temp,S4_Temp,S1_Light,S2_Light,S3_Light,S4_Light,S1_Sound,S2_Sound,S3_Sound,S4_Sound,S5_CO2,S5_CO2_Slope,S6_PIR,S7_PIR> A classification task to predict the number of people in a room (Room_Occupancy_Count).
[0070] In a practical example of this invention, the following steps are performed:
[0071] (A) The policy network is used to sample feature transformation operation sets for the dataset K times. In each iteration, E feature transformation operation sets are sampled and combined to obtain E tables, each containing extended features. A total of K×E tables containing extended features are obtained, along with an automatic feature plan for generating these tables from the original tables.
[0072] (B) The LightGBM algorithm is used to compute F1-scores on these datasets, rewards are calculated based on the computation results, feature engineering plans with high F1-scores are recorded, and the policy network is optimized using the PPO algorithm.
[0073] (C) Iterate through the optimized policy network to sample feature engineering plans, calculate rewards, record feature engineering plans with high F1-scores, and optimize the policy network until a feature engineering plan with a higher F1-score cannot be found in 10 iterations or the number of iterations reaches 300.
[0074] In this embodiment, a subset of the new feature set is constructed that can improve the F1-score of the LightGBM algorithm in this classification task from 0.925 to 0.988.
[0075] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0076] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A method for automatic feature engineering of structured data arranged in time sequence, characterized in that, The method includes the following steps: (1) Obtain tabular data X that shows the temporal relationship between samples; where X is a two-dimensional table, with different feature columns in the vertical direction and different samples in the horizontal direction, and adjacent sampling times are spaced at the same time interval. (2) The action probability of feature transformation operations for each feature is calculated using an automatic feature engineering strategy network; the feature transformation operation includes a feature transformation function and the input features of the transformation function; the strategy network includes an inter-group feature strategy network and a temporal feature strategy network, specifically: The inter-group feature policy network is used to calculate the probability of inter-group feature transformation operation on each feature. The inter-group feature transformation operation refers to the feature transformation operation that uses the inter-group feature transformation function to apply the inter-group feature transformation operation to the feature and several other features as input features. The temporal feature strategy network is used to calculate the probability of temporal feature transformation operation; the temporal feature transformation operation refers to the temporal feature transformation operation on the feature of the temporal feature transformation function, specifically, it is to treat a sample of a fixed-length time window on the feature on which the temporal feature transformation operation is applied as a time series, and use the temporal feature function that extracts a feature value from the time series to extract the temporal feature of the feature. (3) Sample multiple automatic feature engineering plans based on the action probabilities of different feature transformation operations; use the automatic feature engineering plans to generate several tables containing extended features; (4) Evaluate the pre-selected machine learning on each table with extended features, record the automatic feature engineering plan that generates the table with extended features that has the best pre-selected evaluation metrics, and calculate the reward by weighting the pre-selected evaluation metrics on all tables. (5) Iteratively use the optimized strategy network to sample feature engineering plans, calculate rewards, record the feature engineering plan with the best pre-selected evaluation index, and optimize the strategy network until multiple iterations fail to obtain a feature engineering plan with a better pre-selected evaluation index or the number of iterations is reached. (6) Use the weighted average of the evaluation metrics of the k-fold cross-validation of the pre-selected machine learning algorithm on each validation set containing extended features as the reward, and use the proximal optimization strategy PPO to optimize the policy network so that the policy network gives a better feature transformation operation set in terms of the evaluation metrics of the pre-selected machine learning algorithm. Repeat steps (1) to (5) until the feature engineering plan with the best evaluation metrics obtained during the iteration process is output.
2. The method for automatic feature engineering of structured data arranged in time sequence according to claim 1, characterized in that, The inter-group feature policy network adopts the policy network of the FETCH automatic feature engineering framework, including a dense layer, a multi-head attention layer, an action decoding layer, and a softmax layer. The dense layer is a fully convolutional network that transforms 1xm feature vectors in structured data into fixed-length feature vectors, reducing the dimensionality of the feature vectors. At the same time, a fully convolutional network with the same weights is used to reduce the dimensionality of feature vectors of different features, ensuring the effectiveness of the dimensionality reduction operation for new extended features. The multi-head attention layer extracts the relationships between table features. It first uses the feature vectors reduced by the dimensionality of the dense layer to calculate the attention matrix, mines the interrelationships between features in the table, encodes the relationship between feature columns, and uses the attention matrix to perform a linear transformation on the feature vector group to obtain a feature vector that can reflect the relationship between other features. Then, the feature vector obtained by an attention layer containing an action decoding layer and a softmax layer is transformed into the probability of specific feature transformation operations.
3. The method for automatic feature engineering of structured data arranged in time sequence according to claim 1, characterized in that, The temporal feature policy network is a temporal information extraction module that adds sample information extraction before the dense layer of the policy network in the FETCH framework. It includes a TCN layer, a dense layer, a multi-head attention layer, an action decoding layer, and a softmax layer. The temporal information extraction module is a temporal convolutional network TCN module, i.e., the TCN layer. TCN uses causal convolution to perform convolution operations only on historical data, ensuring that the output at any given time point depends only on information before that time point. TCN uses dilated convolution that skips part of the input, allowing the model to increase the receptive field and expand the range of input sequences that the model can observe while keeping the number of parameters constant.
4. The method for automatic feature engineering of structured data arranged in time sequence according to claim 1, characterized in that, The inter-group feature transformation operation on the feature refers to the feature transformation operation that uses the feature or the feature and other features as input features by using an inter-group feature transformation function; the feature transformation function includes unary feature transformation function and binary feature transformation function. Feature transformation functions between unary tuples include: tanh, square, inverse, log, sqrt, and sigmoid value transformation functions; Feature transformation functions between tuples include: addition, subtraction, multiplication, division, and combination arithmetic functions; For an inter-group feature transformation operation on a feature, if its feature transformation function is a unary inter-group feature transformation function, then the feature is the input feature of the transformation function; if its feature transformation function is a binary inter-group feature transformation function that requires two input features, then the feature is used as the first input feature of the transformation function, and the other features are used as the second input features of the transformation function. Different second input features correspond to different feature transformation operations. That is, a binary inter-group feature transformation function has n-1 inter-group transformation operations on a feature.
5. The method for automatic feature engineering of structured data arranged in time sequence according to claim 1, characterized in that, The temporal feature transformation operation on the feature refers to the operation of extracting temporal features by taking a fixed-length time window of samples on the feature as a time series and using a temporal feature function that extracts a feature value from a time series. The temporal feature transformation function is all the temporal feature functions in the EfficientFCParameters class in the Python library tsfresh0.20.1, with a total of 784 candidate temporal feature transformation functions.
6. The method for automatic feature engineering of structured data arranged in time sequence according to claim 1, characterized in that, The sampling in step (3) specifically involves: selecting a multinomial sampling method, during which multiple feature transformation operation sets (t1, t3, ... t) are sampled for the features. e ), used to fully explore the feature space, where e is the number of feature transformation operation sets for each sample, one of which includes an inter-group feature transformation operation and a temporal feature transformation operation on each feature sample.
7. The method for automatic feature engineering of structured data arranged in time sequence according to claim 1, characterized in that, The specific steps (4) are as follows: replace table X with the table containing extended features, continue the operations from step (2) to step (4) to obtain a table containing second-order extended features, iterate to obtain a table containing higher-order extended features, and set the highest order of the extended features; the higher-order extended features refer to features that use feature transformation operations on extended features, where the extended features generated by the feature transformation operation using the original features are first-order extended features, and the features generated by the feature transformation operation using the i-th order extended features are called i+1-th order features; in the process of iteratively generating tables containing higher-order extended features, each table containing extended features only samples and selects one set of feature transformation operations, so that when generating higher-order features each time, a total of e feature sets are still sampled and selected.
8. The method for automatic feature engineering of structured data arranged in time sequence according to claim 1, characterized in that, In step (6), when selecting a set of feature transformation operations with better evaluation metrics for pre-selected machine learning algorithms, for classification tasks, the pre-selected machine learning algorithms are selected from linear support vector machines, logistic regression, random forests, gradient boosting trees (XGBOOST), and light gradient boosting trees (LightGBM); for regression tasks, the pre-selected machine learning algorithms are selected from linear support vector machines, linear regression, random forests, gradient boosting trees, and light gradient boosting trees; the pre-selected evaluation metric E for classification tasks is the F1-score, and its calculation formula is as follows: Where TP represents the number of true positives, i.e. the number of instances that the model correctly predicts as positive; FP represents the number of false positives, i.e. the number of instances that the model incorrectly predicts as positive; and FN represents the number of false negatives, i.e. the number of instances that the model incorrectly predicts as negative. Then, substitute these values into the formula for the F1 score to calculate the model's performance metrics. The pre-selected evaluation index for regression tasks is 1 - relative absolute error rae, and its calculation formula is as follows: in, y represents the predicted value of the label, and y represents the actual value of the label. This represents the average of the actual values of the labels.
Citation Information
Patent Citations
Automatic feature engineering method and device for industrial time series data
CN114416707A
Automated data analytics methods for non-tabular data, and related systems and apparatus
WO2021167998A1