Machine Learning, Data Science Projects, Data Science, Machine Learning Projects, Data Analysis.
One-Hot Encoding using get_dummies() train = pd.get_dummies(train, columns=nominal_cat_columns) test = pd.get_dummies(test, columns=nominal_cat_columns) from sklearn.preprocessing import OrdinalEncoder # Initialize the OrdinalEncoder ordinal_encoder = OrdinalEncoder() # Define the ordinal columns