Data Science & AI Literacy · Foundations

Machine Learning Basics

Want it in plain words first? Jump to Eli explains — the same idea, no jargon.
On this page 9 sections
  1. In 30 seconds
  2. Why this matters
  3. The college version
  4. Eli explains
  5. Worked example
  6. Key takeaway
  7. Quick check
  8. Study tools
  9. Sources & references

In 30 seconds

is a way of building programs that get better at a task by learning patterns from examples, instead of following rules a person wrote in advance. Every machine-learning setup needs three things: data to learn from, a task to improve at, and a way to measure improvement. The program fits a to the data during training, then applies that pattern to new cases. It powers recommendations, translation, medical-imaging assistance, and fraud detection, and it inherits the quality of the data it learned from.

Why this matters

Machine learning sits behind everyday products, from the films a service suggests to the messages it filters, and more people will meet it in work and public life. Knowing what machine learning can and cannot do changes how you read claims about artificial intelligence: you can recognize when a system learned from data, ask what data shaped it, and judge whether that data was good enough. Academically, it is the entry point to data science and AI courses. Practically, it lets you evaluate products, news stories, and workplace tools more carefully. And because learning machines inherit the strengths and limits of their , a basic grasp of the idea is also a basic safeguard.

The college version

What machine learning is (and is not)

Machine learning is a way of building software that improves at a task by learning patterns from examples. IBM describes it as the subset of artificial intelligence focused on algorithms that learn the patterns in training data and then make accurate inferences about new data, without explicit, hard-coded instructions. Google Cloud puts it similarly: systems that learn and improve without being explicitly programmed. The contrast is with traditional software, where a human writes every step in advance, as in a calculator. When people say a program "learns," they mean something measurable: given examples, the program gets better at the task, not that it understands the world the way a person does. Because the word is used loosely, check what a system actually does before accepting a claim.

The three ingredients

Every machine-learning setup has three ingredients. First, data: the examples the program learns from, such as past sales, photos, or emails. Second, a task: the thing the program should get better at, such as sorting photos, predicting a number, or grouping customers. Third, a measure of improvement: some way to tell whether the program is doing better, such as counting how often its predictions are wrong. Google Cloud describes training as optimizing the so it predicts the expected outcome, with a loss function that measures the model's errors. IBM frames the same idea as the central premise of machine learning: optimize a model's performance on a dataset of tasks that resemble the real problem, and it will predict well on new data. If any ingredient is missing, there is nothing to learn from, nothing to aim at, or no way to know whether the program improved.

Learning versus programming

The clearest way to see what machine learning changes is to compare it with rules written by hand. Consider a spam filter. The traditional approach asks people to anticipate every trick a junk email might use: phrases like "free" and "prize", addresses from unknown senders, all-capital subject lines. Each rule is a guess, and spammers change tactics, so the rule list must be rewritten again and again. The machine-learning approach turns this around: instead of writing rules, the builders gather thousands of real emails that people have already marked as spam or not spam, and the program finds the patterns itself, including patterns no one thought to write down. IBM makes exactly this contrast: a rules-based filter requires a data scientist to manually devise accurate, universal criteria, while machine learning needs an appropriate algorithm and an adequate dataset of sample emails. A person still chooses the data and the goal, but the program discovers the rules.

The two big families

Machine-learning methods fall into two big families, and knowing the split explains most headlines you will read. In , the training examples come with known answers, called labels: photos labeled "cat" or "dog", emails marked spam or not. The program learns to map each example to its answer. In , the examples carry no supplied answers; the program finds structure on its own, such as grouping similar items together. Google Cloud's description captures both: supervised learning uses labeled training data where the output is known, while unsupervised learning uses unlabeled data and categorizes it into groups based on attributes. IBM adds that clustering, a common unsupervised method, is used for tasks like market segmentation and fraud detection. Other families exist, but supervised and unsupervised are the two you will meet most often, and their details belong to separate topics.

Training and using: a simple mental model

