Sitemap
TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Replicate a Logistic Regression Model as an Artificial Neural Network in Keras

Neural Networks and Deep Learning Course: Part 11

7 min readMay 19, 2022

--

Press enter or click to view image in full size
Image by Gerd Altmann from Pixabay

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:

  1. Compare the performance of the same logistic regression model built using the two different libraries.
  2. Build a Keras sequential model.
  3. Be familiar with some import conventions in Keras classes.
  4. Use the summary(), compile(), fit() and evaluate() methods of a Keras sequential model instance.
  5. 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…

--

--

TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Rukshan Pramoditha

Written by Rukshan Pramoditha

3,000,000+ Views | BSc in Stats (University of Colombo, Sri Lanka) | Top 50 Data Science, AI/ML Technical Writer on Medium

No responses yet