The easiest way is to just map them yourself with some Python code after
LabelEncoder - this type of mapping is generally application specific.
Something like:
a[a == 0] = 100
a[a == 1] = 150
a[a == 2] = 155
will do the trick. For many labels, you could loop through a dictionary you
make and set
Is there any way to specify the label encoding in
preprocessing.LabelEncoder() ?
My targets are in string and I want to convert them into numeric values.
preprocessing.LabelEncoder() encodes always as 0,1,2 while I would like
specify the numeric code.
target_str = ['setosa', 'versicolor', 'virgi