A machine learning model is only as useful as the information it has to work with. Even when a dataset contains large amounts of information, the variables within it may not always provide a clear picture of the problem being investigated. This is where feature engineering comes in. As opposed to relying entirely on the information originally collected, it allows data to be reshaped and improved, giving ML algorithms a chance to identify more patterns.
Consider a retailer investigating consumer expenditure. Its dataset will often include customer age, purchase history, and the number of transactions made. While these are useful, individually they provide limited details. By combining existing information, the retailer could calculate average spending per transaction or the number of days since a customer’s last purchase. These engineered features (additional variables), could give the model a clearer understanding of purchasing habits.
There are several ways to create these, depending on the type of information available. Math-based calculations can combine existing variables, while dates can be broken down into components such as months, days or years. This can help identify seasonal trends or differences in activity throughout the week. Other transformations involve converting categorical information, such as product types or locations, into numerical representations. One example is one hot encoding, which represents various categories using separate binary variables. This then allows algorithms that require numerical inputs to process the information.
Another useful technique is aggregation, where multiple observations are summarized into a single value. A financial organization, for example, could examine individual customer transactions and calculate their total spending over the previous month. It could also calculate average transaction values or the number of purchases made within a particular period. These summaries reveal broader patterns that are difficult to identify from individual records alone.
What makes feature engineering particularly interesting is that it combines technical knowledge with an understanding of the problem itself. The most helpful features aren’t the most complicated ones, but those that provide information relevant to the task. When predicting house prices, for instance, property size and location are likely to be important. However, calculating the price per square meter or the age of a property could provide additional information that helps a model make more informed predictions.
Feature engineering is also closely connected to two other data preparation techniques: feature selection and feature extraction. Although they are often discussed together, their purposes are different. Feature engineering creates or modifies variables to make information more useful. Feature selection identifies the most relevant existing variables and removes those that contribute little to the task. Feature extraction goes further by transforming the original variables into a new, often smaller, representation of the data. In practice, these approaches can complement one another.
Oracle Machine Learning provides several capabilities that support data preparation and feature engineering. Within Oracle Machine Learning for SQL users can apply transformations such as normalization, binning and outlier treatment. Oracle also offers Automatic Data Preparation, which can perform relevant transformations for supported algorithms, reducing the amount of manual preparation required. These capabilities allow data to be prepared within Oracle’s database environment before being used to train machine learning models.
Ultimately, feature engineering is all about getting more value from data that’s already available. From this, organizations could give ML algorithms a stronger learning foundation.