Logistic regression is a machine learning classification algorithm that predicts the probability of a target variable being either 1 (success/yes) or 0 (failure/no) based on input variables. It is commonly used for problems like spam detection, diabetes prediction, and cancer detection by predicting the probability of a binary outcome.