Skip to main content

What is logistic 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.

Logistic regression is a statistical model commonly used to estimate the probability of an outcome with two possible values: for example, whether an appointment will be missed or attended. It is also widely used in machine learning. Despite its name, it is often used for classification, which means assigning cases to categories.

The model starts with input features: characteristics such as age, previous attendance or days until an appointment. It gives each feature a learned weight, combines the weighted values and transforms the result into a number between zero and one. That number is interpreted as a probability under the model.

This transformation is the logistic function, a curve that keeps the estimate within the probability range. The model is linear in the log-odds, not in probability itself. Odds compare the chance of an outcome with the chance of its alternative. You do not need to calculate log-odds to use the model, but the distinction explains why a fixed change in an input need not produce the same change in probability for every person.

A probability and a decision are different outputs. A service might flag cases above a chosen threshold, but that threshold is a separate choice. It depends on the costs of missed cases, unnecessary action and the service’s capacity to respond.

Logistic regression is relatively inspectable, especially when it uses a manageable number of well-defined features. That does not make it automatically unbiased or causal. Its coefficients describe relationships conditional on the other included variables and the model’s assumptions. Correlated inputs, missing data and a misleading target can complicate interpretation.

A clinic could use logistic regression as a baseline when studying appointment non-attendance. It is worth comparing a more complicated model against this baseline before assuming complexity adds value. The evaluation should check whether predicted probabilities match observed rates and whether offering additional support helps patients. A high predicted risk is not a justification for making access harder; that would be a separate, potentially harmful policy decision.

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).

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