What is linear regression?
The 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.
Linear regression is a statistical method for estimating a numerical outcome from one or more input characteristics. A model might estimate monthly electricity use from temperature and building size, or expected appointment demand from the day of the week and recent activity. It describes the outcome as a baseline value plus a weighted combination of inputs.
With one input, the familiar picture is a straight line fitted through a scatter of observations. The slope describes how the predicted outcome changes as the input changes. The intercept is the predicted value when the inputs are zero, although that value is not always meaningful in the real setting.
With several inputs, each coefficient describes a relationship while the other included inputs are held fixed within the model. “Linear” refers to how the coefficients enter the calculation. A model can include transformed inputs, such as age squared, and still be a linear regression model in its coefficients.
A common fitting method chooses the coefficients that minimize the sum of squared differences between predictions and observed values. Squaring makes large errors count more strongly than small ones. This is one choice of loss function: a rule for measuring how wrong the model’s predictions are.
There are two common uses. Prediction asks how well the model estimates outcomes for new cases. Statistical inference asks what the data suggests about relationships and their uncertainty, subject to assumptions. Neither use makes a coefficient automatically causal. A relationship between staffing and waiting time may reflect the fact that busy services employ more staff, rather than staff causing longer waits.
An urgent-care service forecasting daily patient arrivals should test its model on later periods, account for seasonal patterns and examine unusual errors. Forecasting an average is not enough when a winter respiratory surge can overwhelm staffing. Linear regression can be an informative starting point because its calculation is relatively straightforward. Its usefulness depends on the question, the data and the adequacy of its assumptions—not on being either “traditional statistics” or “AI.”
Sources: scikit-learn — Linear Models
Further reading from Harvard Chan: Public Health Perspectives — To Meet Future Needs, Health Care Leaders Must Look at the Data (Science) (2022); Harvard Chan — Using advanced statistics and AI to improve health (2026).
To learn more, take a look at 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.
I’m a doctor, not a statistician. I teach the AI in Health Care Certificate of Specialization with Dr. Heather Mattie, a statistician and co-director of Harvard Chan’s Health Data Science master’s program. For more on data science and statistics, see Harvard Chan’s Health Data Science resources.
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
Lead with AI in Health Care
The AI Pragmatist is a monthly newsletter from ALA faculty, with new explainers & essays from the Advanced Learning Academy