ai-maths-consulting

AI & Algorithms: Logistic Regression

This blog post on the logistic regression algorithm is part of the blog post series Understanding AI Algorithms. Logistic regression is a regression algorithm as the name suggests, and can predict a numeric value in any range.

Logistic regression is similar to simple linear regression, but it is used to predict the outcome when there are only two options. For example, data about a customer are used to predict if he or she is going to buy your product or not. The likelihood of either option is calculated, and the customer is classified into the category with the highest probability, as either likely to buy, or not likely to buy.  

The relationship between the variables is not presented by how much one will change if the other does, like in linear regression. Instead, the relationship is measured by the chance of belonging to the group who is likely to buy, as presented by an odds ratio.

 Let’s look at another example. Say you are studying how customers respond to a campaign related to their personal characteristics. This model allows you to interpret if a customer with a certain characteristics increases or decreases the chance of getting a good response.

For example, it can determine if targeting customers that are younger increases the chance of getting a purchase.

The final model could predict if a customer is more likely to generate a purchase based on their age. This can also be interpreted as how much a certain customer’s age will increase or decrease the chance of making a purchase from a campaign.

 Just like other models in the linear regression family, logistic models are easy to interpret. However, they require users to be familiar with odds and probability.

In our example of a marketing campaign, the model can tell you if there is a probability that specific characteristics in a customer is likely to lead to a sale or subscription. This type of model is also easy to update with new data and to make predictions of future observations (if there is a risk that a customer will no longer use your company’s service, for example).

However, just like the other regression types, the simplicity of logistic regression can cause problems when dealing with complex problems.

If you want to read all the related articles on the topic of AI algorithms, here is the list of all blog posts in this article series: