image_output_1.png
from sklearn.linear_model import LogisticRegression

import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

data = pd.read_csv('../input/diabetes-dataset/diabetes.csv')
data

X = pd.DataFrame(data, columns=['Pregnancies', 'Glucose', 'BloodPressure', 'Skinthickness', 'Insulin', 'BMI', 'DiabetesPedigreeFunction', 'Age'])
y = data.Outcome
X

logreg = LogisticRegression(solver='liblinear')
logreg.fit(X_train, y_train)
y_pred = logreg.predict(X_test)

df2 = pd.DataFrame({'Pregnancies': [0], 'Glucose': [80], 'BloodPressure': [72], 'Skinthickness': [0], 'Insulin': [0], 'BMI': [23], 'DiabetesPedigreeFunction': [0.5], 'Age': [30], 'Outcome': [0]})

df2 = data.append(df2)
df2

X_test = df2[['Pregnancies', 'Glucose', 'BloodPressure', 'Skinthickness', 'Insulin', 'BMI', 'DiabetesPedigreeFunction', 'Age']][768:]

model2 = LogisticRegression(solver='liblinear', C=10.0, random_state=0)
model2.fit(X, y)

y_pred = model2.predict(X_test)
y_pred