Logistic Regression(Machine Learning)

Vatsal Sharma
2 min readJun 26, 2021
(IMG Credits-Google Images)

Logistic Regression is a Supervised Learning algorithm, used for classification. It is used to predict probability of Target Variable. It produces results in binary format. The outcome is discrete/categorical such as:

  • Yes/No.
  • 0/1.
  • True/False.
  • High/Low.

etc…

What it does?

It uses “Sigmoid Function” to give the outcomes. Just like the sigmoid curve, the outcomes can range from 0 to 1. Categorization is done on the basis of threshold value.

Let us suppose, the threshold value is 0.5 . Then, the values above it will be in ‘1’ category & values below it will be in ‘0’ category.

(IMG Credits- Wikipedia)

Applications

  • Heart Attack Prediction.
  • Credit Scoring
  • Email Spam Non-Spam

and many more…

Using Logistic Regression

Way 1- Directly importing from scikit learn library in Python.

Input- from sklearn.linear_model import LogisticRegression

This imports the Logistic Model.

Way 2- Implementing Logistic Model from Scratch.

This was all about Logistic Regression algorithm.

Happy Learning Folks!

You can also visit my previous blogs by clicking on their name below-

Follow me on LinkedIn- https://www.linkedin.com/in/imvat18/

--

--

Vatsal Sharma

Building Yarnit 🚀 | SDE-I @Yarnit | Ex- Data Science Intern @Aiotize | JIIT'22 | Aficionado 🏏 https://www.linkedin.com/in/imvat18/