Always use the Encoder before training a model if your data contains text-based categories. The encoded values must remain consistent between training and prediction.
Encoder converts categorical (text-based) data into numerical values that machine learning algorithms can process. It transforms labels like “Residential”, “Commercial”, “Industrial” into numbers like ” 0, 1, 2 ” .
This is an essential preprocessing step because most ML models only work with numerical inputs.