Skip to main content

What is supervised learning?

The Harvard Chan AI Glossary

In our classes, we often pause to explain the ideas behind AI and the language used to describe it. These posts grew out of those conversations. They’re for anyone who would like to understand AI better, with no technical background assumed.

Supervised learning is a way to teach a computer system using examples that include the answer it should learn to predict. An example might pair an email with “spam” or “not spam,” or pair a house’s characteristics with its sale price. The system learns patterns that may help it predict answers for new examples.

The information supplied to the system is called the input. The desired answer is the target, sometimes called a label. In a house-price example, size and location are inputs, and the sale price is the target. A feature is an individual characteristic used as an input, such as the number of bedrooms.

During training, the learning process, the model makes predictions and compares them with the supplied answers. The model is the mathematical part of the software that links inputs to outputs. Its internal settings are adjusted to reduce errors across the training examples. People do not need to write a separate pricing rule for every possible house.

Two common tasks are classification and regression. Classification predicts a category, such as whether an email is unwanted. Regression predicts a number, such as a house price. The distinction concerns the kind of answer being predicted, not whether one method is necessarily more sophisticated.

A model can perform well on examples it has already seen and poorly on new ones. This is called overfitting: learning details of the training examples that do not carry over usefully. To check for it, developers set aside examples that are not used for training and examine how well the model predicts their answers.

That separation must be genuine. If information revealing the answer accidentally enters the inputs, the test can look far better than real use. This is called data leakage. For example, a house-price model should not receive a later document that already contains the final sale price when pretending to predict that price in advance.

A psychiatric care-pathway question brings the choice of label into focus. Training on whether a patient was admitted would teach a model to predict historical admission, not necessarily the most appropriate care setting. A sound study design must distinguish observed placement, clinical suitability and actual service availability, with suitable reference judgments and evaluation. The learning method cannot resolve that distinction for us. What we choose as the answer to learn determines the question the model is being taught to answer.

Sources: Google — Supervised Learning; scikit-learn — Common Pitfalls and Recommended Practices.

If you would like to find out more about AI and improve your leadership skills, consider the AI in Health Care Certificate of Specialization from the Advanced Learning Academy at Harvard T.H. Chan School of Public Health. You can take an individual course or work toward the full certificate.


AI is a fast-moving field. This explanation reflects our class discussions and related material at the time of writing. Terminology, capabilities and tools may change.

For suggested additions or corrections, please email me at tpanch@hsph.harvard.edu.

Dr. Trishan Panch
Program Director, AI in Health Care
Harvard T.H. Chan School of Public Health — Advanced Learning Academy