2. What is Logistic Regression?
Logistic Regression is a type of classification model based on supervised learning.
In supervised learning, we train the model using data which is well labelled that
means the data is already tagged with correct answers. Here, the feature values
will be independent variables and the target value will be dependent variable.
3. What is Logistic Regression? continues...
Logistic Regression is a statistical method for analyzing a dataset in which there
are one or more independent variables that determine an outcome. The outcome
is measured using Maximum Likelihood of occurring of an event.
4. Problems that can be solved using Logistic Regression
● How likely a Netflix user will pay for a particular series?
● How likely India will win the Cricket World Cup?
● How likely a test score of a student will help him to get admitted to a
university?
● How likely a politician’s tweet is positive or negative?
5. Types of Logistic Regression
● Binary Logistic Regression: It is used when there are only 2 outcome
category.
● Multinomial Logistic Regression: It is used when there are more than 2
outcome category.
6. When should we use Logistic Regression?
● When there is no linear relationship between dependent variable and
independent variable.
● Logistic Regression is more robust to outliers than the Linear Regression.
(hint: Log function vs squared function)
7. Hyperparameter in Logistic Regression
Learning Rate: The rate at which the weights of the model is updated. (too small
value: optimization rate will be very small, too large value: model won’t converge
to best value)
Early stopping (max_iter): It is used so that the model does not overfit with the
training data. So, we stop the training as soon as we get the best TEST score.
To optimize the hyperparameters, we use a method called Grid Search to
find the best combination of hyperparameters value for the model.
8. How Logistic Regression works?
During training, the model involves mostly in following things:
Input: feature values
Output: predicted values
Sigmoid: apply sigmoid function on Output
Error: find error using Log-loss formula
Update: update weight and bias of the classification line
9. How Logistic Regression works?
During training, the model involves mostly in following things:
Input: feature values
Output: predicted values
Sigmoid: apply sigmoid function on Output
Error: find error using Log-loss formula
Update: update weight and bias of the classification line
10. How Logistic Regression works?
During training, the model involves mostly in following things:
Input: feature values
Output: predicted values
Sigmoid: apply sigmoid function on Output
Error: find error using Log-loss formula
Update: update weight and bias of the classification line
11. How Logistic Regression works?
During training, the model involves mostly in following things:
Input: feature values
Output: predicted values
Sigmoid: apply sigmoid function on Output
Error: find error using Log-loss formula
Update: update weight and bias of the classification line
12. How Logistic Regression works?
During training, the model involves mostly in following things:
Input: feature values
Output: predicted values
Sigmoid: apply sigmoid function on Output
Error: find error using Log-loss formula
Update: update weight and bias of the classification line
13. How Logistic Regression works?
During training, the model involves mostly in following things:
Input: feature values
Output: predicted values
Sigmoid: apply sigmoid function on Output
Error: find error using Log-loss formula
Update: update weight and bias of the classification line
14. How Logistic Regression works?
During training, the model involves mostly in following things:
Input: feature values
Output: predicted values
Sigmoid: apply sigmoid function on Output
Error: find error using Log-loss formula
Update: update weight and bias of the classification line
15. How Logistic Regression works?
During training, the model involves mostly in following things:
Input: feature values
Output: predicted values
Sigmoid: apply sigmoid function on Output
Error: find error using Log-loss formula
Update: update weight and bias of the classification line
17. Advantages
➢ It is widely used technique because it is very efficient, doesn’t require too
many computational resources, it’s highly interpretable, it doesn’t require input
features to be scaled,it doesn’t require any tuning, it’s easy to regularize and it
outputs well-calibrated predicted probabilities.
➢ It is incredibly easy and quick to implement and very efficient to train.
Because of these facts, Logistic Regression is a good baseline that we can
use to measure the performance of other more complex algorithms.
➢ It works better when we remove the attributes that are unrelated to the output
variable as well as the attributes that are very similar(correlated) to each
other.
18. Disadvantages
➢ Logistic Regression is not one of the most powerful algorithms and can be
easily outperformed by the more complex ones.
➢ Another disadvantage is its high reliance on a proper presentation of our data.
And this means that it is not a useful tool unless we have already identified all
the important independent variables.
➢ Since its outcome is discrete,Logistic Regression can only predict a
Categorical Outcome.