Skip to content

Commit 2dd2c19

Browse files
committed
Last updates based on github review.
1 parent 9dd1b6b commit 2dd2c19

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/mllib-decision-tree.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ bins if the condition is not satisfied.
8686
**Categorical features**
8787

8888
For a categorical feature with `$M$` possible values (categories), one could come up with
89-
`$2^{M-1}-1$` split candidates. For binary classification and regression,
89+
`$2^{M-1}-1$` split candidates. For binary (0/1) classification and regression,
9090
we can reduce the number of split candidates to `$M-1$` by ordering the
91-
categorical feature values by the proportion of labels falling in one of the two classes (see
92-
Section 9.2.4 in
91+
categorical feature values by the average label. (See Section 9.2.4 in
9392
[Elements of Statistical Machine Learning](http://statweb.stanford.edu/~tibs/ElemStatLearn/) for
94-
details). For example, for a binary classification problem with one categorical feature with three
93+
details.) For example, for a binary classification problem with one categorical feature with three
9594
categories A, B and C whose corresponding proportions of label 1 are 0.2, 0.6 and 0.4, the categorical
9695
features are ordered as A, C, B. The two split candidates are A \| C, B
9796
and A , C \| B where \| denotes the split.
@@ -115,7 +114,7 @@ The recursive tree construction is stopped at a node when one of the two conditi
115114

116115
For faster processing, the decision tree algorithm performs simultaneous histogram computations for
117116
all nodes at each level of the tree. This could lead to high memory requirements at deeper levels
118-
of the tree, leading to memory overflow errors. To alleviate this problem, a `maxMemoryInMB`
117+
of the tree, potentially leading to memory overflow errors. To alleviate this problem, a `maxMemoryInMB`
119118
training parameter specifies the maximum amount of memory at the workers (twice as much at the
120119
master) to be allocated to the histogram computation. The default value is conservatively chosen to
121120
be 128 MB to allow the decision algorithm to work in most scenarios. Once the memory requirements
@@ -148,7 +147,7 @@ The implemented algorithm reads both sparse and dense data. However, it is not o
148147
The example below demonstrates how to load a
149148
[LIBSVM data file](http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/),
150149
parse it as an RDD of `LabeledPoint` and then
151-
perform classification using a decision tree using Gini impurity as an impurity measure and a
150+
perform classification using a decision tree with Gini impurity as an impurity measure and a
152151
maximum tree depth of 5. The training error is calculated to measure the algorithm accuracy.
153152

154153
<div class="codetabs">
@@ -274,7 +273,7 @@ to an underlying `DecisionTree` model in Scala.
274273
The example below demonstrates how to load a
275274
[LIBSVM data file](http://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/),
276275
parse it as an RDD of `LabeledPoint` and then
277-
perform regression using a decision tree using variance as an impurity measure and a maximum tree
276+
perform regression using a decision tree with variance as an impurity measure and a maximum tree
278277
depth of 5. The Mean Squared Error (MSE) is computed at the end to evaluate
279278
[goodness of fit](http://en.wikipedia.org/wiki/Goodness_of_fit).
280279

0 commit comments

Comments
 (0)