A useful mental model has two phases. Training is fitting a pattern to the data: the program adjusts its internal pattern until it matches the examples well. Google Cloud calls this the fitting process, in which the algorithm fits the model to the data. Using, sometimes called , is applying that fitted pattern to new cases it has not seen before: a new email, a new photo, tomorrow's weather. IBM describes the goal as making accurate predictions on the new data the model sees in its ultimate use case. This is why machine learning is attractive: the hard work of pattern-finding is done once, during training, and the fitted pattern then works cheaply and quickly. Knowing which phase a claim is about, learning from data or applying what was learned, clears up a surprising amount of confusion.

Where machine learning shows up, and why it is not magic

Machine learning is already woven into ordinary life. Streaming and shopping services use it for recommendations, a use Google Cloud and IBM both describe. Translation tools lean on it, as Google Cloud's transcription and translation examples show. In healthcare, computer vision systems assist with diagnostics, from reading medical images to flagging patterns in patient records; IBM names healthcare diagnostics among computer vision's uses, and Microsoft's ML for Beginners curriculum cites predicting the likelihood of disease from a patient's medical history. Banks and card networks use machine learning for fraud detection, a use both Google Cloud and IBM mention. None of this is magic. A model can only reflect the data it learned from: Google Cloud warns that a model cannot rise above the data it is fed, Microsoft's curriculum states that poor or noisy data leads to inaccurate predictions, and NIST's AI Risk Management Framework observes that data used to build an AI system may not truly represent the intended use. is the blunt version of the same rule. How bias enters models through their training data is a topic of its own.

Eli, the EliExplains learning guide

Eli explains

The same idea, in plain words

Explain it like I’m 10

Machine learning is a way to build software that teaches itself from examples. You do not write down the rules; you hand the program a pile of examples and a goal, and it finds the pattern on its own. Show it a thousand emails people have flagged as spam, and it learns what spam tends to look like. Show it photos labeled cat and dog, and it learns the difference. Later, when something new arrives, it applies the pattern it found. It never knows what spam or a cat really is; it only knows what the examples looked like. That is why it is only as good as the data you gave it.

Picture it like this

Imagine learning to recognize your aunt's handwriting. Nobody hands you a rule book saying the letter a has a loop that leans left; you simply see many letters and notes over the years, and your eye picks up the pattern. Later you can tell her shopping list from a stranger's at a glance. A machine-learning program does the same thing, except it sees examples as numbers and adjusts its internal pattern until its answers match the examples. Training is the years of letters; using is reading the next envelope.

Where the picture stops working

The comparison breaks down in two ways. A person learns from a handful of examples and can ask whose writing this is and why, while a machine-learning program usually needs enormous numbers of examples and cannot explain itself or ask questions. And your recognition comes with real understanding of the person, while the program has only the statistical pattern it fitted; it does not know what handwriting is, it just matches.

Worked example

FreshBrew Coffee wants to predict how many pastries to bake each morning. The rule-based approach: the owner writes a schedule from experience, bake 40 on weekdays, 60 on weekends, 80 when it rains, and updates those rules by hand whenever things change. The machine-learning approach: the shop records three years of daily pastry sales alongside the date, the weather, and nearby events. A learning program is trained on this data. Its task is to predict tomorrow's sales, and improvement is measured by how far its predictions miss the actual sales. During training it fits a pattern: rainy Saturdays before a festival sell more than sunny Mondays, and so on. Each morning it reads the forecast and the calendar, applies the fitted pattern, and prints a prediction the owner can adjust. When a competing café opens nearby, the new sales data slowly reshapes the pattern. The owner never writes a single rule; the program learns them from examples.

Key takeaway

Machine learning builds programs that improve at a task by learning patterns from examples, and every setup needs data, a task, and a measure of improvement. The pattern is fitted during training and applied to new cases, and it can only be as good as the data it learned from.

Quick check

3 questions here, of 5 in this lesson’s practice set. Answers stay hidden until you check.

Question 1 of 3foundational

Which statement best describes machine learning?

Choose an answer, then check it.
Question 2 of 3intermediate

