# Logistic Regression Algorithm in Machine Learning

Logistic regression is a classification algorithm used to assign observations to a discrete set of classes. Unlike linear regression which outputs continuous number values, logistic regression transforms its output using the logistic sigmoid function to return a probability value which can then be mapped to two or more discrete classes

## Comparison between Linear and Logistic Regression

Given data on time spent studying and exam scores. Linear Regression and logistic regression can predict different things:

**Linear Regression** could help us predict the studentâ€™s test score on a scale of 0 - 100. Linear regression predictions are continuous (numbers in a range).
**Logistic Regression** could help use predict whether the student passed or failed. Logistic regression predictions are discrete (only specific values or categories are allowed). We can also view probability scores underlying the modelâ€™s classifications.

## Types of Logistic Regression

- Binary (Pass/Fail)
- Multi (Cats, Dogs, Sheep)
- Ordinal (Low, Medium, High)