Coder Social home page Coder Social logo

guilhermedom / diabetes-neural-network-diagnosis Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.05 MB

Fully connected neural network diagnosing patients with diabetes.

License: MIT License

Jupyter Notebook 100.00%
correlation-matrix diabetes diabetes-detection feature-selection fully-connected-neural-network neural-network

diabetes-neural-network-diagnosis's Introduction

Neural Network Diagnosing Diabetes

Training a TensorFlow-based fully connected neural network to diagnose patients with diabetes.


Problem Overview

The diabetes dataset has been used by the machine learning community to train classifiers to detect diabetes. It has 768 instances with 9 features, one of them being the response variable that tells if a person has diabetes or not. The dataset is built with data referring to females, older than 21 and of Pima Indian heritage. Feature names are self-explanatory to some extent; the table below has a description for each feature:

Feature Description
Pregnancies Number of times pregnant
Glucose Plasma glucose concentration a 2 hours in an oral glucose tolerance test
BloodPressure Diastolic blood pressure (mm Hg)
SkinThickness Triceps skin fold thickness (mm)
Insulin 2-Hour serum insulin (mu U/ml)
BMI Body mass index (weight in kg/(height in m)^2)
DiabetesPedigreeFunction Likelihood of diabetes based on family history
Age Age in years
Outcome Class variable: 0 if diabetes is not present; 1 if diabetes is present

The objective is to create a classifier to predict if a person has diabetes or not, given their data in the above form.

Analysis Introduction

In this project, we show how to preprocess and select the most relevant variables to train a simple fully connected neural network. Explanatory variables are subject to being discarded due to high correlation with other explanatory variables (for carrying similar information), or due to low correlation with the response variable (for not making good contributions to the model). Correlations are evaluated with pair plots and a correlation matrix:

corr_matrix_diabetes_nn

With the 5 most meaningful explanatory variables selected from the 8 original, a neural network with two hidden layers is trained. Two hidden layers have been known in the literature for being capable of modeling most practical problems. Since our diabetes dataset already presents features in a numerical manner, it is not necessary to add more layers to perform feature extraction.

Results are promising given the amount of available data (just 768 instances), staying around 82% in accuracy. Our trained fully connected neural network achieves an F1-score of 0.87 considering class 0 only (not having diabetes). Only 268 instances are available for class 1 (having diabetes), and 30% of them are separated for validation and testing. Consequently, the model is not able to achieve optimal performance considering class 1 only, with F1-score staying at 0.71. Data augmentation would probably improve the performance of the model.

diabetes-neural-network-diagnosis's People

Contributors

guilhermedom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.