Concepts / Feature Extraction in Machine Learning

Feature Extraction in Machine Learning

A machine learning project should begin by asking what question it must answer and whether the available data can answer it.

  • Programming

Why Start With a Question, Not a Model

It is tempting to begin a machine learning project by choosing an algorithm and loading data into it. The source material argues for a different starting point: a machine learning project should begin by asking what question it must answer and whether the available data can answer it. These are early decisions, and they shape everything that follows, including which features you extract, how you judge the result, and how the finished solution fits into a larger system.

What do you think happens?

Suppose a team has a sharply worded business question, but the data they collected does not contain the information needed to answer it. Can a skilled choice of model or a clever phrasing rescue the project?

  • Yes, a strong enough model can compensate for missing information

  • Yes, if the question is rephrased as a machine learning problem

  • No, a question the data cannot address will not become a good machine learning problem, however it is phrased

Reveal answer
Answer:

No, a question the data cannot address will not become a good machine learning problem, however it is phrased.

Formulation depends on two things at once: a clear statement of the goal and an honest look at the data. Rephrasing cannot supply information that was never collected, and the model can only learn from the data it is given.

The Planning Checklist

Before any model is trained, a project needs answers to a set of planning questions. The source gathers them into six key questions. Together they cover the question you are trying to answer, the data you have, how the problem is phrased, the features you extract, how success is measured, and how the solution fits into a larger product.

  • Question one: what are you trying to answer, and can the collected data answer it?
  • Question two: how should that question be phrased as a machine learning problem?
  • Question three: has enough data been collected to represent the problem?
  • Question four: which features were extracted, and will they enable the right predictions?
  • Question five: how will success be measured?
  • Question six: how will the machine learning solution interact with other parts of the research or business product?

Treat these questions as a checklist that you work through in order. Each one exposes a different way a project can fail. A model can be technically sound and still answer the wrong question, or it can answer the right question using data that does not represent the situation. The diagram below shows the gate at the start of a project, where the first two questions decide whether work should move forward or loop back.

Define the questionWhat must be answered?Can the data answerit?Honest look at the dataPhrase as an MLproblemInputs and target outputContinue to remainingchecksRepresentation, features,metricsRevisit question ordataDo not start trainingstate the goalyesnoreframe
What happens if the data cannot answer the question, and where does the project loop back?

Phrasing a Practical Question as an ML Problem

The second question asks how the question should be phrased as a machine learning problem. A practical question such as whether a customer is likely to stop using a service is not yet a machine learning problem. To become one, it needs a defined set of inputs, meaning the information available to the model, and a defined target output, meaning the thing the model is meant to predict. Once both are stated, the problem has a shape that can be checked against the data.

Worked example

Turning a business question into an ML problem

A subscription company asks: Which customers should our retention team contact this month?

  1. 1
    Clarify the goal

    The team wants to reach customers who are at risk of leaving, so the goal is to find customers at risk. This is a clear statement of what must be answered.

  2. 2
    Check the data

    Ask whether the collected records describe past customers and what happened to them. If there is no record of who left, the question cannot be answered from this data, and the project should loop back.

  3. 3
    Define the inputs

    Choose the information the model will see for each customer, such as usage history or support contacts. These are the candidate features.

  4. 4
    Define the target output

    State what the model predicts, for example whether a customer left within a given period, as a yes or no outcome.

Result

The business question is now a machine learning problem: given each customer's inputs, predict the target outcome, then use those predictions to choose whom to contact.

Judging Whether the Data Represents the Problem

From Raw Records to Feature Columns

Feature extraction is the step where a raw record becomes the set of values a model actually sees. A raw record may contain fields in mixed forms, some useful for the goal and some not. Extraction selects and shapes the information into feature columns, and the judgment from the fourth question is whether those columns carry the signal the target output depends on.

Raw customer recordMixed fields as collectedSelect relevantfieldsJudge against the goalExtract featurevaluesTurn fields into measurablevalueslogins last monthe.g. 12support ticketse.g. 3months subscribede.g. 24
How does a raw record become the numeric feature columns a model actually sees?

Reading the diagram from left to right, the raw record is first narrowed to fields that relate to the goal, then each chosen field is turned into a value the model can use. The three feature columns on the right are the only information the model receives about each customer. If a field that matters to the goal was never extracted, no later step can recover it, which is why the feature question is asked before training.

