RandomForestModel#
- class pyspark.mllib.tree.RandomForestModel(java_model)[source]#
Represents a random forest model.
New in version 1.2.0.
Methods
call
(name, *a)Call method of java_model
load
(sc, path)Load a model from the given path.
numTrees
()Get number of trees in ensemble.
predict
(x)Predict values for a single data point or an RDD of points using the model trained.
save
(sc, path)Save this model to the given path.
Full model
Get total number of nodes, summed over all trees in the ensemble.
Methods Documentation
- call(name, *a)#
Call method of java_model
- classmethod load(sc, path)#
Load a model from the given path.
New in version 1.3.0.
- numTrees()#
Get number of trees in ensemble.
New in version 1.3.0.
- predict(x)#
Predict values for a single data point or an RDD of points using the model trained.
New in version 1.3.0.
Notes
In Python, predict cannot currently be used within an RDD transformation or action. Call predict directly on the RDD instead.
- save(sc, path)#
Save this model to the given path.
New in version 1.3.0.
- toDebugString()#
Full model
New in version 1.3.0.
- totalNumNodes()#
Get total number of nodes, summed over all trees in the ensemble.
New in version 1.3.0.