text_plain_output_1.png
from sklearn.linear_model import LogisticRegression,LinearRegression

from sklearn.metrics import confusion_matrix, classification_report,accuracy_score

import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

df = pd.read_csv('../input/facebook-ads/Facebook_Ads_2.csv', encoding='ISO-8859-1')

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

y_pred_train = lr.predict(X_train)
y_pred_train

cm = confusion_matrix(y_train, y_pred_train)

y_pred_test = lr.predict(X_test)

cm = confusion_matrix(y_test, y_pred_test)

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

cm = confusion_matrix(y_train, y_pred_train)
sns.heatmap(cm, annot=True, fmt='d')