Skip to content
Visual explainer 2h to learn 4 steps

AI, machine learning and deep learning: choose the right problem type

Classify a business question as supervised, unsupervised or not an ML problem, and state a baseline and success measure for it.

By Invicly Tech, , in AI and Machine Learning with Python. About 11 minutes to read.

Topic 1 of 34

In short

Machine learning is one way to build AI: instead of writing every rule by hand, you let a program learn patterns from examples. Before training anything, decide whether the question is supervised (you have past answers to learn from), unsupervised (you only want to find structure), or not an ML problem at all. Then write down a simple baseline and the measure that will tell you whether the model is worth keeping.

Think of it like this: Choosing the problem type is like choosing a tool from a toolbox: a hammer is great, but not for a screw, and sometimes the job only needs your hands.

Explained simply

Artificial intelligence, or AI, is the broad idea of computers doing tasks that seem to need judgement. Some AI is just rules a person wrote, like a spam filter that blocks any email containing a certain phrase. Machine learning, or ML, is the part of AI where the computer learns the rules itself by looking at many examples.

Deep learning is a kind of ML that uses neural networks with many layers. It shines on messy inputs such as photos, sound and free text. Generative AI is deep learning that creates new content, like a chatbot writing an answer. Each circle sits inside the bigger one.

Most practical ML is supervised. You have past examples with the right answer attached, called labels, and the model learns to predict that answer for new cases. If the answer is a number, it is regression. If it is a category, it is classification. Unsupervised learning has no labels; it looks for groups or unusual points.

Before any of this, ask whether a simple rule would do. If customers who have not logged in for 60 days usually leave, that rule is your baseline. A model is only worth building if it beats the rule by enough to change a decision, measured with a number everyone agrees on.

Press Play on a diagram to walk through it one step at a time.

LayersHow AI, ML, deep learning and generative AI nest
  1. 1
    Artificial intelligence

    Any system that does tasks we link with human judgement, including hand-written rules.

  2. 2
    Machine learning

    Systems that learn patterns from data instead of fixed rules.

  3. 3
    Deep learning

    ML with many-layered neural networks, strong on images, audio and text.

  4. 4
    Generative AI

    Deep learning models that produce new text, images or code.

FlowFrom business question to problem type
  1. 1
    Write the question

    Which customers will cancel next month?

  2. 2
    Could a rule do it?

    If yes, start with the rule as the baseline.

  3. 3
    Past answers exist?

    Yes: supervised. No: unsupervised or collect labels.

  4. 4
    Name the output

    A number (regression), a category (classification) or groups.

  5. 5
    Set baseline and measure

    What must the model beat, and by how much?

CompareRule, classical ML or deep learning?
Hand-written rule
  • Logic is known and stable
  • No training data needed
  • Easy to explain and audit
  • Breaks when patterns shift
Classical ML
  • Tabular data with clear columns
  • Hundreds to millions of rows
  • Trains on a laptop CPU
  • Good default for business data
Deep learning
  • Images, audio or free text
  • Usually needs lots of data or a pretrained model
  • Often benefits from a GPU
  • Harder to explain

In depth

Is it an ML problem at all?

ML fits when three things are true. First, there is a pattern to learn: the outcome depends on inputs in a way that is too complex for a few rules. Second, you have, or can collect, enough examples of that pattern. Third, someone will act on the prediction, such as calling a customer or ordering stock.

It does not fit when the rules are known and stable (tax calculations), when mistakes are unacceptable and cannot be checked, when data is tiny or unavailable, or when nobody will change a decision because of the output. In those cases a rule, a lookup table or a dashboard is cheaper, easier to explain and easier to maintain.

  • Pattern exists but is hard to write by hand
  • Enough labelled or collectable examples
  • A decision changes because of the prediction
  • Errors are tolerable and can be monitored

Supervised, unsupervised and the space between

Supervised learning learns from input-answer pairs. Classification predicts a category (fraud or not fraud), and regression predicts a number (delivery time in minutes). Unsupervised learning has inputs only. Clustering groups similar rows, dimensionality reduction squeezes many columns into a few, and anomaly detection flags rows that look unusual.

There is a middle ground. If labels are expensive, you can label a small sample by hand and train on that, or use unsupervised methods to find candidates for a person to review. Recommendation and forecasting are supervised in spirit but have their own evaluation methods, which later modules cover.

MapCommon ML task families
Machine learning tasks
  • Supervised: classification
    • Spam or not spam
    • Will this customer cancel?
  • Supervised: regression
    • House price
    • Minutes until delivery
  • Unsupervised: clustering
    • Customer segments
    • Similar documents
  • Unsupervised: anomalies
    • Odd card payments
    • Faulty sensor readings

Baselines: rules, heuristics and dummy models

A baseline is the simplest thing that could work. There are three useful kinds. A dummy baseline ignores the inputs entirely: always predict the most common class, or always predict the average value. A heuristic baseline uses one obvious rule, such as "flag orders over 1,000 euros from new accounts". The current process is also a baseline: if staff already pick which leads to call, their hit rate is the number to beat.

