The Diabetes Prediction API is a machine learning-based API designed to predict whether a person is diabetic based on various health metrics. The model used is a Support Vector Machine (SVM) with an accuracy of 77.27%. The API is developed using FastAPI and deployed on Render.
- API Endpoint: https://dibetes-api.onrender.com/diabetes_prediction
The API expects a JSON object with the following fields:
Pregnancies
: Number of times pregnant (integer)Glucose
: Plasma glucose concentration (integer)BloodPressure
: Diastolic blood pressure (integer)SkinThickness
: Triceps skin fold thickness (integer)Insulin
: 2-Hour serum insulin (integer)BMI
: Body mass index (float)DiabetesPedigreeFunction
: Diabetes pedigree function (float)Age
: Age in years (integer)
The API will return a JSON object with the prediction:
"The Person is Diabetic"
if the person is predicted to be diabetic."The Person is not Diabetic"
if the person is predicted to be non-diabetic.
Input:
{
"Pregnancies": 10,
"Glucose": 168,
"BloodPressure": 74,
"SkinThickness": 0,
"Insulin": 0,
"BMI": 38,
"DiabetesPedigreeFuncion": 0.537,
"Age": 30
}
Result:
"The Person is Diabetic"
Input:
{
"Pregnancies": 1,
"Glucose": 85,
"BloodPressure": 66,
"SkinThickness": 29,
"Insulin": 0,
"BMI": 26.6,
"DiabetesPedigreeFuncion": 0.351,
"Age": 31
}
Result:
"The Person is not Diabetic"
You can test the API using tools like Postman. Here is how you can do it:
- Open Postman.
- Create a new POST request.
- Set the URL to https://dibetes-api.onrender.com/diabetes_prediction.
- In the Body tab, select
raw
andJSON
format. - Enter the JSON object as per the input format.
- Send the request and check the response.
This Diabetes Prediction API provides an easy and efficient way to predict diabetes using health metrics. With an accuracy of 77.27%, it can be a valuable tool in preliminary health assessments.