Logistic Regression — Intro To Machine Learning #7

Jose Fumo
Simple AI
Published in
2 min readApr 2, 2017

--

Hi, logistic regression is another technique borrowed by machine learning from the field of statistics. It is the go-to method for classification problems. Despite the name “logistic regression” this is not a algorithm for regression problems (where the task is to predict a real-valued output).

Logistic Regression is a little bit similar to Linear Regression in the sense that both have the goal of estimating the values for the parameters/coefficients, so the at the end of the training of the machine learning model we got a function that best describe the relationship between the known input and the output values.

Unlike linear regression, the prediction for the output is transformed using a non-linear function called the logistic function (some variations this name are: sigmoid function and logit function). I’m not going to the details of the math behind logistic regression as it’s not mandatory to understand and be able to apply this algorithm, but it’s not that complicated and if you know and understand linear regression you will find it easy to get this one.

Because of the way that the model is learned, the predictions made by logistic regression can also be used as the probability of a given data instance belonging to class 0 or class 1. Logistic regression measures the relationship between the categorical dependent variable (target class: yes/no, spam/not spam, positive/negative,…) and one or more independent variables by estimating probabilities.

Like linear regression, logistic regression does work better when you remove attributes that are unrelated to the output variable as well as attributes that are very similar (correlated) to each other.

The reason Logistic Regression is widely used despite the fact of the state of the art algorithms such as deep neural networks it’s because logistic regression is very efficient and does not require too much computational resources which makes it affordable to run on production, Yes, your server won’t crash!

I have to tell you, I love Logistic Regression, learning logistic regression is great algorithm to have in your bag, and it will do well in many tasks, but clearly there are also many more tasks you’ll find better algorithms to do the job.

If you want to see logistic regression in action check these examples:

Next:

Have you ever heard about Naive Bayes, This is a classical Supervised Machine Learning Algorithm widely used for Text Classification, probably your email spam filter is using it. We are going to apply Naive Bayes for Twitter sentiment analysis, our goal will be to evaluate if a tweet is a positive or negative? sounds fun? Watch out, there’s more to come.

Let me know what you think about this, If you enjoyed the writings then please use the ❤ heart below to recommend this article so that others can see it.

--

--

Jose Fumo
Simple AI

Passionate about technology, financial markets and above all, Humanity. I share my journey to Self-Discovery and Personal Growth.