Concepts / Introduction to Feature Engineering

Introduction to Feature Engineering

Traditional machine learning relies on human experts to manually extract features, such as trigger-word frequency in spam classification.

  • Programming

The Email Sorting Problem

Imagine building a program that sorts incoming email into spam and legitimate mail. Writing a rule for every possible spam message is not realistic, so the sensible choice is to let the program learn from examples. Once you make that choice, a deeper question appears: how much of the learning process has to be designed by people, and how much can the program work out for itself?

What do you think happens?

In a traditional machine learning system, who decides which properties of an email the model should look at?

  • The model itself, during training

  • Human experts who design the system

  • Nobody, because the model reads the raw text directly

Reveal answer
Answer:

Human experts who design the system

In traditional machine learning, the people building the system decide which features matter and compute them. The model never sees the raw text in this setup; it sees only the expert-defined measurements.

Features as Measurable Quantities

A learning model cannot read an email the way a person does. It works on measurable quantities, and these are called features. A feature is a property of the data that the model can use to tell one kind of example from another. An email is therefore not something the model understands as a message; it is something the model must reduce to numbers that describe it.

Keep this idea in mind as the central thread of the article: every model works from a set of measurements, and the open question is where those measurements come from.

Manual Feature Extraction by Human Experts

Definition

Feature extraction is the step of identifying and selecting relevant features from raw data. In traditional machine learning, this step is done manually by human experts.

For spam classification, the source describes several features an expert might choose. The first is how often certain trigger words appear, such as prize, win, and free. The second is how many exclamation marks a message contains. The third is whether words are written in all uppercase. The fourth is whether suspicious links are present.

Once those features have been computed for every email, the results form a table of values. That table becomes the dataset used to train the model. Each row describes one email in terms of the expert's chosen measurements, and each column is one feature.

Incoming emailraw textprize2win1free3countcountcount
How an email gets turned into numbers: each trigger word is a key, and the count of that word in the email is its value. This is an illustrative example with made-up counts.
Worked example

Turning one email into a feature row

An expert has chosen four features: the count of prize, the count of win, the count of free, and the number of exclamation marks. Convert the following email into a feature row. The email reads: Congratulations, you could win a FREE prize! Claim it now!!!

  1. 1
    Identify the trigger words in the email

    The words win, free, and prize each appear once. Matching is by the expert's chosen word list, so each one is counted when it appears.

  2. 2
    Count each trigger word

    prize appears 1 time, win appears 1 time, and free appears 1 time.

  3. 3
    Count exclamation marks

    The email ends with three exclamation marks, so the count is 3.

  4. 4
    Assemble the feature row

    The row becomes prize=1, win=1, free=1, exclamation_marks=3. This row, together with a label, is one training example. The model never receives the original sentence.

Result

Feature row: prize=1, win=1, free=1, exclamation_marks=3. This example is illustrative and was constructed for teaching.

Where the Two Pipelines Diverge

The clearest way to see the difference is to compare the two pipelines side by side. In both cases the raw email eventually reaches a classifier. The traditional pipeline, however, places a human-designed feature step between the raw email and the classifier. The deep learning pipeline removes that step from the human's hands.

Raw emailRaw emailFeature extractiondesigned by human expertsAutomatic featureextractionlearned by the modelFeature tableClassifierClassifiermeasuredcomputedtrains oninputfeeds
The two pipelines for spam classification side by side. The feature node is the one that changes: in traditional machine learning a human expert defines it, while in deep learning it is extracted automatically.

Read the diagram from left to right in each column. The traditional column contains a feature step that a person has designed in advance, which is why it is the only human-defined stage in that path. The deep learning column has an automatic feature step in the same position. The source states that the features are extracted automatically rather than being handed to the model by a person. It does not describe how those internal features are formed, so this article does not go further into the mechanism.

Shifting Responsibility for the Designer

The practical consequence is that the expert's job changes. In the traditional approach, the designer must decide in advance that exclamation marks and uppercase words are worth counting. In the deep learning approach, that decision is no longer part of the designer's list of tasks. The designer works instead on the surrounding system: gathering examples, setting up training, and judging whether the model's predictions are good.

