Skip to content

Commit 0c85fd4

Browse files
committed
Update docs.
1 parent 8d3c47a commit 0c85fd4

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ class GBTClassificationModel private[ml](
204204
/**
205205
* Number of trees in ensemble
206206
*/
207+
@Since("2.0.0")
207208
val getNumTrees: Int = trees.length
208209

209210
@Since("1.4.0")

mllib/src/main/scala/org/apache/spark/ml/regression/GBTRegressor.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ class GBTRegressionModel private[ml](
186186
/**
187187
* Number of trees in ensemble
188188
*/
189+
@Since("2.0.0")
189190
val getNumTrees: Int = trees.length
190191

191192
@Since("1.4.0")

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ private[ml] trait RandomForestParams extends TreeEnsembleParams {
327327
* If 1, then no bootstrapping is used. If > 1, then bootstrapping is done.
328328
* TODO: Change to always do bootstrapping (simpler). SPARK-7130
329329
* (default = 20)
330+
*
331+
* Note: The reason that we cannot add this to both GBT and RF (i.e. in TreeEnsembleParams)
332+
* is the param `maxIter` controls how many trees a GBT has. The semantics in the algorithms
333+
* are a bit different.
330334
* @group param
331335
*/
332336
final val numTrees: IntParam = new IntParam(this, "numTrees", "Number of trees to train (>= 1)",

python/pyspark/ml/util.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def overwrite(self):
8080
def context(self, sqlContext):
8181
"""
8282
Sets the SQL context to use for saving.
83-
.. note:: Deprecated in 2.1, use session instead.
83+
.. note:: Deprecated in 2.1 and will be removed in 2.2, use session instead.
8484
"""
8585
raise NotImplementedError("MLWriter is not yet implemented for type: %s" % type(self))
8686

@@ -114,9 +114,9 @@ def overwrite(self):
114114
def context(self, sqlContext):
115115
"""
116116
Sets the SQL context to use for saving.
117-
.. note:: Deprecated in 2.1, use session instead.
117+
.. note:: Deprecated in 2.1 and will be removed in 2.2, use session instead.
118118
"""
119-
warnings.warn("Deprecated in 2.1, use session instead.")
119+
warnings.warn("Deprecated in 2.1 and will be removed in 2.2, use session instead.")
120120
self._jwrite.context(sqlContext._ssql_ctx)
121121
return self
122122

@@ -173,7 +173,7 @@ def load(self, path):
173173
def context(self, sqlContext):
174174
"""
175175
Sets the SQL context to use for loading.
176-
.. note:: Deprecated in 2.1, use session instead.
176+
.. note:: Deprecated in 2.1 and will be removed in 2.2, use session instead.
177177
"""
178178
raise NotImplementedError("MLReader is not yet implemented for type: %s" % type(self))
179179

@@ -205,9 +205,9 @@ def load(self, path):
205205
def context(self, sqlContext):
206206
"""
207207
Sets the SQL context to use for loading.
208-
.. note:: Deprecated in 2.1, use session instead.
208+
.. note:: Deprecated in 2.1 and will be removed in 2.2, use session instead.
209209
"""
210-
warnings.warn("Deprecated in 2.1, use session instead.")
210+
warnings.warn("Deprecated in 2.1 and will be removed in 2.2, use session instead.")
211211
self._jread.context(sqlContext._ssql_ctx)
212212
return self
213213

0 commit comments

Comments
 (0)