Member-only story
Replicate a Logistic Regression Model as an Artificial Neural Network in Keras
Neural Networks and Deep Learning Course: Part 11
Logistic regression is a very simple neural network model with no hidden layers as I explained in Part 7 of my neural network and deep learning course.
Here, we will build the same logistic regression model with Scikit-learn and Keras packages. The Scikit-learn LogisticRegression()class is the best option for building a logistic regression model. However, we can build the same model in Keras with a neural network mindset because a logistic regression model can be technically considered an ANN.
The main objectives of writing this tutorial are:
- Compare the performance of the same logistic regression model built using the two different libraries.
- Build a Keras sequential model.
- Be familiar with some
importconventions in Keras classes. - Use the
summary(),compile(),fit()andevaluate()methods of a Keras sequential model instance. - Plot the loss and accuracy scores at each epoch in model training and evaluation.
At the end of this article, you will be able to build a logistic regression model with a neural network mindset and…