Может быть, это может помочь.
x= ['GA','TA','SA','TA','GA','TA','SA']
import numpy as np
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing.label import _encode
from sklearn.utils import column_or_1d
x = column_or_1d(x, warn=True)
classes_,encoded_values = _encode(x,uniques=np.array(['GA','TA','SA']),encode=True)
encoded_values, classes_
#(array([0, 1, 2, 1, 0, 1, 2]), ['GA', 'TA', 'SA'])
#comparing with labelencoder, which will sort the labels before encoding
le = LabelEncoder()
le.fit_transform(x),le.classes_
#
(array([0, 2, 1, 2, 0, 2, 1], dtype=int64),
array(['GA', 'SA', 'TA'], dtype='<U2'))