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

import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.neighbors import KNeighborsClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.metrics import f1_score
from sklearn.metrics import roc_auc_score
pd.options.display.max_rows = None
pd.options.display.max_columns = None
SEED = 581

data = pd.read_csv('/kaggle/input/mushroom-classification/mushrooms.csv')

data.isna().any()

mapping = {'e': 1, 'p': 0}
data.rename({'class': 'edible'}, axis=1, inplace=True)
data['edible'] = data['edible'].replace(mapping)
data = data.astype('category')
data.dtypes