Data Preparation

The Best Methods for One-Hot Encoding Your Data

OneHotEncoder vs get_dummies vs to_categorical

Mike Clayton
14 min readOct 29, 2022

--

Zeros and ones flying away from the viewing point with zeros and ones in the background
Image by Gerd Altmann from Pixabay

Pre-processing data before feeding it into a machine / deep learning model is one of the most important phases in the whole process. Without properly pre-processed data it won’t matter how advanced and slick your model is, it will ultimately be

--

--