Baselines protect you from fooling yourself. A churn model with 92 percent accuracy sounds great until you learn that 92 percent of customers never churn, so predicting "stays" for everyone scores the same.

Choosing a practical success measure

The success measure should connect to the decision. If a team can only call 200 customers a week, what matters is how many of the top 200 predicted churners really were at risk, not overall accuracy. If late deliveries cost more than early ones, an error measure that treats both sides equally hides the real cost.

Write the measure as a sentence with a target: "Among the 200 customers we call each week, at least 40 should be genuine churn risks, compared with 25 using the current rule." Agree on it before training, so nobody picks a flattering number afterwards. Later modules cover precision, recall, MAE and other metrics in detail.

Learn it in 4 short steps

About 30m each. Track them with a timer in your plan.

  1. 1
    Separate AI, ML, deep learning and generative AI~30m
  2. 2
    Compare supervised and unsupervised tasks~30m
  3. 3
    Consider rules and heuristics as baselines~30m
  4. 4
    Pick a practical success measure~30m

Key points

  • Every deep learning model is machine learning, and every ML system is AI, but not the other way round.
  • Supervised learning needs labelled examples; unsupervised learning finds structure without labels.
  • A simple rule or heuristic is a real baseline, and sometimes it is good enough to ship.
  • Pick one practical success measure tied to the decision the prediction supports.
  • If nobody will act differently because of a prediction, it is not worth building a model.

Key terms

Tap a card to flip it. 0/6 known

Examples

Framing a churn question for a subscription app

The question is "which subscribers will cancel next month?". Step 1: check for past answers. The billing system records cancellations, so labels exist and this is supervised classification. Step 2: name a rule baseline. Subscribers inactive for 30 days or more are flagged. On last year's data, that rule caught 30 percent of churners among the 500 flagged. Step 3: set the success measure. The retention team can contact 500 people a month, so the model must catch more churners within its top 500 than the rule does, say 40 percent. Step 4: record what would make you stop: if the model only reaches 32 percent, the rule stays.

Spotting a question that is not an ML problem

A finance team asks for "an AI that calculates VAT on invoices". Step 1: ask whether there is a pattern to learn. No: VAT rates are published rules that depend on country and product category. Step 2: ask what errors cost. A wrong tax amount is a compliance problem, so a model that is right 99 percent of the time is not acceptable. Step 3: recommend a rules table with tests instead. The code below shows the shape of that answer, which is cheaper and fully auditable.

python
VAT_RATES = {("DE", "standard"): 0.19, ("DE", "reduced"): 0.07}

def vat(net: float, country: str, category: str) -> float:
    rate = VAT_RATES[(country, category)]
    return round(net * rate, 2)

assert vat(100.0, "DE", "standard") == 19.0

Quick reference

  • AI contains ML, ML contains deep learning, deep learning contains generative AI
  • Labelled answers available: supervised. No labels: unsupervised
  • Numeric output: regression. Category output: classification
  • Always write a rule or dummy baseline before training a model
  • Tie the success measure to the decision, such as hits in the top 200 calls
  • No decision changes because of the prediction: do not build the model

Common mistakes

  • Starting with a complex model before checking whether a one-line rule already solves the problem.
  • Choosing accuracy as the success measure when one class is rare, so predicting the majority looks great.
  • Calling a clustering result a prediction; clusters describe data, they do not forecast outcomes.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1A bank wants to group customers by behaviour without any existing labels. Which approach fits?

Question 2

2Which statement about deep learning is true?

Question 3

3Only 3 percent of transactions are fraud. A model reports 97 percent accuracy. What should you check first?

Question 4

4Which task is supervised regression?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Classify each question as supervised regression, supervised classification, unsupervised, or not ML: (a) price of a used car, (b) is this email spam, (c) group shoppers by basket, (d) convert Celsius to Fahrenheit.

  2. Exercise 2medium

    A support team wants to predict which tickets will breach their 24-hour target. Write a rule baseline and a success measure.

  3. Exercise 3hard

    A hospital asks for a model to decide who gets a scarce treatment. List three reasons it may not suit ML, and what you would offer instead.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

What is the difference between AI and machine learning?
AI is the broad goal of computers doing tasks that need judgement. Machine learning is one way to get there, where the system learns patterns from data instead of following hand-written rules.
Do I need deep learning for business data in tables?
Usually not. Classical models such as gradient boosting or logistic regression are often as accurate on tabular data, train faster on a CPU and are easier to explain.
What is a baseline in machine learning?
It is the simplest reasonable approach, such as predicting the most common class or using one obvious rule. Your model must beat it clearly to be worth the extra cost.
Is generative AI the same as machine learning?
Generative AI is a part of machine learning. It uses large deep learning models to create text, images or code, while most business ML predicts a number or a category.

Go deeper

ShareXLinkedInWhatsApp