Skip to content

anushapv2000/phy-nn-gpu

Repository files navigation

Conda Environment for Neural Diabetes

About Conda Environments: [https://conda.io/docs/user-guide/tasks/manage-environments.html
Installing git: [https://git-scm.com/book/en/v2/Getting-Started-Installing-Git]

Quick Start :Setup the Environment

Note that for the code above to work,you need to be in the directory where the environment.yml file lives so 'cd' to that directory first

The environment name is neural-pkg as defined in the environment.yml file.
To begin, install the environment using:

conda env create -f environment.yml

Activate the environment

conda activate package

update the environment at any time using:

conda env update -f environment.yml

To view the environments installed

conda info --envs

About the Program:

This dataset is originally from the National Institute of Diabetes and Digestive and Kidney Diseases. The objective is to predict based on diagnostic measurements whether a patient has diabetes.

INPUT VARIABLES(X):
1.Pregnancies: Number of times pregnant
2.Glucose: Plasma glucose concentration a 2 hours in an oral glucose tolerance test
3.BloodPressure: Diastolic blood pressure (mm Hg)
4.SkinThickness: Triceps skin fold thickness (mm)
5.Insulin: 2-Hour serum insulin (mu U/ml)
6.BMI: Body mass index (weight in kg/(height in m)^2)
7.DiabetesPedigreeFunction: Diabetes pedigree function
8.Age: Age (years)

OUPTUT VARIABLE(y):
Outcome: Class variable (0 or 1)

Steps:

-Load Data
-Keras Model is used as a sequence of layers
-The model is fed with rows of data with 8 variables
-The first hidden layer has 12 nodes and relu activation function is used
-Second Hidden layer consist of 8 nodes and relu activation is used
-The output layer has one node and use sigmoid function.

Compiled and evaluated

Binary Cross-Entropy Loss:
The default loss function used for binary classification problems.Cross-entropy will calculate a score that summarizes the average difference between the actual and predicted probability distributions for predicting class 1. The score is minimized and a perfect cross-entropy value is 0

Optimizer:
The choice of optimixation algorithm for the deep learning model can mean the difference between good results .Adam optimizer can be used instead of the classical stochastic gradient descent procedure to update network weights iterative based in training data.

Accuracy is claculated using metrics argument.

Keras Model is used on the loaded data by using fit() function.Here data training over epochs and epochs is split into batches.After the training ,model is evaluated using evaluate() function which return the loss of the model and accuracy of the model.

Make Predictions

As Sigmoid activation functions are used output value will be in the range of 0 and 1,hence it is rounded off .Prediction is done by calling the predict() function on the model
Running the code shows a message for 150 epochs printing the loss and accuracy.
The result provide the actual and predicted values.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published