A team wants software that separates photos of ripe bananas from photos of unripe ones. They collect thousands of photos, each already labeled "ripe" or "unripe", and the program learns from those labels. Which family of machine learning is this?

Choose an answer, then check it.
Question 3 of 3intermediate

A music streaming service wants to recommend songs. It lets the program examine listening histories and group listeners into types by similarity, without anyone telling it which type a listener belongs to. Which family does this belong to?

Choose an answer, then check it.
Practice all 5

Keep learning

Ready to build on this? Continue to the next lesson.

Practice this lesson
Study tools & related lessonsYou’ll learn to · Common mistakes · Easily confused · Key vocabulary · Related

You’ll learn to

  • Define machine learning as programs that improve at a task by learning patterns from examples rather than following hand-written rules.
  • Name the three ingredients of any machine-learning setup: data, a task, and a measure of improvement.
  • Distinguish machine learning from conventional programming, using spam filters as the example.
  • Explain, at a conceptual level, the difference between the two main families: supervised and unsupervised learning.
  • Apply the mental model of training (fitting a pattern) and using (applying it to new cases) to a real-world scenario.
  • Analyze why a model can only be as good as the data it was trained on.

Common mistakes

  • Thinking machine learning means a program was given all its rules in advance.

    Hand-written rules are the traditional programming approach. In machine learning, the program discovers patterns from examples. A person still chooses the data and the goal, but not the rules.

  • Believing more data always means a better model.

    Quantity is not quality. The data must be relevant, clean, and representative of the real situation; poor or noisy data leads to inaccurate predictions no matter how much of it there is.

  • Using the words machine learning and artificial intelligence as if they always mean the same thing.

    Machine learning is a subset of artificial intelligence. Rule-based systems are also AI, but they do not learn from data; saying a system is AI does not tell you it used machine learning.

  • Assuming a model trained on one kind of data will work well on any new situation.

    A model applies the patterns it learned. If the new cases differ from the training data, performance drops; the training data must resemble the real problem the model will face.

Easily confused

Traditional programming vs. Machine learning

Both start with a goal, but in traditional programming a human writes the rules in advance, while in machine learning the program discovers the patterns from examples. The knowledge lives in different places.

Supervised learning vs. Unsupervised learning

Supervised learning trains on examples that carry known answers, called labels; unsupervised learning finds structure, such as groups, in examples with no supplied answers. The presence or absence of answers is the whole difference.

Training vs. Using (inference)

Training is fitting a pattern to the data; using is applying that fitted pattern to new cases. The same program does both at different times, and the two phases are easy to confuse in conversation.

Key vocabulary

machine learning
A way of building programs that improve at a task by finding patterns in examples, instead of following rules written in advance by people.
training data
The examples a machine-learning program learns from during training, such as labeled photos or past sales records.
pattern
A recurring relationship or structure in data that a program can exploit to make predictions or decisions.
model
The fitted pattern a program produces during training, which it then applies to new cases.
supervised learning
The family of machine learning in which training examples come with known answers, called labels, that the program learns to produce.
unsupervised learning
The family of machine learning in which the program finds structure, such as groups, in examples that carry no supplied answers.
label
The known answer attached to a training example, such as "spam" on an email, used in supervised learning.
inference
Applying a trained model to new cases to produce predictions or decisions.
garbage in, garbage out
A shorthand rule that a model's output is only as reliable as the data it learned from.

Sources & references

  1. What is Machine Learning? Types and uses — Google Cloud
  2. What is Machine Learning? — IBM
  3. ML for Beginners — Introduction to machine learning — Microsoft Learn (GitHub curriculum)
  4. AI Risk Management Framework (AI RMF) — National Institute of Standards and Technology (NIST)
  5. Elements of AI — A free online introduction to artificial intelligence for non-experts — University of Helsinki & MinnaLearn

EliExplains lessons are original prose written from the open, credible references above. See Copyright & Licensing.

Researched 2026-08-21

Educational content only. It is not medical, legal or professional advice. Found an error? Tell us.