Skip to content

Commit cdfdfbc

Browse files
committed
added examples for GBT
1 parent 6372a2b commit cdfdfbc

File tree

4 files changed

+200
-229
lines changed

4 files changed

+200
-229
lines changed

docs/mllib-decision-tree.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ JavaRDD<LabeledPoint> testData = splits[1];
217217
// Set parameters.
218218
// Empty categoricalFeaturesInfo indicates all features are continuous.
219219
Integer numClasses = 2;
220-
HashMap<Integer, Integer> categoricalFeaturesInfo = new HashMap<Integer, Integer>();
220+
Map<Integer, Integer> categoricalFeaturesInfo = new HashMap<Integer, Integer>();
221221
String impurity = "gini";
222222
Integer maxDepth = 5;
223223
Integer maxBins = 32;
@@ -270,10 +270,6 @@ print('Test Error = ' + str(testErr))
270270
print('Learned classification tree model:')
271271
print(model.toDebugString())
272272
{% endhighlight %}
273-
274-
Note: When making predictions for a dataset, it is more efficient to do batch prediction rather
275-
than separately calling `predict` on each data point. This is because the Python code makes calls
276-
to an underlying `DecisionTree` model in Scala.
277273
</div>
278274

279275
</div>
@@ -350,7 +346,7 @@ JavaRDD<LabeledPoint> testData = splits[1];
350346

351347
// Set parameters.
352348
// Empty categoricalFeaturesInfo indicates all features are continuous.
353-
HashMap<Integer, Integer> categoricalFeaturesInfo = new HashMap<Integer, Integer>();
349+
Map<Integer, Integer> categoricalFeaturesInfo = new HashMap<Integer, Integer>();
354350
String impurity = "variance";
355351
Integer maxDepth = 5;
356352
Integer maxBins = 32;
@@ -409,10 +405,6 @@ print('Test Mean Squared Error = ' + str(testMSE))
409405
print('Learned regression tree model:')
410406
print(model.toDebugString())
411407
{% endhighlight %}
412-
413-
Note: When making predictions for a dataset, it is more efficient to do batch prediction rather
414-
than separately calling `predict` on each data point. This is because the Python code makes calls
415-
to an underlying `DecisionTree` model in Scala.
416408
</div>
417409

418410
</div>

0 commit comments

Comments
 (0)