Target Encoding setup issue for a categorial column in Python
Im trying to do target encoding for one column that has multiple category levels. I first split the data into train and test to avoid leakage and then tried to do the encoding as shown below: