Starting with logistic regression
Before we delve into neural networks and deep learning models, let's take a look at logistic regression, which can be viewed as a single layer neural network. Even the sigmoid function commonly used in logistic regression is used as an activation function in neural networks.
Getting ready
Logistic regression is a supervised machine learning approach for the classification of dichotomous/ordinal (order discrete) categories.
How to do it...
Logistic regression serves as a building block for complex neural network models using sigmoid as an activation function. The logistic function (or sigmoid) can be represented as follows:
![](https://static.packt-cdn.com/products/9781787121089/graphics/B12043_Eq_02_01.png)
The preceding sigmoid function forms a continuous curve with a value bound between [0, 1], as illustrated in the following screenshot:
![](https://static.packt-cdn.com/products/9781787121089/graphics/B12043_02_01-2.png)
Sigmoid functional form
The formulation of a logistic regression model can be written as follows:
![](https://static.packt-cdn.com/products/9781787121089/graphics/B12043_Eq_02_02.png)
Here, W is the weight associated with features X= [x1, x2, ..., xm] and b is the model intercept, also known as...