Concepts / Choosing a Machine Learning Approach

Choosing a Machine Learning Approach

Understanding the data and the task is one of the most important parts of the machine learning process, and it comes before building a model.

  • Programming

The Spreadsheet Shortcut

Imagine you have a spreadsheet full of records and a goal you want to reach. A common instinct is to skip the slow work of studying those records, pick a popular algorithm from a list, feed the spreadsheet into it, and see what comes out. This shortcut feels efficient, because it gets to a model quickly. The source this article draws on argues that the instinct is a trap, and this article explains why and what to do instead.

What do you think happens?

Before reading on, what do you think is wrong with picking a popular algorithm at random and feeding it your data?

Reveal answer
Answer:

Randomly choosing an algorithm and feeding it data is not an effective approach, because each algorithm suits different kinds of data and problem settings.

An algorithm that fits one kind of data or problem may fit another poorly. Trying algorithms blindly skips the step that tells you which one is likely to fit.

Tracing the Shortcut Step by Step

Follow the shortcut one move at a time. First, you skip studying the records. Second, you choose an algorithm from a list because it is popular. Third, you feed the whole spreadsheet into that algorithm. Fourth, you look at whatever comes out and try to decide whether it helps. At no point in this sequence did you ask what the records contain, what the goal actually requires, or how the result will be judged. The sequence contains a search, but the search is blind: each attempt is made without knowing whether the algorithm matches the data.

The belief behind the shortcut is that algorithms are interchangeable. If one fails to help, another will eventually work, so trying them blindly looks like a reasonable search. The source rejects this idea. Its central point is that understanding what is going on in your dataset is probably the most important part of the machine learning process, and that this understanding must happen before you begin building a model.

Pick a popularalgorithmStudy records andtaskFeed in thespreadsheetChoose a fittingapproachUnclear resultJudge result againstgoalno checkmatch
How does the same starting problem lead to a poor result when the algorithm is picked first, compared with a result when the approach is chosen after analysing the data and task?

Why Algorithms Are Not Interchangeable

Each machine learning algorithm is suited to particular kinds of data and particular problem settings. Because of this, the choice of algorithm is a matching problem: you need to know enough about your data and your task to find an approach that fits them. Picking an algorithm before you know these things means the match is left to chance. A poor result from a mismatched algorithm does not show that machine learning failed; it often shows that the approach was never matched to the problem.

Key point

Understanding the data and the task comes before building a model. It is not an optional preliminary step to skip when you are in a hurry.

The Questions to Ask First

The source gives a set of questions to answer, or at least keep in mind, while you build a machine learning solution. Each question pushes you to examine a different part of the project, from the goal itself to the way the finished solution will be used. The questions cover five areas: the question you are trying to answer, the data you have, the features within that data, the measure of success, and how the solution will be integrated into its use. Walk through them before you write any model code.

  1. 1
    Question: what exactly is the goal, and what would a useful answer look like?
  2. 2
    Data: what records or information do you have, and what do they contain?
  3. 3
    Features: which pieces of that data are likely to matter for the goal?
  4. 4
    Success measure: how will you know whether the solution is working?
  5. 5
    Integration: how will the finished solution be used, and by whom?

The source frames these as questions that surface assumptions early. A question you cannot answer is itself useful information: it tells you where your understanding of the project is incomplete. The order in which you ask them can vary, but the purpose is the same in every case, which is to examine the project before committing to a model.

Is the goal clear?Clarify the goalWhat data isavailable?Which featuresmatter?How is successmeasured?How will it be used?Build the modelnoretryyesunderstooddefinedagreed
In what order should you ask about the goal, the available data, and the output you need, and which answers lead to which next question?

This flowchart is a teaching simplification built from the questions above. It is not a fixed procedure from the source. The branches show the idea that an unanswered question should send you back to the earlier step, rather than pushing you forward into model code with an unresolved assumption.

Machine Learning as One Stage in a Larger Process

