One Hot Encoding vs pd.get_dummies
In fact, they produce the same result while transforming the categorical variable into dummies. The difference is that one_hot_encoder stores the transformation in an object. Once you have the instance of OneHotEncoder(), you can save it to use it later in a preprocessing step for your prediction pipeline.
If you are just making some experiments, you can use any of them. But if you want your preprocessing process to be better organized, you better use OneHotEncoder.
If you plan to use it for categorical features treatment, you can also use LabelEncoder.
What is the difference between one_hot_encoder and pd.get_dummies? Because sometimes, the get_dummies function gives the same results as the one hot encoding thing, but people tend to use the one hot encoding df to fit in their model. So what is the difference? And will it affect my model?
thanks