text_html_output_1.png
from sklearn.preprocessing import LabelEncoder

from sklearn.preprocessing import OneHotEncoder

from sklearn.utils import shuffle

import pandas as pd

test = pd.read_csv('../input/tabular-playground-series-feb-2022/test.csv')
train = pd.read_csv('../input/tabular-playground-series-feb-2022/train.csv')

from sklearn.utils import shuffle
train = shuffle(train)

features = [c for c in train.columns if c not in ('target', 'row_id')]
target = 'target'
x_test = test[features]
y = train[target]
X = train[features]
numerical_features = X.columns

from sklearn.preprocessing import LabelEncoder
le = LabelEncoder()
y = le.fit_transform(y)

from sklearn.preprocessing import OneHotEncoder
oe = OneHotEncoder()

target = oe.fit_transform(y.reshape(-1, 1))
target = target.toarray()
targetyDF = pd.DataFrame(target)
yDF = targetyDF

X_train = X[:87500]
y_train = yDF[:87500]
X_valid = X[87500:]
y_valid = yDF[87500:]

X_train.shape[0] + X_valid.shape[0] == X.shape[0]