Downloads · 30 days
0
pratham0011/diabetes-classifier
diabetes-classifier is a machine learning model from pratham0011. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A machine learning model for predicting diabetes risk based on health indicators. Trained on the CDC Diabetes Health Indicators dataset with XGBoost and SMOTE for handling class imbalance.
Downloads · 30 days
0
Access
Public
Updated May 8, 2026
Repo size
1.4 MB
Likes
0
Public
Click a slice to open those files.
.pkl1.4 MB · 99%
From the Hugging Face model README
A machine learning model for predicting diabetes risk based on health indicators. Trained on the CDC Diabetes Health Indicators dataset with XGBoost and SMOTE for handling class imbalance.
| Metric | Value |
|---|---|
| Accuracy | 85.51% |
| Precision (Diabetes) | 47.40% |
| Recall (Diabetes) | 30.08% |
| F1-Score (Diabetes) | 36.80% |
| ROC-AUC | 82.04% |
| MCC | 30.04% |
The model uses 21 health indicator features:
import pickle
import numpy as np
# Load model
with open("diabetes_classifier.pkl", "rb") as f:
model = pickle.load(f)
# Make prediction
# Features: [HighBP, HighChol, CholCheck, BMI, Smoker, Stroke, HeartDiseaseorAttack,
# PhysActivity, Fruits, Veggies, HvyAlcoholConsump, AnyHealthcare,
# NoDocbcCost, GenHlth, MentHlth, PhysHlth, DiffWalk, Sex, Age,
# Education, Income]
sample = np.array([[1, 1, 1, 28.5, 0, 0, 0, 1, 1, 1, 0, 1, 0, 2, 0, 0, 0, 0, 9, 5, 6]])
prediction = model.predict(sample)
probability = model.predict_proba(sample)
print(f"Prediction: {'Diabetes' if prediction[0] == 1 else 'No Diabetes'}")
print(f"Probability: {probability[0][1]:.4f}")
@dataset{cdc_diabetes_health_indicators,
title = {CDC Diabetes Health Indicators},
author = {naabiil},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/naabiil/CDC_Diabetes_Health_Indicators}
}
<!-- ml-intern-provenance -->
This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.