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:
There are no NA values for X_train[“Municipality”] and y_train. The type for X_train[“Municipality” is categorial and y_train is float
But I get this error and I’m not sure what the issue is.
When I tried to do target encoding, I thought it would work since there are no na values in the column but for some reason there is an error related to the column.
Siddhesh Sreedar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.