CoolFace
Modelpublic

DeepNeural/diabetes_health_indicators_classifier_v1

sourceHugging Facemitupdated 2y agoView on Hugging Face
1likes
Model Card

Model Card for Model ID

<!-- Provide a quick summary of what the model is/does. --> The following model is designed to predict, given a certain number of inputs, whether a person has and/or is it at risk of acquiring diabetes.

This modelcard aims to be a base template for new models. It has been generated using this raw template.

Model Description

<!-- Provide a longer summary of what this model is. --> The following model is designed to predict, given a certain number of inputs, whether a person has and/or is it at risk of acquiring diabetes. The model has a total of 21 input features, and is designed to work within form-based applications, i.e. software applications which require user input.

NOTE: The following model is meant as an assistive tool, and must NOT directly be used to produce the final verdict on a person or patient's condition. As it is meant to promote further evaluations upon having completed its prediction.

  • Developed by: DeepNeural
  • Model type: Tabular Classifier
  • Language(s): English
  • License: MIT

Model Inputs

Variable NameTypeDescriptionQuestion Input Type
HighBPBinaryDoes the patient have high blood pressure?0 = no, 1 = yes
HighCholBinaryDoes the patient have high cholesterol?0 = no, 1 = yes
CholCheckBinaryHas the patient had a cholesterol check in 5 years?0 = no, 1 = yes
BMIIntegerBody Mass IndexNumeric value
SmokerBinaryDoes the patient smoke? (at least 5 packs)?0 = no, 1 = yes
StrokeBinaryHas the patient suffered from a stroke?0 = no, 1 = yes
HeartDiseaseAttackBinaryCoronary heart disease or myocardial infarction?0 = no, 1 = yes
PhysActivityBinaryPhysical activity in the past 30 days?0 = no, 1 = yes
FruitsBinaryDoes the patient consume one or more fruits per day?0 = no, 1 = yes
VeggiesBinaryDoes the patient consume vegetables one or more times per day?0 = no, 1 = yes
HvyAlcoholConsumpBinaryHeavy drinker (14 drinks per week for men, 7 for women)?0 = no, 1 = yes
AnyHealthcareBinaryDoes the patient have healthcare coverage?0 = no, 1 = yes
NoDocbcCostBinaryDifficulty reaching a doctor due to cost in the past 12 months?0 = no, 1 = yes
GenHlthIntegerHow good is the patient's general health?1 = excellent, 2 = very good, 3 = good, 4 = fair, 5 = poor
MenHlthIntegerDays in the past 30 when mental health was not good?Scale 1-30
PhysHlthIntegerDays in the past 30 when physical health was poor?Scale 1-30
DiffWalkBinaryDoes the patient have difficulty walking?0 = no, 1 = yes
SexBinaryWhat is the patient's sex?0 = female, 1 = male
AgeIntegerWhat is the patient's age?1 = 18-24, 9 = 60-64, 13 = 80 or older
EducationIntegerMaximum education reached1 = never attended school <br> 2 = grades 1-8 <br> 3 = grades 9-11 <br> 4 = grade 12 or GED <br> 5 = college (1-3 years) <br> 6 = college (4+ years)
IncomeIntegerIncome level1 = less than $10,000 <br> 5 = less than $35,000 <br> 8 = $75,000 or more

Model Sources

<!-- Provide the basic links for the model. -->

  • Repository: https://www.kaggle.com/datasets/alexteboul/diabetes-health-indicators-dataset

Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. --> This model is primarily designed for Data Scientists, Software Engineers and Machine Learning Engineers who have an interest in developing diabetic-based software applications, for various healthcare institutions, ranging from hospitals to clinics. Furthermore, this model is also designed for educational purposes within acadamia, whereby diabetic risk-analysis is a priority of the study.

Foreseeable users of the software applications to be developed with this model include: doctors, nurses (with respect to their patients)

Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. --> Please be adviced that our model had to be adjusted to place a greater emphasis on the minority class - a positive result - which ensured a robust model was built. However, in correcting the aforementioned issue of an imbalanced dataset, our model now works well with real life data, whereby the minority class requires a greater level of importance (see the results for metrics). However, the model may still suffer from misclassifications at certain points, and therefore, users are adviced to remember that this model is meant as an assistive tool, aiding in faster diagnostics.

Recommendations

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More research needed for further recommendations. Furthermore, the following model will continously undergo improvements and testing for better results capable of fixing the limitations mentioned in the previous section.

How to Get Started with the Model

To properly make use of this model, please refer to the illustration below, which showcases how this model can be loaded directly into an application. Please note, that, because it was built with the Scikit-Learn Machine Learning library, the model has been saved as a .joblib file. With that in mind, please proceed by copying the following code into your coding environment (Python).

  1. 1.Install Joblib
python
      !pip install joblib
  1. 1.Load the model Upon Installation
python
      my_model = joblib.load('diabetes_health_indicators_classifier_v1.joblib')
  1. 1.Make predictions (Binary or Probability)
python
      my_model.predict(X_test)

      # For probability-based outputs

      my_model.predict_proba(X_test)

NOTE: This model requires input data in a 2-Dimensional format (Pandas Series) with the column names, considering the model is to be used in form-based applications.

Metrics

<!-- These are the evaluation metrics being used, ideally with a description of why. --> We tested our dataset on various Machine Learning models, namely: logistic regression, Stochastic Gradient Descent, and Support Vector Machines. In all of these cases, we tested our models on the new (unforseen) test data. In doing this, we discovered that all three models performed well, with promising accuracy, recall, and AUC scores; these being the most trustworthy scores, as our dataset was originally imbalanced; we thus performed multiple types of imbalance adjustments, to place a greater emphasis on the minority class, which is, the more important class. Upon having adjusted the dataset, we retrained all of our models once more to draw a conclusion. The best performing model, after performing hyperparameter tuning, was the SGDClassifier model. The primary metrics used were: accuracy, recall, AUC, precision and f1-score. Please refer to the results section to see the results.

Results (Best and final scores after fixing imbalanced issues)

Accuracy - 73% Precision - 31% Recall - 78% AUC - 75% F1-Score - 44%

Environmental Impact

<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->

  • Hardware Type: T4 (for training)
  • Hours used: < 20hr
  • Cloud Provider: Google Cloud
  • Compute Region: Europe
  • Carbon Emitted: 1.02