Machine learning algorithms and methods are only one part of a greater process for solving a particular problem. The source advises keeping this big picture in mind at all times. It is easy to focus on the technical details and lose sight of the ultimate goal. The model is one stage among several, and the stages before and after it shape whether the model solves the right problem at all.

Define the problemUnderstand the dataBuild the modelEvaluate againstsuccess measureUse the solutionfeedsshapesjudged byapproved for
Where does model building sit relative to defining the problem, understanding the data, evaluation, and use, and what feeds into and out of it?

The diagram is a simplified picture, and the source does not prescribe this exact order. Its point is that the model depends on the stages around it. Stages before the model determine what it is asked to do and what data it receives. Stages after it determine whether its output counts as a success. A model that is excellent in isolation can still fail the larger problem if any of those surrounding stages was neglected.

Framing a Returns Problem

Worked example

Applying the Framing Questions to an Online Shop

An online shop has a spreadsheet of past orders and wants to use machine learning to reduce the number of orders that are returned. Work through the framing questions before choosing any algorithm.

  1. 1
    Question

    The goal is fewer returns. Clarify what counts as a return and whether the aim is to predict returns or to change something that causes them. A vague goal makes every later choice uncertain.

  2. 2
    Data

    Look at what the spreadsheet actually records: order details, dates, and whether each order was returned. Check whether the records are complete enough to study.

  3. 3
    Features

    Decide which parts of each record might relate to returns, such as product type or delivery time. This step surfaces assumptions, such as the belief that delivery time matters, which can then be tested.

  4. 4
    Success measure

    Define how success will be judged, for example whether the solution must reduce returns without blocking many legitimate orders. Without this, a result cannot be called good or bad.

  5. 5
    Integration

    Consider how the solution will be used. If the shop cannot act on predictions at the point of sale, a technically accurate model may not change anything.

Result

Only after these answers are clear is the choice of approach meaningful. The shop now knows what it is trying to achieve, what evidence it has, and how it will judge the outcome, so the algorithm can be matched to a defined problem.

Mistakes Beginners Make

  • Common mistake

    Choosing an algorithm first and studying the data later

    What it looks like

    Feeding the whole spreadsheet into a popular algorithm to see what happens.

    Why it fails

    Each algorithm suits different kinds of data and problem settings, so the choice should follow an understanding of the data and task.

    Do this instead

    Study the records and the task before selecting any approach.

  • Common mistake

    Assuming that trying algorithms blindly is a reasonable search

    Why it fails

    The source rejects the idea that algorithms are interchangeable. Blind trials hide the reason a method fails.

    Do this instead

    Use the questions about the goal, data, and features to narrow the choice before experimenting.

  • Common mistake

    Focusing only on the technical details

    Why it fails

    Machine learning is one part of a larger process, and attention to technical detail can make people lose sight of the goal.

    Do this instead

    Keep the big picture in mind, including the stages before and after the model.

  • Common mistake

    Leaving the success measure undefined

    Why it fails

    Without a defined measure, there is no reliable way to tell whether the solution solves the problem, even if the model is technically strong.

    Do this instead

    Decide how success will be measured as part of framing the problem.

Applying the Framing Questions

MEDIUM

A school has a spreadsheet of student attendance records and wants to use machine learning to help staff. Before choosing any algorithm, write one or two sentences answering each framing question: what the goal is, what data is available, which features might matter, how success would be measured, and how the solution would be used. Then identify which answer you are least confident about and explain what you would need to find out.

Hints
  • Start by writing the goal in plain words before thinking about any technique.
  • If you cannot say how success would be measured, return to the goal and make it more specific.
  • An unanswered question is useful: it tells you what to investigate before building a model.

Summary of the Approach

At a glance

  • Randomly choosing an algorithm and feeding it data is not effective, because each algorithm suits different kinds of data and problem settings.
  • Understanding the data and the task is one of the most important parts of the machine learning process, and it comes before building a model.
  • Framing questions about the goal, the data, the features, the success measure, and integration help surface assumptions early.
  • Machine learning is one stage in a larger process, so keep the big picture in mind to avoid building complex solutions that solve the wrong problem.

Related concepts

More concepts starting with C