<jupyter_start><jupyter_text>Data Exploration<jupyter_code>df.shape
df.info()
df.describe()
df.isnull().sum()
sns.heatmap(df.corr());
sns.pairplot(df);
sns.countplot('Outcome', data=df);
df['Glucose'].plot(figsize=(12,8), color='black');
plt.xlabel("Index")
plt.ylabel("Glucose Level");<jupyter_output><empty_output><jupyter_text>Spliting training and testing data<jupyter_code>X=df.iloc[:,:-1]
X.head()
y=df['Outcome']
y
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test=train_test_split(X, y, test_size=0.3, random_state=110)<jupyter_output><empty_output><jupyter_text>Logistic Regression Model Creation<jupyter_code>from sklearn.linear_model import LogisticRegression
logic=LogisticRegression()
logic.fit(X_train, y_train)
y_pred=logic.predict(X_test)
from sklearn.metrics import accuracy_score
acc=accuracy_score(y_pred,y_test)
acc
from sklearn.metrics import confusion_matrix, classification_report
print(confusion_matrix(y_test, y_pred))
print(classification_report(y_test,y_pred))<jupyter_output>precision    recall  f1-score   support

           0       0.83      0.90      0.86       156
           1       0.75      0.63      0.68        75

    accuracy                           0.81       231
   macro avg       0.79      0.76      0.77       231
weighted avg       0.80      0.81      0.80       231
StarcoderdataJupyterStructuredCleanDedup