What is machine learning, and how does it work?

What is machine learning? It's a branch of artificial intelligence in which software learns from data instead of following rules a programmer wrote by hand. The trained software, called a model, then makes predictions or creates content from new data.

Last updated November 6, 2026

Dark title card reading "What is machine learning?" under the label AI Guide

The short version

  • Machine learning (ML) trains a model on examples so it can make predictions about data it hasn't seen.
  • Machine learning is a subset of AI. Some AI runs on hand-written rules instead.
  • IBM groups ML into 3 learning paradigms: supervised, unsupervised and reinforcement learning. Google's course adds generative AI as a 4th category.
  • Deep learning is a type of machine learning that uses neural networks with many layers. AWS says it laid the foundation for generative AI.
  • A model is only as good as its training data. Poor or skewed data leads to poor or biased results.

What machine learning means

In basic terms, Google's Introduction to Machine Learning course defines ML as "the process of training a piece of software, called a model, to make useful predictions or generate content (like text, images, audio, or video) from data."

IBM's definition puts it inside the wider field of AI. It calls machine learning "the subset of artificial intelligence (AI) focused on algorithms that can 'learn' the patterns of training data and, subsequently, make accurate inferences about new data."

Google's rainfall example shows the difference from ordinary programming. To predict rainfall the traditional way, you would build a physics-based model of the Earth's atmosphere and solve huge numbers of fluid dynamics equations. With machine learning, you feed a model enormous amounts of weather data until it learns the mathematical relationship between weather patterns and rainfall. You then give it today's weather and it predicts the amount of rain.

How machine learning works

Google's course explains supervised machine learning, which learns from labeled examples, step by step.

Data

A dataset is made of examples, which Google compares to rows in a spreadsheet. Each example has features, the values the model uses to make a prediction, and a label, the answer it should predict. In Google's rainfall model, features include temperature, humidity and wind direction, and the label is the amount of rain.

Google says good datasets are both large and highly diverse. Its example: 100 years of weather data that covers only July would produce poor predictions for January.

Training

During training, the model looks at labeled examples one at a time, makes a prediction and compares it with the real answer. Google calls the difference between the prediction and the real answer the loss. The model then adjusts itself so its next prediction lands closer. If it predicts 1.15 inches of rain and the real figure was 0.75 inches, it shifts its solution toward 0.75.

After going through the dataset, sometimes several times, the model arrives at a solution that makes the best predictions on average.

Evaluating

Google's course says you evaluate a trained model by giving it labeled data but showing it only the features, then comparing its predictions with the real labels to see how well it learned.

Inference

Once it performs well, the model is put to work on new, unlabeled data. IBM calls this inference and says the real goal of training is generalization: good results on real-world data, not just on the training set.

Machine learning vs AI

The 2 terms are often used interchangeably, but IBM sums up the difference: "all machine learning is AI, but not all AI is machine learning." AWS says machine learning "is one of many branches of AI."

Google Cloud suggests thinking of AI as an umbrella term, with machine learning under it alongside other subfields. It lists deep learning, robotics, expert systems and natural language processing among them, though IBM and AWS both class deep learning as a type of machine learning.

The practical difference is how the system gets its logic. IBM's example of the simplest AI is a thermostat with hand-written rules: if the room is below 67 degrees, turn on the heater; if it's above 72 degrees, turn on the air conditioning. IBM says it can make decisions without further human intervention.

A machine learning system learns its logic instead. IBM uses a spam filter to show the difference. A rules-based filter needs a person to write the criteria for spam by hand. A machine learning filter is shown sample emails, guesses which are spam and is adjusted after each error until it is accurate.

Types of machine learning

IBM sorts all machine learning into 3 learning paradigms, based on how the model is trained. Google's Introduction to Machine Learning course uses the same 3 and adds generative AI as a 4th category.

TypeHow it learnsExamples from the sources
Supervised learningFrom labeled examples that include the correct answerSpam detection, rainfall prediction, house prices
Unsupervised learningFinds patterns in data without labelsGrouping weather data into clusters that reveal the seasons
Reinforcement learningGets rewards or penalties for its actions in an environmentTeaching robots to walk around a room, AlphaGo playing Go
Generative AI (Google's 4th category)Learns patterns in data, then produces new but similar dataText, images, music, video and code

Supervised learning

The model trains on data where a human has supplied the correct results, which is why Google calls it "supervised." Google names regression and classification as 2 of the most common uses. Regression predicts a number, such as a house price or a ride time. Classification predicts a category, such as whether an email is spam or a photo contains a cat.

Unsupervised learning

The model gets data with no labels and looks for meaningful patterns. A common technique is clustering, which puts similar data into groups. Google points out that the model doesn't know what the groups mean. A person has to look at them and name them.

Reinforcement learning

The model acts in an environment and receives rewards or penalties. Over time it builds a policy, the strategy that earns the most reward.

Machine learning vs deep learning

Deep learning is a type of machine learning. IBM describes it as machine learning driven by artificial neural networks with many layers, which is where the word "deep" comes from. The networks are loosely inspired by the brain: layers of connected nodes pass their results to the next layer until the last one produces the output.

IBM says deep learning needs very large amounts of data and computing power. AWS says it is suited to complex tasks such as image and speech recognition and "laid the foundation for advances in generative artificial intelligence."

Machine learning vs generative AI and LLMs

Google's course treats generative AI as one category of machine learning system. It describes it as a class of models that creates content from user input, such as images, music, summaries or explanations. In Google's words, generative models "learn patterns in data with the goal to produce new but similar data." Our guide to what generative AI is covers how those models work.

Large language models (LLMs) are machine learning models too. IBM says they typically go through pre-training and fine-tuning with variants of supervised learning, then further fine-tuning with reinforcement learning techniques such as reinforcement learning from human feedback (RLHF). Our guide to AI agents explains how LLMs are used to carry out tasks.

Examples of machine learning

Google lists everyday tasks such as predicting the weather, estimating travel times, recommending songs, auto-completing sentences, summarizing articles and generating new images. Other examples:

Our guide to running AI locally on a laptop explains what's realistic on your own hardware.

Limits and risks of machine learning

AWS lists several challenges in putting machine learning to work:

AWS also notes that most software responds predictably: if the user does this, they get that. Machine learning algorithms are probabilistic, so a model can only say there is a certain chance of an outcome.

Frequently asked questions

What is machine learning in simple words?

It's teaching a computer by example instead of by instruction. A model studies lots of data, finds patterns and uses them to make predictions about new data, such as whether an email is spam.

Is machine learning the same as AI?

No. Machine learning is a subset of AI. Some AI systems follow rules a person wrote, while machine learning systems learn their rules from data.

When did machine learning begin?

IBM says the term is often attributed to Arthur L. Samuel's 1959 article in the IBM Journal, "Some Studies in Machine Learning Using the Game of Checkers." IBM notes that this is the origin of the term, not of the concept itself.

Is machine learning hard to learn?

AWS says it requires a strong foundation in mathematics, statistics, coding and data technologies. IBM says people who use open source ML libraries such as PyTorch, TensorFlow and Scikit-learn need to know a programming language, particularly Python.

More in AI

Sources