<jupyter_start><jupyter_text>Diabetes Prediction<jupyter_code># import dependencies
import numpy as np
import pandas as pd
# First import the data set and rename the columns
column = ["Pregnancies","Glucose","BloodPressure","SkinThickness","Insulin","BMI","DiabetesPedigreeFunction","Age","Outcome"]
data = pd.read_csv('/content/pima-indians-diabetes.data.csv.txt',names=column)
# Lets see the first 5 rows
data.head()<jupyter_output><empty_output><jupyter_text>Now lets split the dataset in Training and Testing Sets<jupyter_code>X = data.iloc[:,0:-1] # X is the features in our dataset
y = data.iloc[:,-1]   # y is the Labels in our dataset
from sklearn.model_selection import train_test_split

x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.33, random_state=42)
print('Number of rows in the total set: {}'.format(data.shape[0]))
print('Number of rows in the training set: {}'.format(X_train.shape[0]))
print('Number of rows in the test set: {}'.format(X_test.shape[0]))<jupyter_output>Number of rows in the total set: 768
Number of rows in the training set: 514
Number of rows in the test set: 254<jupyter_text>Using Gaussian Naive Bayes to train our model<jupyter_code>from sklearn.naive_bayes import GaussianNB
naive_bayes = GaussianNB()
naive_bayes.fit(X_train, y_train)
predictions = naive_bayes.predict(x_test)<jupyter_output><empty_output><jupyter_text>Model Evaluation<jupyter_code>from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score
print('Accuracy score: ', format(accuracy_score(y_test, predictions)))
print('Precision score: ', format(precision_score(y_test, predictions)))
print('Recall score: ', format(recall_score(y_test, predictions)))
print('F1 score: ', format(f1_score(y_test, predictions)))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11902113459399333, 'fraction_numerical': 0.013348164627363738, 'mean_word_length': 8.040201005025125, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '500469', 'license': 'MIT', 'n_tokens_mistral': 632, 'n_tokens_neox': 594, 'n_words': 156, 'path': 'PyDiabetesPredict.ipynb', 'repo_name': 'smaranjitghose/PyDiabetesPredict', 'size': '1798'}