Machine LearningStart here

What is machine learning?

See how a computer uses examples to learn patterns and make predictions.

8 min read Written learningAI & Machine Learning

A traditional program follows rules written by people. In machine learning, a developer instead chooses a learning method and supplies examples. The training process adjusts a model so that it captures patterns in those examples. The trained model can then be used on new inputs.

A spam filter as an example

Imagine a collection of emails that people have labeled as spam or not spam. A learning algorithm can examine patterns in the examples—such as words, links, or sender behavior—and adjust a model to distinguish the two groups. When a new email arrives, the model estimates which group it resembles.

The model has not been handed a perfect list of rules like 'if this phrase appears, always mark it as spam.' It has learned statistical relationships from examples. That can make it useful when patterns are too varied to specify by hand, but the result depends heavily on the quality and coverage of the data.

Training and inference

Training is the process of using data to adjust a model. Inference is the later process of using that trained model to produce an output for a new input. For the spam filter, training happens as the model learns from labeled email; inference happens when it scores a message it has not seen before.

Three common learning setups

These categories describe how feedback or structure is provided during learning:

  • Supervised learning uses examples paired with a target answer, such as photos labeled with the objects they contain.
  • Unsupervised learning looks for structure in data without target answers, such as grouping customers by similar behavior.
  • Reinforcement learning trains an agent through actions and feedback, often described as rewards or penalties over time.

When machine learning is useful

Machine learning is especially useful when a task has many examples and the desired behavior is difficult to write as a complete set of rules—for example, recognizing speech or estimating demand. It is not automatically the best tool. If a task has a small, clear set of rules, ordinary software may be simpler, easier to explain, and more reliable.

What to remember

  • A model is learned from data rather than being fully specified by hand-written task rules.
  • Training adjusts the model; inference uses it on new inputs.
  • The type and quality of data shape what the model can learn.
  • Machine learning is one set of methods within the broader field of artificial intelligence.

Keep following what you understand. This article is part of a growing knowledge library; related topics can help you explore the ideas around it.