text_html_output_1.png
from sklearn.metrics import confusion_matrix,precision_score,recall_score,f1_score,accuracy_score

from sklearn.svm import SVC

import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

data = pd.read_csv('/kaggle/input/adult-census-income/adult.csv')

def performance(y_test, pred, model_name):
    precision = precision_score(y_test, pred, pos_label='<=50K')
    recall = recall_score(y_test, pred, pos_label='<=50K')
    F1 = f1_score(y_test, pred, pos_label='<=50K')
    CM = confusion_matrix(y_test, pred)
    accuracy = accuracy_score(y_test, pred)

svm = SVC()
svm.fit(x_train, y_train)

pred_svm = svm.predict(x_test)

performance(y_test, pred_svm, 'svm')