0

The code below converts the categorical column into a NumPy array. On Y I am using train test split.

Y = pd.get_dummies(df_c['CATEGORY']).values

The output for y_test would be like this

array([[1, 0, 0, ..., 0, 0, 0],
   [1, 0, 0, ..., 0, 0, 0],
   [1, 0, 0, ..., 0, 0, 0],
   ...,
   [0, 0, 0, ..., 0, 0, 1],
   [0, 0, 0, ..., 0, 0, 1],
   [0, 0, 0, ..., 0, 0, 1]], dtype=uint8)

How can retrieve back original values of y_test?

Kath
  • 13
  • 2

0 Answers0