Feature Engineering

ekitindi - Aug 18 - - Dev Community

What is Feature Engineering

Feature Engineering is the process of turning raw data into relevant information for use in Machine Learning models. A feature, also known as a dimension, is an input variable used in supervised and unsupervised learning to generate model predictions. It's the process of transforming the given data into a form that is easier to interpret.

Importance of Feature Engineering

Feature Engineering is important in machine learning because it helps in making models more accurate as well as improving performance of the model. Data Scientists spend a lot of their time with data, making it important to have accurate models.

When done correctly, the resulting data set is optimal with all important factors affecting the business problem, as such the most accurate predictive models and useful insights are produced.

Feature Engineering Process

The process involves experimentation, model evaluation, and refinement to find the best feature set. It can be broken down into 4 main parts, each with its set of techniques:

  1. Feature Creation: developing new features from existing ones to capture more complex relationships. includes techniques like Scaling and Binning.
  2. Feature Transformation: utilizing mathematical approaches to change feature values to improve performance of machine learning models. Techniques can include normalization.
  3. Feature Extraction: This process reduces complexity and improves visualization. It may result in interpretability loss, and one needs to consider the nature of the data, the problem, and the trade-offs before performing this.
  4. Feature Selection: selecting relevant features from the data to enhance the predictive power and accuracy of the model. Selecting unnecessary or redundant features might result in overfitting, increased computational cost, and decreased model interpretability.

Techniques used in Feature Engineering

here are a few common techniques used in feature engineering, some working better with some algorithms, and some useful in all situations.

  1. Imputation: This is mainly used to handle missing values, that often arise from human error, data flow interruptions, privacy concerns and other factors. There are 2 types of imputations:

    • Numerical Imputation: Missing numerical values are generally replaced by the mean of the corresponding value in other records.
    • Categorical Imputation: Missing categorical variables are generally replaced by the most commonly occurring value in other records.
  2. Discretization: Also known as Binning, involves taking a set of data values and grouping sets of them together logically into bins (or buckets). It compares each value to the neighborhood of values surrounding it and then sorts data points into a number of bins.

  3. One-hot encoding: categorical data is converted into a form that the machine learning algorithm understands so it can make better predictions. Seen as the inverse of binning, it maps categorical features to binary representations, which are used to map the feature in a matrix.

  4. Scaling: also referred to as normalization, is a standardization technique to rescale features and limit the impact of large scales on models. Involves:

    • Min-Max Scaling: This process involves rescaling all values in a feature from 0 to 1. The minimum value in the original range will take 0, the maximum value will take 1, and the rest of the values between the two extremes will be appropriately scaled.
    • Z-score scaling: Also referred to as standardization and variance scaling. It rescales features so that they have a shared standard deviation of 1 with a mean of 0.

Feature Engineering Use Case

Below are some examples of where feature engineering is applied:

  • Obtaining the average and median retweet count of particular tweets.
  • Extracting pixel information from images.
  • Car insurance claims predictions.

Conclusion

This article has given a brief overview of what Feature engineering is. It seen as a crucial process in the data industry, especially in data analysis and machine learning, and mastering it is just as important, especially for Data Scientists.

References:

Understanding Feature Engineering in Machine Learning

feature engineering

What is feature engineering?

8 Feature Engineering Techniques for Machine Learning

Feature Engineering for Machine Learning

. . . .
Terabox Video Player