Embedding Layers Keras RStudio

Hello

When I am trying to get predicted labels by doing inverse transformation using inverse.transform() function in "CatEncoders" package it returns NA as one of the label, below is the screenshot.

For encoding labels I have used below code

library(CatEncoders)
ec=LabelEncoder.fit(y_train)
y_lab_train=transform(ec,y_train)
y_lab_test=transform(ec,y_test)

Let me know if I am going wrong anywhere.

Hello

Instead of using the package "CatEncoders" to encode labels, I have defined below function

#Label Encoder
enc<-function(x){
  as.numeric(factor(x))-1
}

Then matching the class labels using below table.


Now I am getting desired result.

Thanks

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.