Github user mengxr commented on the pull request:
https://github.com/apache/spark/pull/7987#issuecomment-133085190
@dputler Under distributed setting, we need to make at least one pass to
collect all categories. The ordering is not alphabetical but by frequency
(https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/feature/StringIndexer.scala#L86).
The most frequent category gets index `0`, and one-hot encoder by default
drops the last category, i.e., the least frequent one.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]