A pitfall of StringIndexer + OneHotEncoder in production is:
Select an answer to reveal the explanation.
Short Explanation and Infographic
New categories in prod will bite you — plan handleInvalid and retraining.
Full explanation below image
Full Explanation
Category vocabulary must be managed; unseen labels need configured handling.