One-hot encoding
One-hot encoding is a process where categorical data is converted into an alternate form that is much easier to use for machine learning algorithms, which in turn results in better predictions.
To illustrate how it works, let's say we have the following dataframe:
df = op.create.dataframe({"A":["Optimus","Bumblebee","Eject", "Megatron"], "B":["Transformer","Transformer","Transformer","Decepticon"]}) A B (object) (object) ---------- ----------- Optimus Transformer Bumblebee Transformer Eject Transformer Megatron Decepticon
Most machine learning algorithms can only work with numbers, so, with one-hot encoding, we will create a column containing the...