RedLectern topic

Machine Learning

Learning from data · training and inference · generalization · major learning approaches.

For: Learners · analysts · developers.

After this page you can: Frame a learning problem and recognize a valid evaluation.

Page reviewed

Part of: Artificial Intelligence

About Machine Learning

Machine learning is a way to train a model to make predictions or generate content using data. A useful starting point is to frame the task: what input will the model receive, what output should it produce, and what evidence would show that output is useful? In supervised learning, examples pair features with labels. In unsupervised learning, the task is to find patterns without a supplied answer. Other approaches learn from rewards or construct learning targets from the data itself.

Training adjusts a model using examples; inference applies the trained model to an input. The goal is usually performance on examples the model has not seen. That makes evaluation part of the problem definition: a score on training data alone cannot establish that a model generalizes. Hold out representative data for evaluation, keep it separate from choices made during development, and select measures that match the task and the cost of different errors. AI versus machine learning explains how the two terms relate.

Start here

route

I'm new to machine learning

Start with the core ideas, then try short exercises on data, models, and evaluation.

Start with: Machine Learning Crash Course

route

Focus on evaluating a model

Learn why test data must be separate and what makes an evaluation informative.

Start with: Datasets: Dividing the original dataset

Learn the foundations

1.How models learn from dataA learning problem starts with examples and a task.

A learning problem starts with examples and a task. In supervised learning, examples pair input features with labels that represent the target. Training adjusts a model using examples; inference uses the trained model to produce an output for a new input. Unsupervised learning looks for patterns without supplied target outputs. Self-supervised learning creates surrogate targets from the input data, while transfer learning applies information learned on one task to another.

Choose an approach by asking what information is available and what output is needed. If examples have known answers, prediction may be framed as supervised learning. If the goal is to find structure without answers, an unsupervised approach may fit. These choices describe how learning is organized; they do not by themselves show that the result is useful.

Machine learning

Methods that improve task performance by learning patterns from data or experience.

Training

Adjusting a model using data or experience.

Inference

Using a trained model to produce an output for an input.

Feature

An input property used by a model.

Label

A known answer or target associated with a training example.

Supervised learning

Learning from examples paired with target outputs.

Unsupervised learning

Finding patterns in data without supplied target outputs.

Self-supervised learning

Learning from targets constructed from the input data itself.

Transfer learning

Applying learning from one setting to another task or domain.

Try it

You have labeled examples of house size and sale price. You also have unlabeled examples of customer behavior and want to find groups. Which learning approach fits each task, and what makes them different?

Predicting sale price from labeled examples is supervised learning. Finding groups in customer data without target labels is unsupervised learning.

2.Fit, overfit, and generalizeA model is useful when it performs well on inputs beyond the examples used to train it.

A model is useful when it performs well on inputs beyond the examples used to train it. Overfitting describes a model that fits training examples but performs poorly on new ones. Underfitting describes a model that does not capture useful patterns even in its training data. Generalization is performance on new inputs, and the training data and evaluation design affect how well an evaluation estimates it.

Regularization means adding constraints or penalties intended to reduce unnecessary complexity and overfitting. A hyperparameter is a setting chosen outside the learned parameter values. Use validation data to compare development choices, then reserve test data for a final evaluation. A test set that is repeatedly used to guide model changes can stop providing an independent estimate of performance.

Overfitting

Learning training-data quirks that do not carry over to new data.

Underfitting

Failing to capture useful patterns even in the training data.

Generalization

A model's ability to perform on new inputs beyond its training examples.

Regularization

Constraints or penalties intended to reduce unnecessary model complexity.

Hyperparameter

A setting chosen outside the model's learned parameter values.

Try it

A model's training loss keeps falling, but its validation loss starts rising. What does this pattern suggest, and which data should be kept for a final check?

It suggests overfitting: the model is fitting training data while performance on validation data worsens. Keep a separate test set for the final check.

3.What makes an evaluation validA useful evaluation checks performance on examples that were not used to fit the model or guide its development.

A useful evaluation checks performance on examples that were not used to fit the model or guide its development. A validation set can help compare model choices; a test set can provide a final check after those choices are made. Repeatedly consulting either set while changing the model can make its score less informative. Duplicate examples across training and test sets can also make performance look better than it is.

A test set should reflect the data the model is meant to handle, and the metric should match the task. For example, a model that predicts a numeric value and one that assigns a category do different jobs, so the evaluation needs to match the intended output. A valid evaluation is evidence about a defined setting; it does not guarantee performance when the real inputs differ from the evaluation data.

Try it

A team tests a model on a held-out set, checks the score, changes features, and checks the same set again after every change. Why might the final score be too optimistic?

The team has used test results to guide development, so information about the test set can leak into model choices. The score is no longer an independent final estimate.

Explore subtopics

Latest

No recent updates are available.

See the sources list

Books

Glossary

14 terms on this page.

Browse the AI glossary

Every free Machine Learning course and book on RedLectern

Free Machine Learning online courses

  1. Algorithmic Aspects of Machine LearningMIT 18.409 · Browse materials
  2. Exploring Fairness in Machine Learning for International DevelopmentMIT RES.EC-001 · Browse materials · Video
  3. Machine LearningMIT 6.867 · Browse materials
  4. Machine Learning for HealthcareMIT 6.S897 · Browse materials · Video
  5. Mathematics of Big Data and Machine LearningMIT RES.LL-005 · Browse materials · Video
  6. Mathematics of Machine LearningMIT 18.657 · Browse materials
  7. Matrix Calculus for Machine Learning and BeyondMIT 18.S096 · Browse materials · Video
  8. Matrix Methods in Data Analysis, Signal Processing, and Machine LearningMIT 18.065 · Browse materials · Video
Show all 11 coursesShow fewer courses
  1. Prediction: Machine Learning and StatisticsMIT 15.097 · Browse materials
  2. Introduction to Machine LearningMIT 6.036 · Open on OCW
  3. Machine Learning for Inverse GraphicsMIT 6.S980 · Open on OCW · Video
How these courses are chosen

Listed as Machine Learning courses:

  • those whose title contains “Machine Learning”, or
  • those tagged “Machine Learning” as one of at most 2 topic tags, or as the first of 3.

Free Machine Learning textbooks and books

Show all 22 booksShow fewer books

Questions and comments