Labels and the Shared Workflow

Now follow the traditional workflow from start to finish. Each stage depends on the stage before it, so the order matters. The path runs from human labeling of training data to a model that can make predictions on new mail. Labeling means assigning each example a category, such as spam or not spam.

  • Collect emails as training data
  • Have experts or users label each email as spam or not spam
  • Train the model on the labeled examples
  • Use the trained model to make predictions on new mail

The key point is that labels remain required in both approaches. The source states that deep learning does not remove the need for collected labels, which are gathered by experts or users. Deep learning changes who works out the relevant characteristics of the input, but it does not change the need for examples that are marked with the correct answer.

Where ML and DL Sit in AI

Artificial intelligence is a broad field, and machine learning and deep learning currently dominate it. They are not the only approaches. The field also includes rule-based systems, genetic algorithms, expert systems, fuzzy logic, and symbolic reasoning. Each of these takes a different route toward intelligent behavior.

ArtificialintelligenceMachine learningDeep learningRule-based systemsGenetic algorithmsExpert systemsFuzzy logicSymbolic reasoningincludesincludesincludesincludesincludesincludesincludes
The wider field of artificial intelligence and the approaches named in the source. Machine learning and deep learning are two of several approaches within AI, not the whole of it.

When this article compares traditional machine learning with deep learning, it is comparing two members of this wider family. It is not describing the whole of AI. Keeping that boundary in mind prevents the common error of treating the terms as interchangeable.

Large Language Models in Context

The source introduces large language models, or LLMs, as models that can solve a variety of problems. For this article, the important point is their position. LLMs are one of the modern model families discussed in the context of machine learning. Their architecture and other details are developed in later sections, so this article does not explain them.

Mistakes Beginners Make with Features

  • Common mistake

    Assuming deep learning needs no labeled data

    What it looks like

    Believing that because experts no longer pick features, the spam sorter can learn from unlabeled mail alone.

    Why it fails

    The source states that both approaches still require collected labels, such as spam or non-spam, gathered by experts or users.

    Do this instead

    Treat labeling as a required stage in both pipelines. Only the feature step differs.

  • Common mistake

    Thinking the model reads the raw email in traditional machine learning

    What it looks like

    Assuming the classifier sees the sentence in the email and works out the words itself.

    Why it fails

    In the traditional setup the model sees only the expert-defined measurements, not the raw text.

    Do this instead

    Picture the feature table as the model's entire view of each email.

  • Common mistake

    Using artificial intelligence and deep learning as synonyms

    What it looks like

    Saying that a rule-based expert system is not AI because it is not deep learning.

    Why it fails

    AI is a broad field that also includes rule-based systems, genetic algorithms, expert systems, fuzzy logic, and symbolic reasoning.

    Do this instead

    Place machine learning and deep learning as two approaches inside AI, alongside the others.

  • Common mistake

    Confusing the feature step with the classifier step, as if choosing features and making predictions were the same task

Checking Your Understanding

EASY

A team builds two spam sorters. Sorter A uses a table of trigger-word counts that an expert chose. Sorter B learns the relevant characteristics of the input during training. For each sorter, state who decides which characteristics matter, and name one thing both sorters still need from people.

Hints
  • Look at the section on manual feature extraction and the section on where the two pipelines diverge.
  • The shared requirement is discussed in the section on labels and the shared workflow.
MEDIUM

Explain in two or three sentences why the feature table, and not the raw email, is what the traditional model learns from.

Hints
  • Consider what the model is able to measure in each approach.

Key Takeaways

  • Traditional machine learning depends on human experts to decide which features matter and to compute them, such as trigger-word frequency, exclamation mark counts, uppercase use, and suspicious links in spam classification.
  • Deep learning does not require manual feature extraction, so the feature step is carried out automatically rather than handed to the model by a person.
  • Both approaches still require collected labels, such as spam or non-spam, gathered by experts or users. Only the feature step changes between them.
  • Machine learning and deep learning are two approaches within AI, which also includes rule-based systems, genetic algorithms, expert systems, fuzzy logic, and symbolic reasoning.

Related concepts

More concepts starting with I