Machine Learning, Data Science Projects, Data Science, Machine Learning Projects, Data Analysis.
ordinal_cols = ['Item_Fat_Content', 'Outlet_Size', 'Outlet_Location_Type'] # Fit and transform the ordinal columns train[ordinal_cols] = ordinal_encoder.fit_transform(train[ordinal_cols]) test[ordinal_cols] = ordinal_encoder.fit_transform(test[ordinal_cols]) You can now print “train.head()” and