<jupyter_start><jupyter_text>Diabetes Binary Classification DatasetHands-on: Classification with AWS Machine Learning ServiceInput Features:'preg_count', 'glucose_concentration', 'diastolic_bp',       'triceps_skin_fold_thickness', 'two_hr_serum_insulin', 'bmi',       'diabetes_pedi', 'age' Target Feature: 'diabetes_class'Objective: Predict diabetes_class for given input featuresData Source: https://archive.ics.uci.edu/ml/datasets/pima+indians+diabetes<jupyter_code>columns = ['diabetes_class', 'preg_count', 'glucose_concentration', 'diastolic_bp',
       'triceps_skin_fold_thickness', 'two_hr_serum_insulin', 'bmi',
       'diabetes_pedi', 'age']
df = pd.read_csv('pima_indians_diabetes_all.csv')
df['diabetes_class'].value_counts()
df.head()
df.corr()['diabetes_class']
# Separate diabetic and normal samples
diabetic = df.diabetes_class == 1
normal = df.diabetes_class == 0
# Diabetic glucose concentration histogram
plt.hist(df[diabetic].glucose_concentration)
plt.title('diabetic')
plt.xlabel('Glucose concentration')
plt.ylabel('Samples')
# Normal glucose concentration histogram
plt.hist(df[normal].glucose_concentration)
plt.title('normal')
plt.xlabel('Glucose concentration')
plt.ylabel('Samples')<jupyter_output><empty_output><jupyter_text>Training and Validation Set Target Variable as first column followed by input features:'diabetes_class', 'preg_count', 'glucose_concentration', 'diastolic_bp',       'triceps_skin_fold_thickness', 'two_hr_serum_insulin', 'bmi',       'diabetes_pedi', 'age' Training, Validation files do not have a column header<jupyter_code># Training = 70% of the data
# Validation = 30% of the data
# Randomize the datset
np.random.seed(5)
l = list(df.index)
np.random.shuffle(l)
df = df.iloc[l]
rows = df.shape[0]
train = int(.7 * rows)
test = int(.3 * rows)
rows, train, test
# Write Training Set
df[:train].to_csv('diabetes_train.csv'
                          ,index=False,index_label='Row',header=False
                          ,columns=columns)
# Write Validation Set
df[train:].to_csv('diabetes_validation.csv'
                          ,index=False,index_label='Row',header=False
                          ,columns=columns)
# Write Column List
with open('diabetes_train_column_list.txt','w') as f:
    f.write(','.join(columns))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12646167171935904, 'fraction_numerical': 0.0043308791684712, 'mean_word_length': 5.3812154696132595, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '80516', 'license': 'Apache-2.0', 'n_tokens_mistral': 824, 'n_tokens_neox': 732, 'n_words': 151, 'path': 'xgboost/DiabetesClassification/diabetes_data_preparation.ipynb', 'repo_name': 'srinivas02/AmazonSageMakerCourse', 'size': '2309'}