Skip to content
ContentLora

    Tip: press / anywhere to search.

    Explainer

    How machine learning works: data, models, training and testing

    Machine learning is the process of training software, called a model, to make predictions or generate content from data, rather than following step-by-step instructions written by a programmer.[1][2] Systems learn in four broad ways: supervised, unsupervised, reinforcement learning and generative AI.[3] During training a model compares its predictions with known answers and adjusts its numbers to reduce the error, then it is tested on examples it has never seen.[4][5]

    Editor reviewedUpdated Explainer22 claims · 100% primaryArtificial intelligence, Computing
    Reading level: 2 passages differ; the rest is the same for everyone.

    This page explains the general ideas behind machine learning. For the networks used in most modern AI, see how neural networks work; for chatbots, see how large language models work.

    Learning from examples instead of rules

    Ordinary software follows a recipe: a programmer writes exact steps, and the computer carries them out.[2] Machine learning works differently. The computer learns by example, which lets it handle problems that are too vague or complicated to write down as step-by-step instructions.[2] The result of that learning is a model, a piece of software that makes predictions or generates content from data.[1]

    Google’s machine learning course defines ML as training a model to make useful predictions or generate content from data.[1] In supervised learning, the model itself is a complex collection of numbers defining the mapping from input feature patterns to output values, and those learned numbers, the weights and biases, are its parameters.[6] NIST’s AI Risk Management Framework takes a wider view: an AI system is an engineered or machine-based system that generates outputs such as predictions, recommendations or decisions for a given set of objectives.[7]

    Google’s course gives a weather example. A traditional rainfall app would model the atmosphere with huge numbers of fluid-dynamics equations; an ML approach instead feeds a model large amounts of weather data until it learns the relationship between weather patterns and rainfall.[8]

    Four ways machines learn

    Google’s course sorts ML systems into four categories by how they learn, and a system can belong to more than one.[3]

    • Supervised learning. People supply data with the correct answers attached, and the model learns the connections that produce those answers. Its two most common uses are regression, which predicts a number, and classification.[9]
    • Unsupervised learning. The model gets data without answers and looks for groupings, typically by clustering. People then decide what the clusters mean.[10]
    • Reinforcement learning. The model acts in an environment, receives rewards or penalties, and builds a policy for earning the most reward. It has been used to train robots and the Go-playing program AlphaGo.[11] For robots specifically, see how robots learn.
    • Generative AI. Models that create new content, such as text, images, audio or video, from a user’s input.[12]

    Data, features and labels

    Data drives supervised learning. A dataset is made of examples, and each example has features, the values the model uses to make a prediction, and a label, the answer it should predict.[13] In a rainfall model, features might include temperature and humidity, and the label would be the amount of rain.[13]

    Good datasets are both large and diverse, and size alone does not guarantee enough variety.[14] Data can also shift after a model is built: NIST notes that AI systems may be trained on data that changes over time, sometimes significantly and unexpectedly, in ways that affect how they work.[15] Where large training datasets come from is covered in where AI training data comes from.

    Training: shrinking the error

    Training is practice with an answer key. The model makes a guess for an example, checks it against the right answer, and nudges itself to do better next time.[4] The size of the miss is called the loss.[4] Gradient descent repeats these adjustments until the model finds the settings with the lowest loss.[16]

    The model compares each prediction with the label, computes the loss, and updates its parameters so that it can make good predictions on unseen data.[4] Gradient descent is the standard technique: it iteratively adjusts the weights and bias towards the combination with the lowest loss.[16] In neural networks, an algorithm called backpropagation makes gradient descent practical across many layers.[17]

    Testing on data the model has not seen

    Models should be tested on different examples from those used to train them, and datasets are traditionally split to make that possible.[5] Evaluation gives the model only the features of a labeled dataset and compares its predictions with the true labels.[18]

    The main danger is overfitting: a model that memorizes its training set so closely that it fails on new data.[19] Google stresses that this is a common problem in practice, not a hypothetical one.[19] Once a model performs well in testing, using it on new, unlabeled examples is called inference.[18]

    Why machine learning took off

    Research on neural networks goes back to the 1940s,[20] but the Nobel Committee for Physics dates the current machine learning revolution to around 2010 and credits two ingredients: vast amounts of data for training and an enormous increase in computing power.[21] Today’s artificial neural networks are often enormous deep networks built from many layers, and large language models can contain more than a trillion parameters.[22] The next page in this series explains how those neural networks work.

    Developing in AI & Computing

    Questions readers ask

    What is machine learning in simple terms?

    It is the process of training a piece of software, called a model, to make useful predictions or generate content from data. Instead of following a fixed recipe, the computer learns by example.[1][2]

    What are the main types of machine learning?

    Google's course groups them as supervised learning (learning from examples with correct answers), unsupervised learning (finding groupings in unlabeled data), reinforcement learning (learning from rewards and penalties) and generative AI (creating new content).[3][9][10][11][12]

    What does "training" a model mean?

    The model makes a prediction for each labeled example, measures the difference from the right answer (the loss), and gradually updates its numbers to reduce that loss. Gradient descent is the standard technique for finding the settings with the lowest loss.[4][16]

    What is overfitting?

    Overfitting is when a model matches, or memorizes, its training data so closely that it fails on new data. Google calls it a common problem in machine learning, which is why models are tested on examples kept separate from training.[19][5]

    Why has machine learning taken off since about 2010?

    The Nobel Committee for Physics credits access to vast amounts of training data and an enormous increase in computing power for the machine learning revolution that started around 2010.[21]

    Sources

    · 22 claims from 3 publishers

    Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.

    1. [1]

      Google's machine learning course defines machine learning as the process of training a piece of software, called a model, to make useful predictions or generate content from data. confirmedas of 2026-11-07

    2. [2]

      The Nobel Committee for Physics contrasts machine learning with traditional software, which follows a clear step-by-step recipe; in machine learning the computer learns by example, which lets it handle problems too vague or complicated for step-by-step instructions. confirmedas of 2024-10-08

    3. [3]

      Google's course groups ML systems into four categories by how they learn, supervised learning, unsupervised learning, reinforcement learning and generative AI, and a system can fall into more than one. confirmedas of 2026-11-07

    4. [4]

      During training, a model compares its prediction with the actual label; the difference is called the loss, and the model gradually updates itself to reduce it. confirmedas of 2026-11-07

    5. [5]

      Models should be tested on different examples from those used to train them; datasets are traditionally split, and Google's course recommends separate training, validation and test sets. confirmedas of 2026-11-07

    6. [6]

      In supervised learning, a model is a complex collection of numbers that defines the mathematical relationship between input features and output labels; these learned numbers, the weights and biases, are called parameters. confirmedas of 2026-11-07

    7. [7]

      NIST's AI Risk Management Framework defines an AI system as an engineered or machine-based system that can generate outputs such as predictions, recommendations or decisions for a given set of objectives. confirmedas of 2023-01-26

    8. [8]

      Google's course illustrates the difference with rainfall prediction; a traditional approach would model the atmosphere with fluid-dynamics equations, while an ML approach feeds a model large amounts of weather data until it learns the relationship between weather patterns and rainfall. confirmedas of 2026-11-07

    9. [9]

      Supervised learning models learn from data that includes the correct answers; a human supplies data with known correct results, and the two most common uses are regression, which predicts a number, and classification. confirmedas of 2026-11-07

    10. [10]

      Unsupervised learning finds groupings in data that has no correct answers attached, typically through clustering, and it is left to people to decide what the clusters mean. confirmedas of 2026-11-07

    11. [11]

      Reinforcement learning models learn from rewards or penalties for actions taken in an environment and produce a policy, a strategy for earning the most reward; it has been used to train robots and the Go-playing program AlphaGo. confirmedas of 2026-11-07

    12. [12]

      Generative AI is a class of models that create content, such as text, images, audio or video, from user input. confirmedas of 2026-11-07

    13. [13]

      In supervised learning, a dataset is made of examples; each example has features, the values the model uses to predict, and a label, the answer the model should predict. confirmedas of 2026-11-07

    14. [14]

      Google's course says good datasets are both large and diverse, and that a large dataset does not guarantee enough diversity. confirmedas of 2026-11-07

    15. [15]

      NIST notes that AI systems may be trained on data that can change over time, sometimes significantly and unexpectedly, affecting how they work in ways that are hard to understand. confirmedas of 2023-01-26

    16. [16]

      Gradient descent is the mathematical technique that repeatedly adjusts a model's weights and bias to find the combination with the lowest loss. confirmedas of 2026-11-07

    17. [17]

      Backpropagation is the most common training algorithm for neural networks; it makes gradient descent feasible for networks with many layers, and machine learning libraries usually handle it automatically. confirmedas of 2026-11-07

    18. [18]

      A trained model is evaluated by giving it only the features of a labeled dataset and comparing its predictions with the true labels; once it performs well, using it to predict on new, unlabeled examples is called inference. confirmedas of 2026-11-07

    19. [19]

      Overfitting means building a model that matches, or memorizes, its training data so closely that it fails to make correct predictions on new data; Google calls it a common problem in machine learning. confirmedas of 2026-11-07

    20. [20]

      Researchers began reasoning about the mathematics of the brain's network of neurons and synapses in the 1940s; at the end of the 1960s, discouraging theoretical results led many to suspect such networks would never be useful. confirmedas of 2024-10-08

    21. [21]

      According to the Nobel Committee, the machine learning revolution that began around 2010 was made possible by access to vast amounts of training data and an enormous increase in computing power. confirmedas of 2024-10-08

    22. [22]

      Today's artificial neural networks are often enormous and built from many layers; these are called deep neural networks, and training them is called deep learning. Large language models can contain more than one trillion parameters. confirmedas of 2024-10-08

    Revision history (1)
    1. Page created.

    Created Nov 7, 2026. Last reviewed by an editor on Nov 8, 2026. Next scheduled review: May 7, 2027.

    Cite this page

    "How machine learning works: data, models, training and testing." ContentLora, updated Nov 7, 2026. https://contentlora.com/explain/how-machine-learning-works

    Spotted an error? Suggest a correction or emailcorrections@contentlora.com.