Description
`StringIndexer` takes a column of string labels (raw categories) and outputs an integer column with labels indexed by their frequency.
va li = new StringIndexer() .setInputCol("country") .setOutputCol("countryIndex")
In the output column, we should store the label to index map as an ML attribute. The index should be ordered by frequency, where the most frequent label gets index 0, to enhance sparsity.
We can discuss whether this should index multiple columns at the same time.
Attachments
Issue Links
- blocks
-
SPARK-6113 Stabilize DecisionTree and ensembles APIs
- Resolved
- is blocked by
-
SPARK-4588 Add API for feature attributes
- Resolved
- is related to
-
SPARK-4081 Categorical feature indexing
- Resolved
- relates to
-
SPARK-7582 User guide update for StringIndexer
- Resolved
- links to