text_plain_output_1.png image_output_1.png
from sklearn.linear_model import LogisticRegression,LinearRegression

lr = LogisticRegression(random_state=0)
lr.fit(X_train, y_train)

y_pred_train = lr.predict(X_train)
y_pred_train

linR = LinearRegression().fit(X_train, y_train)
y_pred_train = linR.predict(X_train)

for i in range(0, len(y_pred_train)):
    if y_pred_train[i] > 0.51:
        y_pred_train[i] = 1
    else:
        y_pred_train[i] = 0
print(y_pred_train)