1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Python & Machine Learning (with Analytics Vidhya Hackathons)

Exercise

Logistic Regression Introduction

Logistic Regression is a classification algorithm. It is used to predict a binary outcome (1 / 0, Yes / No, True / False) given a set of independent variables. To represent binary / categorical outcome, we use dummy variables. You can also think of logistic regression as a special case of linear regression when the outcome variable is categorical, where we are using log of odds as the dependent variable.

In simple words, it predicts the probability of occurrence of an event by fitting data to a logit function, read more about Logistic Regression .

LogisticRegression() function is part of linear_model module of sklearn and is used to create logistic regression

Reference: Mathematical working and implementation from scratch for Logistic regression.

Instructions

100 XP
  • Import Linear model of sklearn
  • Create object of sklearn.linear_model.LogisticRegression