Mistakes Beginners Make at the Start of a Project

  • Common mistake

    Training a model before stating what question it must answer

    What it looks like

    A team builds a model first and only later asks what it is for.

    Why it fails

    Without a clear goal, there is no basis for judging whether the data can answer anything or whether the result is useful.

    Do this instead

    Write down the question and check the data against it before choosing an algorithm.

  • Common mistake

    Assuming a large dataset is enough

    What it looks like

    A team holds millions of records but they all come from one narrow situation.

    Why it fails

    The third question asks whether the data represents the problem, not whether it is large.

    Do this instead

    Compare what the data covers with what the problem requires and be honest about gaps.

  • Common mistake

    Extracting features because they are easy to obtain

    Why it fails

    Features unrelated to the goal can make a project look busy without producing the predictions the problem needs.

    Do this instead

    Check each feature against the predictions the problem requires.

  • Common mistake

    Choosing a success measure after seeing the results

    Why it fails

    If success is not defined in advance, a result is easy to judge by whatever looks favorable.

    Do this instead

    Define the measure of success before the model is built.

Defining Success Before Training

The fifth question asks how success will be measured in your application. It belongs before the model is built, not after. The source asks you to determine the measure that fits your application rather than naming one measure for every project. The point is to fix the standard in advance so that the result is judged against a commitment made before anyone saw how the model performed.

How the Model Fits Into the Product

The sixth question asks how the machine learning solution will interact with other parts of the research or business product. A model rarely works alone. It receives inputs from one part of a system and its outputs are used by another part. The source asks you to consider this interaction early, because the needs of the surrounding product can shape the data, the features, and the way success is judged.

UserPerforms an actionProduct applicationCollects the inputsMachine learningmodelProduces a predictionProduct responseUses the prediction1. action2. feature inputs3. prediction4. response
What is the order of events from a user action through the model to the product's response?

Reading the sequence from top to bottom, the user acts, the product gathers the inputs the model needs, the model returns a prediction, and the product shows the user a response. Each handoff is a place where the surrounding product sets requirements, such as which inputs are available at the moment the model runs. Those requirements feed back into the data and features chosen earlier.

Tracing a Project Through the Checklist

Worked example

Walking one project through the six questions

A clinic wants a tool that flags appointment requests likely to be missed, so staff can send reminders. Work through the checklist in order and state what each answer changes.

  1. 1
    Question one

    The goal is to identify requests likely to be missed. The clinic's booking records include whether each past appointment was attended, so the question can plausibly be answered from the data.

  2. 2
    Question two

    Inputs are details of each request, such as lead time and past attendance. The target output is a yes or no outcome for whether the appointment is missed.

  3. 3
    Question three

    The records cover only one clinic over one year. If the clinic plans to use the tool elsewhere, the data may not represent the wider problem. This gap should be stated before training.

  4. 4
    Question four

    Lead time and past attendance are plausibly related to the outcome. A field that is easy to export but has no link to attendance should be left out.

  5. 5
    Question five

    Before training, the team decides how success will be judged, for example by how well the flagged requests match the appointments that are actually missed.

  6. 6
    Question six

    The flags must reach the reminder system in time to act. The product requirements therefore affect which inputs can be used when the model runs.

Result

The checklist does not guarantee success, but it surfaces the representation gap and the timing requirement before any training begins.

Applying the Checklist to a New Project

MEDIUM

A library wants to predict which book requests will be returned late. Using the six questions in order, write one sentence for each question describing what you would decide, and identify which question would most likely send the project back to the start.

Hints
  • Start with the question: what must be answered, and does the loan history contain the outcome?
  • For the representation question, consider whether the records cover all kinds of borrowers and all loan periods.
  • For the success question, decide the measure before anyone looks at model results.

Key Takeaways

  • A machine learning project should begin by asking what question it must answer and whether the available data can answer it; a question the data cannot address will not become a good problem, however it is phrased.
  • Phrasing a practical question as a machine learning problem means stating its inputs and its target output, so that it can be checked against the data.
  • Sufficiency means the data represents the problem, not that it is large; features must be judged on whether they enable the predictions the problem needs.
  • Success should be defined in advance, and the solution should be considered in terms of how it will interact with the rest of the research or business product.

Related concepts

More concepts starting with F