Github user manishamde commented on a diff in the pull request:
https://github.com/apache/spark/pull/2063#discussion_r16505453
--- Diff: docs/mllib-decision-tree.md ---
@@ -77,33 +85,46 @@ bins if the condition is not satisfied.
**Categorical features**
-For `$M$` categorical feature values, one could come up with `$2^(M-1)-1$`
split candidates. For
-binary classification, we can reduce the number of split candidates to
`$M-1$` by ordering the
+For a categorical feature with `$M$` possible values (categories), one
could come up with
+`$2^{M-1}-1$` split candidates. For binary classification and regression,
+we can reduce the number of split candidates to `$M-1$` by ordering the
categorical feature values by the proportion of labels falling in one of
the two classes (see
Section 9.2.4 in
[Elements of Statistical Machine
Learning](http://statweb.stanford.edu/~tibs/ElemStatLearn/) for
details). For example, for a binary classification problem with one
categorical feature with three
-categories A, B and C with corresponding proportion of label 1 as 0.2, 0.6
and 0.4, the categorical
-features are ordered as A followed by C followed B or A, C, B. The two
split candidates are A \| C, B
+categories A, B and C whose corresponding proportions of label 1 are 0.2,
0.6 and 0.4, the categorical
+features are ordered as A, C, B. The two split candidates are A \| C, B
and A , C \| B where \| denotes the split. A similar heuristic is used for
multiclass classification
-when `$2^(M-1)-1$` is greater than the number of bins -- the impurity for
each categorical feature value
-is used for ordering.
+when `$2^{M-1}-1$` is greater than the `maxBins` parameter: the impurity
for each categorical feature value
--- End diff --
My fault but this sentence looks awkward. Feel free to rephrase it. :-)
---
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]