Importing Libraries and Loading Data

Column Descriptions

  1. Pregnancies - Number of times pregnant
  2. Glucose - Plasma glucose concentration a 2 hours in an oral glucose tolerance test
  3. BloodPressure - Diastolic blood pressure (mm Hg)
  4. SkinThickess - Triceps skin fold thickness (mm)
  5. Insulin - 2-Hour serum insulin (mu U/ml)
  6. BMI - Body mass index (weight in kg/(height in m)^2)
  7. DiabetesPedigreeFunction - Diabetes pedigree function
  8. Age - Age (years)
  9. Outcome - Class variable (0 or 1) 268 of 768 are 1, the others are 0

Normalizing the data

Making the train test split

Training and Predicting using the model

Checking the accuracy