fit transform label encoder train and test data code example
Example: label encoding
from sklearn.preprocessing import LabelEncoder
le = LabelEncoder()
companydata.ShelveLoc = le.fit_transform(companydata.ShelveLoc)
from sklearn.preprocessing import LabelEncoder
le = LabelEncoder()
companydata.ShelveLoc = le.fit_transform(companydata.ShelveLoc)