Skip to content

Commit 2263b5b

Browse files
committed
Added note about tree example issue.
1 parent bb9f610 commit 2263b5b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

examples/src/main/scala/org/apache/spark/examples/ml/DecisionTreeExample.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ import org.apache.spark.sql.{SQLContext, DataFrame}
4444
* {{{
4545
* ./bin/run-example ml.DecisionTreeExample [options]
4646
* }}}
47+
* Note that Decision Trees can take a large amount of memory. If the run-example command above
48+
* fails, try running via spark-submit and specifying the amount of memory as at least 1g.
49+
* For local mode, run
50+
* {{{
51+
* ./bin/spark-submit --class org.apache.spark.examples.ml.DecisionTreeExample --driver-memory 1g
52+
* [examples JAR path] [options]
53+
* }}}
4754
* If you use it as a template to create your own app, please use `spark-submit` to submit your app.
4855
*/
4956
object DecisionTreeExample {

mllib/src/main/scala/org/apache/spark/ml/impl/tree/treeParams.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private[ml] trait DecisionTreeParams extends PredictorParams {
117117
def setMaxDepth(value: Int): this.type = {
118118
require(value >= 0, s"maxDepth parameter must be >= 0. Given bad value: $value")
119119
set(maxDepth, value)
120-
this.asInstanceOf[this.type]
120+
this
121121
}
122122

123123
/** @group getParam */

0 commit comments

Comments
 (0)