I load data using
X_train, X_test, y_train, y_test = load_data() # y_train here has a string class name inside
then I use encoder from sklea