Posts

Showing posts from 2021

Binary classification with Tensorflow 2

Image
This post uses Tensorflow with Keras API for a classification problem of predicting diabetes based on a feed-forward neural network also known as multilayer perceptron and uses Pima Indians Diabetes Database from Kaggle . A Google colab notebook with code is available on GitHub . Exploratory data analysis The dataset consists of 8 numeric features each of which does not have any missing values. The database contains 768 records from which 500 correspond to negative outcomes and 268 to positive. There are no features that strongly correlate to each other. Building a model We split the dataset into the training part which constitutes 80% of the whole data and the test part of 20%. A sequential model consisting of 6 layers. The first one is a normalization layer that is a kind of experimental preprocessing layer used to coerce it inputs to have distributions with the mean of zero and standard deviation of one. The model contains two three fully-connected layers, two wit