Feature engineering explained
Feature engineering is a preprocessing step in supervised machine learning and statistical modeling[1] which transforms raw data into a more effective set of inputs. Each input comprises several attributes, known as features. By providing models with relevant information, feature engineering significantly enhances their predictive accuracy and decision-making capability.[2] [3] [4]
Beyond machine learning, the principles of feature engineering are applied in various scientific fields, including physics. For example, physicists construct dimensionless numbers such as the Reynolds number in fluid dynamics, the Nusselt number in heat transfer, and the Archimedes number in sedimentation. They also develop first approximations of solutions, such as analytical solutions for the strength of materials in mechanics.[5]
Clustering
One of the applications of Feature Engineering has been clustering of feature-objects or sample-objects in a dataset. Especially, feature engineering based on matrix/tensor decompositions have been extensively used for data clustering under non-negativity constraints on the feature coefficients. These include Non-Negative Matrix Factorization (NMF),[6] Non-Negative Matrix-Tri Factorization (NMTF),[7] Non-Negative Tensor Decomposition/Factorization (NTF/NTD)[8] etc. The non-negativity constraints on coefficients of the feature vectors mined by above-stated algorithms yields a part-based representation and different factor matrices exhibit natural clustering properties. Several extensions of the above-stated feature engineering methods have been reported in literature, including Orthogonality constrained factorization for hard clustering and manifold learning to overcome inherent issues with these algorithms.
Other class of feature engineering algorithms include leveraging common hidden structure across multiple inter-related datasets to obtain a consensus (common) clustering scheme. Examples include Multi-view Classification based on Consensus Matrix Decomposition (MCMD)[9] algorithm which mines common clustering scheme across multiple datasets. The algorithm is designed to output two types of class labels (scale-variant and scale-invariant clustering), is computational robustness to missing information, can obtain shape and scale based outliers and can handle high dimensional data effectively. Coupled matrix and tensor decompositions are popularly used in multi-view feature engineering.[10]
Predictive modelling
Feature engineering in machine learning and statistical modeling involves selecting, creating, transforming, and extracting data features. Key components include feature creation from existing data, transforming and imputing missing or invalid features, reducing data dimensionality through methods like Principal Components Analysis (PCA), Independent Component Analysis (ICA), and Linear Discriminant Analysis (LDA), and selecting the most relevant features for model training based on importance scores and correlation matrices.[11]
Features vary in significance.[12] Even relatively insignificant features may contribute to a model. Feature selection can reduce the number of features to prevent a model from becoming too specific to the training data set (overfitting).[13]
Feature explosion occurs when the number of identified features is too large for effective model estimation or optimization. Common causes include:
- Feature templates - implementing feature templates instead of coding new features
- Feature combinations - combinations that cannot be represented by a linear system
Feature explosion can be limited via techniques such as: regularization, kernel methods, and feature selection.[14]
Automation
Automation of feature engineering is a research topic that dates back to the 1990s.[15] Machine learning software that incorporates automated feature engineering has been commercially available since 2016.[16] Related academic literature can be roughly separated into two types:
- Multi-relational decision tree learning (MRDTL) uses a supervised algorithm that is similar to a decision tree.
- Deep Feature Synthesis uses simpler methods.
Multi-relational decision tree learning (MRDTL)
Multi-relational Decision Tree Learning (MRDTL) extends traditional decision tree methods to relational databases, handling complex data relationships across tables. It innovatively uses selection graphs as decision nodes, refined systematically until a specific termination criterion is reached.
Most MRDTL studies base implementations on relational databases, which results in many redundant operations. These redundancies can be reduced by using techniques such as tuple id propagation.[17] [18]
Open-source implementations
There are a number of open-source libraries and tools that automate feature engineering on relational data and time series:
- featuretools is a Python library for transforming time series and relational data into feature matrices for machine learning.[19] [20] [21]
- MCMD: An open-source feature engineering algorithm for joint clustering of multiple datasets . [22]
- OneBM or One-Button Machine combines feature transformations and feature selection on relational data with feature selection techniques.[23]
- getML community is an open source tool for automated feature engineering on time series and relational data.[24] [25] It is implemented in C/C++ with a Python interface.[26] It has been shown to be at least 60 times faster than tsflex, tsfresh, tsfel, featuretools or kats.[27]
- tsfresh is a Python library for feature extraction on time series data.[28] It evaluates the quality of the features using hypothesis testing.[29]
- tsflex is an open source Python library for extracting features from time series data.[30] Despite being 100% written in Python, it has been shown to be faster and more memory efficient than tsfresh, seglearn or tsfel.[31]
- seglearn is an extension for multivariate, sequential time series data to the scikit-learn Python library.[32]
- tsfel is a Python package for feature extraction on time series data.[33]
- kats is a Python toolkit for analyzing time series data.[34]
Deep feature synthesis
The deep feature synthesis (DFS) algorithm beat 615 of 906 human teams in a competition.[35] [36]
Feature stores
The Feature Store is where the features are stored and organized for the explicit purpose of being used to either train models (by data scientists) or make predictions (by applications that have a trained model). It is a central location where you can either create or update groups of features created from multiple different data sources, or create and update new datasets from those feature groups for training models or for use in applications that do not want to compute the features but just retrieve them when it needs them to make predictions.[37]
A feature store includes the ability to store code used to generate features, apply the code to raw data, and serve those features to models upon request. Useful capabilities include feature versioning and policies governing the circumstances under which features can be used.[38]
Feature stores can be standalone software tools or built into machine learning platforms.
Alternatives
Feature engineering can be a time-consuming and error-prone process, as it requires domain expertise and often involves trial and error.[39] [40] Deep learning algorithms may be used to process a large raw dataset without having to resort to feature engineering.[41] However, deep learning algorithms still require careful preprocessing and cleaning of the input data.[42] In addition, choosing the right architecture, hyperparameters, and optimization algorithm for a deep neural network can be a challenging and iterative process.
See also
Further reading
- Book: Boehmke B, Greenwell B . Feature & Target Engineering . 41–75 . Hands-On Machine Learning with R . Chapman & Hall . 2019 . 978-1-138-49568-5 .
- Book: Zheng A, Casari A . Feature Engineering for Machine Learning: Principles and Techniques for Data Scientists . O'Reilly . 2018 . 978-1-4919-5324-2 .
- Book: Zumel N, Mount . Data Engineering and Data Shaping . Practical Data Science with R . Manning . 2nd . 2020 . 978-1-61729-587-4 . 113–160 .
Notes and References
- Book: Hastie . Trevor . The Elements of Statistical Learning: Data Mining, Inference, and Prediction . Tibshirani . Robert . Friedman . Jerome H. . 2009 . Springer . 978-0-387-84884-6 . en.
- Sharma . Shubham . Nayak . Richi . Bhaskar . Ashish . 2024-05-01 . Multi-view feature engineering for day-to-day joint clustering of multiple traffic datasets . Transportation Research Part C: Emerging Technologies . 162 . 104607 . 10.1016/j.trc.2024.104607 . 0968-090X. free . 2024TRPC..16204607S .
- Book: Shalev-Shwartz . Shai . Understanding Machine Learning: From Theory to Algorithms . Ben-David . Shai . Cambridge University Press . 2014 . 9781107057135 . Cambridge.
- Book: Murphy, Kevin P. . Probabilistic Machine Learning . The MIT Press (Copyright 2022 Massachusetts Institute of Technology, this work is subject to a Creative Commons CC-BY-NC-ND license) . 2022 . 9780262046824 . Cambridge, Massachusetts .
- SOLID-LIQUID MIXING IN STIRRED TANKS : Modeling, Validation, Design Optimization and Suspension Quality Prediction . 2021 . 10.13140/RG.2.2.11074.84164/1 . MacQueron C.
- Lee . Daniel D. . Seung . H. Sebastian . 1999 . Learning the parts of objects by non-negative matrix factorization . Nature . en . 401 . 6755 . 788–791 . 10.1038/44565 . 10548103 . 1999Natur.401..788L . 1476-4687.
- Book: Wang . Hua . Nie . Feiping . Huang . Heng . Ding . Chris . Nonnegative Matrix Tri-factorization Based High-Order Co-clustering and Its Fast Implementation . 2011 . 774–783 . 2011 IEEE 11th International Conference on Data Mining . http://dx.doi.org/10.1109/icdm.2011.109 . IEEE . 10.1109/icdm.2011.109. 978-1-4577-2075-8 .
- Lim . Lek-Heng . Nonnegative approximations of nonnegative tensors . 2009-04-12 . Comon . Pierre. cs.NA . 0903.4530 .
- Sharma . Shubham . Nayak . Richi . Bhaskar . Ashish . 2024-05-01 . Multi-view feature engineering for day-to-day joint clustering of multiple traffic datasets . Transportation Research Part C: Emerging Technologies . 162 . 104607 . 10.1016/j.trc.2024.104607 . 0968-090X. free . 2024TRPC..16204607S .
- Nayak . Richi . Luong . Khanh . 2023 . Multi-aspect Learning . Intelligent Systems Reference Library . 242 . en . 10.1007/978-3-031-33560-0 . 978-3-031-33559-4 . 1868-4394.
- Web site: Feature engineering - Machine Learning Lens . 2024-03-01 . docs.aws.amazon.com.
- Web site: Feature Engineering. 2010-04-22. 12 November 2015.
- Web site: Feature engineering and selection. October 1, 2009. Alexandre Bouchard-Côté. 12 November 2015.
- Web site: Feature engineering in Machine Learning. 12 November 2015. Zdenek Zabokrtsky. https://web.archive.org/web/20160304112056/https://ufal.mff.cuni.cz/~zabokrtsky/courses/npfl104/html/feature_engineering.pdf. 4 March 2016. dead.
- Book: https://link.springer.com/content/pdf/10.1007/978-3-540-48247-5_46.pdf . Multi-relational Decision Tree Induction. 10.1007/978-3-540-48247-5_46. Principles of Data Mining and Knowledge Discovery. 1704. 378–383. Lecture Notes in Computer Science. 1999. Knobbe AJ, Siebes A, Van Der Wallen D . 978-3-540-66490-1.
- Web site: Reality AI Blog. Its all about the features. September 2017.
- Book: Yin X, Han J, Yang J, Yu PS . CrossMine: Efficient classification across multiple database relations . Proceedings. 20th International Conference on Data Engineering . 2004 . 399–410 . 10.1109/ICDE.2004.1320014 . 0-7695-2065-0 . 1183403 .
- Book: A Method for Multi-relational Classification Using Single and Multi-feature Aggregation Functions . 10.1007/978-3-540-74976-9_43 . Knowledge Discovery in Databases: PKDD 2007 . 4702 . 430–437 . Lecture Notes in Computer Science . 2007 . Frank R, Moser F, Ester M . 978-3-540-74975-2 .
- Web site: What is Featuretools?. September 7, 2022.
- Web site: Featuretools - An open source python framework for automated feature engineering. September 7, 2022.
- Web site: github: alteryx/featuretools. GitHub. September 7, 2022.
- Sharma . Shubham . Nayak . Richi . Bhaskar . Ashish . 2024-05-01 . Multi-view feature engineering for day-to-day joint clustering of multiple traffic datasets . Transportation Research Part C: Emerging Technologies . 162 . 104607 . 10.1016/j.trc.2024.104607 . 0968-090X. free . 2024TRPC..16204607S .
- Thanh Lam. Hoang. Thiebaut. Johann-Michael. Sinn. Mathieu. Chen. Bei. Mai. Tiep. Alkan. Oznur. 2017-06-01. One button machine for automating feature engineering in relational databases. cs.DB. 1706.00327.
- Web site: getML documentation. September 7, 2022.
- Web site: github: getml/getml-community. . September 7, 2022.
- Web site: github: getml/getml-community. . September 7, 2022.
- Web site: github: getml/getml-community. . September 7, 2022.
- Web site: tsfresh documentation. September 7, 2022.
- Web site: Time Series FeatuRe Extraction on basis of Scalable Hypothesis tests (tsfresh – A Python package). September 7, 2022 .
- Web site: predict-idlab/tsflex. GitHub. September 7, 2022.
- tsflex: Flexible time series processing & feature extraction. 2022. 10.1016/j.softx.2021.100971. September 7, 2022. Van Der Donckt. Jonas. Van Der Donckt. Jeroen. Deprost. Emiel. Van Hoecke. Sofie. SoftwareX. 17. 100971. 2111.12429. 2022SoftX..1700971V. 244527198.
- Web site: seglearn user guide. September 7, 2022.
- Web site: Welcome to TSFEL documentation!. September 7, 2022 .
- Web site: github: facebookresearch/Kats. GitHub. September 7, 2022.
- Web site: Automating big-data analysis. 16 October 2015.
- Book: James Max . Kanter . Kalyan . Veeramachaneni . Deep feature synthesis: Towards automating data science endeavors . 2015 IEEE International Conference on Data Science and Advanced Analytics (DSAA) . 2015 . 1–10 . 10.1109/DSAA.2015.7344858 . 978-1-4673-8272-4 . 206610380 .
- Web site: What is a feature store. 2022-04-19.
- Web site: An Introduction to Feature Stores. 2021-04-15.
- Web site: Feature Engineering in Machine Learning . 2023-03-21 . Engineering Education (EngEd) Program Section . en-us.
- Web site: explorium_admin . 2021-10-25 . 5 Reasons Why Feature Engineering is Challenging . 2023-03-21 . Explorium . en.
- Book: Spiegelhalter, D. J. . The art of statistics : learning from data . 2019 . 978-0-241-39863-0 . [London] UK . 1064776283.
- Sarker IH . Deep Learning: A Comprehensive Overview on Techniques, Taxonomy, Applications and Research Directions . SN Computer Science . 2 . 6 . 420 . November 2021 . 34426802 . 8372231 . 10.1007/s42979-021-00815-1 .