Coder Social home page Coder Social logo

amir-rs / diabetes-detection-neural-network Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.17 MB

This project aims to predict the occurrence of diabetes using machine learning techniques. The dataset used for this analysis is the "diabetes_prediction_dataset.csv" file, which contains various features related to an individual's health condition.

Jupyter Notebook 100.00%
adaboost-classifier area-under-curve decision-tree-classifier gradient-boosting-classifier logistic-regression machine-learning neural-networks random-forest-classifier receiver-operating-characteristic

diabetes-detection-neural-network's Introduction

Diabetes Prediction

This project aims to predict the occurrence of diabetes using machine learning techniques. The dataset used for this analysis is the "diabetes_prediction_dataset.csv" file, which contains various features related to an individual's health condition.

Data Preprocessing

  1. The dataset is loaded into a Pandas DataFrame.
  2. A random sample of 1000 instances is selected from the initial dataset.
  3. Categorical features like 'gender' and 'smoking_history' are label-encoded.
  4. The target variable 'diabetes' is separated from the feature variables.
  5. The Synthetic Minority Over-sampling Technique (SMOTE) is applied to balance the target variable classes.
  6. A correlation heatmap is generated to visualize the relationships between features.
  7. The age feature is binned into groups for better visualization.
  8. Feature scaling is performed using StandardScaler.

Model Building and Evaluation

  1. A grid search is performed to find the optimal hyperparameters for Random Forest and AdaBoost classifiers.
  2. The feature importances of the Random Forest model are visualized.
  3. The dataset is split into training and testing sets.
  4. Several machine learning models are trained and evaluated on the test set:
  • Random Forest Classifier
  • Logistic Regression
  • AdaBoost Classifier
  • Decision Tree Classifier
  • Gradient Boosting Classifier
  1. Performance metrics like accuracy, precision, recall, and F1-score are calculated for each model.
  2. The Receiver Operating Characteristic (ROC) curve and Area Under the Curve (AUC) are plotted for the Gradient Boosting Classifier.
  3. A simple neural network is trained and evaluated on the dataset.

Model Deployment

  1. A new data point is defined for prediction.
  2. The new data is scaled using the same scaler as the training data.
  3. The trained Gradient Boosting Classifier model predicts the probability of diabetes for the new data point.

Usage

To run this project, you'll need to have the following dependencies installed:

  • Python
  • NumPy
  • Pandas
  • Matplotlib
  • Seaborn
  • Scikit-learn
  • Imbalanced-learn
  • TensorFlow (for the neural network part)

You'll also need to have the 'diabetes_prediction_dataset.csv' file in the same directory as your Python script.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

diabetes-detection-neural-network's People

Contributors

amir-rs avatar

Stargazers

Amir M. Parvizi avatar

Watchers

 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.