Reading

1- Definition 
LR is a machine learning algorithm; which is used for classification problems. The logistic regression is a model for binary classification of machine learning which assigned  observation to a discrete  set of classes
2- Explanation 
In the logistic regression process, the classifier gives outputs or classes based on probability when it passes the inputs through a prediction function (sigmoid function )
and returns a probability score between 0 and 1[1]. The parameter of logistic regression is estimated through maximum likelihood Estimation. 


LR is best when your data is binary or you need probabilistic results or when you need a binary linear decision boundary or when you need to understand the impact of input features. The LR used logistic activation or sigmoid function instead of a linear function to limit the result between 0 or 1.

3- Example

For example, Using logistic regression; we want to predict two classes that cat (0) or dog (1). First, we pass input to the Logistic function.  The logistic function returns a result between 0 and 1. Second;  Base on return value; we decide that wither the input is cat or dog. We basically used thresh hold (0.5) value, if the result is above 0.5, It means it belongs to class 1 (dog) and if its value is below the o.5  and it means it belongs to class 0 ( cat). For example if the logistic function returns 0.7 it means that it belongs to class 1(dog) [1].

3. Maximum Likelihood Estimation [4]

4 Transfer function 

Activation functions are a kind of transfer function that selects the data propagated in the neural network. The underlying interpretation is to allow a neuron in the network to propagate learning data (if it is in a learning phase) only if it is sufficiently exciting.

4. 1- Sigmoid function

In order to map the result into probability, we used a sigmoid function [1]. In another word, it maps int result between o and 1.

 

5- Forward Propagation

6. Backpropagation 

6.1 Chain Rule 

The chain rule is a formula for computing the derivative of the composition of two or more functions [10]


7- Cost Function  

8- Computation Graph   

Computation graph shows the forward propagation and backpropagation in an organized way                

  References 

[1] Introduction of logistic regression
https://towardsdatascience.com/introduction-to-logistic-regression-66248243c148
[2] Slope of Lines (Definition, Analysis)


[3] Machine Learning From Scratch
https://mlfromscratch.com/
[4] A gentle introduction fo LR with maximum likelihood estimation
 https://machinelearningmastery.com/logistic-regression-with-maximum-likelihood-estimation/
[5] Logarithms - What is e?

[6] Sigmoid

[7]

[8] Activation Functions Explained - GELU, SELU, ELU, ReLU and more
https://mlfromscratch.com/activation-functions-explained/#/
tanh activation function vs sigmoid activation function
https://stats.stackexchange.com/questions/101560/tanh-activation-function-vs-sigmoid-activation-function/101563#101563
[9] Efficient backpropagation 
http://yann.lecun.com/exdb/publis/pdf/lecun-98b.pdf
[10] MIT Crosslink
http://crosslinks.mit.edu/
[11] Deep Learning specialization 
https://www.coursera.org/specializations/deep-learning


Last modified: Wednesday, 6 May 2020, 4:51 PM