What Is Machine Learning?

Machine learning is a way to build software that learns patterns from examples instead of following rules a person wrote. You give it data, it adjusts itself to make fewer mistakes, and then it makes predictions about things it has never seen.

01 / Train

Train a tiny model in your browser

Each dot is one labeled example. The model starts knowing nothing (a 50/50 guess). Press Train and it nudges three numbers to make fewer mistakes. That adjusting is the “learning”. The data is made up for teaching.

Spam filter chart: Links in the email across, Share of ALL-CAPS words up. 20 labeled points.

Across: Links in the email. Up: Share of ALL-CAPS words.

Not spamSpam

Clicking the chart will…
Or place a point by coordinates

Steps: 0 · Points: 20 · Accuracy: 50% · Error: 0.693

Untrained: every prediction is 50/50. Press Train.

Under the hood: logistic regression trained with gradient descent, the same idea behind much bigger models, just with 3 numbers instead of billions. Nothing leaves this tab.

How a machine actually “learns”

  1. 1. Collect examples

    Gather data, often with the right answer attached: emails marked spam or not spam, photos labeled cat or dog.

  2. 2. Guess

    The model starts with random or blank settings and makes a prediction for each example.

  3. 3. Measure the error

    A loss function scores how wrong the guesses are. Lower is better.

  4. 4. Adjust and repeat

    Gradient descent nudges the settings to lower the error, thousands of times. The trained model is then tested on data it never saw.

Traditional software: a person writes the rules, the computer applies them. Machine learning: a person supplies examples, and the computer works out the rules. The term was popularized by IBM researcher Arthur Samuel, whose 1959 checkers program improved by playing against itself.

Types of machine learning: supervised vs unsupervised vs reinforcement

The three classic families. Real systems often combine them.
TypeLearns fromGoalEveryday examples
Supervised learningLabeled examples: inputs with the right answerPredict the label for new inputsSpam filters, price prediction, medical image screening
Unsupervised learningUnlabeled dataFind groups or structure on its ownCustomer segments, anomaly detection, topic grouping
Reinforcement learningRewards and penalties from actionsLearn a strategy that earns the most rewardGame-playing AI, robot control, tuning chatbot replies

The demo above is supervised learning: every point has a label. Large language models add a fourth flavor, self-supervised learning, where the label is simply the next word in real text, so no one has to label billions of examples by hand. See What Is an LLM? to watch that in action.

AI vs machine learning vs deep learning

AI contains machine learning, which contains deep learningThree nested ovals. The outer oval is artificial intelligence. Inside it is machine learning. Inside that is deep learning, which includes large language models.Artificial intelligenceMachine learningDeep learningLLMs, image models
Artificial intelligence (AI)
The broad goal: computers doing tasks that seem to need intelligence. Includes hand-written rule systems, such as old chess engines and expert systems.
Machine learning (ML)
The part of AI that learns from data instead of fixed rules. Spam filters, recommendations and fraud scores.
Deep learning
Machine learning with many-layered neural networks. It needs lots of data and computing power, and powers speech recognition, face unlock and ChatGPT.

02 / Test yourself

Is it machine learning? 10-question quiz

The test: does the system learn its behavior from data, or follow rules a person wrote?

  1. 1. An email filter that improves as people mark messages as spam

  2. 2. A thermostat that turns the heat on whenever the room drops below 68°F

  3. 3. A streaming service suggesting shows based on what similar viewers watched

  4. 4. A calculator app adding up your receipts

  5. 5. Face unlock on a phone

  6. 6. A spreadsheet formula that flags any expense over $500

  7. 7. ChatGPT writing a reply

  8. 8. A bank scoring each card payment for fraud risk

  9. 9. A spell checker that only flags words missing from a fixed word list

  10. 10. A maps app predicting your arrival time from live and past traffic

0 of 10 answered

How to use the demo

  1. 1. Pick a dataset

    Choose a preset such as the spam filter, or clear the chart and click to add your own labeled points.

  2. 2. Train the model

    Press Train to run gradient descent. Watch the error fall and the dividing line move toward the best split.

  3. 3. Ask about a new point

    Switch to Ask the model and click anywhere. The trained model predicts a class for a point it has never seen.

  4. 4. Take the quiz

    Decide whether ten everyday systems learn from data or follow fixed rules, then check your score.

Machine learning questions, answered

What is machine learning?

Machine learning is a way to build software that learns patterns from examples instead of following rules a person wrote by hand. You show it data, it adjusts its internal numbers to make fewer mistakes, and then it makes predictions about new data.

What is the difference between AI and machine learning?

Artificial intelligence is the broad goal of making computers do tasks that seem intelligent. Machine learning is one way to get there: learning from data. Most AI products today use machine learning, but a hand-written rule system can also be called AI.

Is ChatGPT machine learning?

Yes. ChatGPT runs on a large language model, which is a deep learning model. It was trained on large amounts of text to predict the next token, then refined with human feedback. Deep learning is a kind of machine learning.

What is deep learning?

Deep learning is machine learning that uses neural networks with many layers. It powers image recognition, speech recognition and large language models. It usually needs much more data and computing power than simpler methods.

Do you need to code to use machine learning?

Not to use it: many apps and no-code tools have ML built in. To build or train your own models, most people use Python and libraries such as scikit-learn or PyTorch. The demo on this page needs no code.

Is machine learning hard to learn?

The core idea is approachable: show examples, measure errors, adjust. Building reliable models takes practice with data, statistics and evaluation. Start with a short course and small projects before advanced math.

Want to go further? Google’s free Machine Learning Crash Course covers the same ideas with code.

Put AI to work in your own workflows

Tornic connects your existing AI coding CLIs into visual, repeatable workflows, so you can use machine learning models without wiring everything by hand.

Explore Tornic

Related free tools