pyspark.mllib.tree.
DecisionTreeModel
A decision tree model for classification or regression.
New in version 1.1.0.
Methods
call(name, *a)
call
Call method of java_model
depth()
depth
Get depth of tree (e.g.
load(sc, path)
load
Load a model from the given path.
numNodes()
numNodes
Get number of nodes in tree, including leaf nodes.
predict(x)
predict
Predict the label of one or more examples.
save(sc, path)
save
Save this model to the given path.
toDebugString()
toDebugString
full model.
Methods Documentation
Get depth of tree (e.g. depth 0 means 1 leaf node, depth 1 means 1 internal node + 2 leaf nodes).
New in version 1.3.0.
pyspark.mllib.linalg.Vector
pyspark.RDD
Data point (feature vector), or an RDD of data points (feature vectors).
Notes
In Python, predict cannot currently be used within an RDD transformation or action. Call predict directly on the RDD instead.
New in version 1.2.0.