text_html_output_3.png
import numpy as np

import pandas as pd

from fastai.tabular.all import *
pd.options.display.float_format = '{:.2f}'.format
set_seed(42)

data = pd.read_csv('../input/medias-cost-prediction-in-foodmart/media prediction and its cost.csv')

Name = sorted(data['class'].unique().tolist())
N = list(range(len(Name)))
normal_mapping = dict(zip(Name, N))
reverse_mapping = dict(zip(N, Name))

data = data.drop('cost', axis=1)

m = len(data)
M = list(range(m))
random.seed(2021)
random.shuffle(M)

train = data.iloc[M[0:m // 4 * 3]]
test = data.iloc[M[m // 4 * 3:]]
testY = test['class'].map(normal_mapping)

targs = targs.numpy()
preds = np.argmax(preds.numpy(), axis=-1)

tpreds2 = np.argmax(tpreds, axis=-1)

print(testY)
print(tpreds2)