in _standardize_weights , keras does:
if y.shape[1] > 1: y_classes = y.argmax(axis=1)
so basically, if you decide to use single-string encoding, classes are the index of the column.
You may also ask yourself how you can map the column index to the source classes of your data. Well, if you use the LabelEncoder scikit class, which learns to perform single-string coding, the column index displays the unique labels order calculated by the .fit function. Doc says
Retrieve an ordered array of unique shortcuts
Example:
from sklearn.preprocessing import LabelBinarizer y=[4,1,2,8] l=LabelBinarizer() y_transformed=l.fit_transorm(y) y_transormed > array([[0, 0, 1, 0], [1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1]]) l.classes_ > array([1, 2, 4, 8])
As a conclusion, the keys of the class_weights dictionary should reflect the order in the classes_ attribute of the encoder.