|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectorg.apache.spark.mllib.tree.model.DecisionTreeModel
public class DecisionTreeModel
:: Experimental :: Decision tree model for classification or regression. This model stores the decision tree structure and parameters. param: topNode root node param: algo algorithm type -- classification or regression
| Constructor Summary | |
|---|---|
DecisionTreeModel(Node topNode,
scala.Enumeration.Value algo)
|
|
| Method Summary | |
|---|---|
scala.Enumeration.Value |
algo()
|
int |
depth()
Get depth of tree. |
static DecisionTreeModel |
load(SparkContext sc,
String path)
|
int |
numNodes()
Get number of nodes in tree, including leaf nodes. |
JavaRDD<Object> |
predict(JavaRDD<Vector> features)
Predict values for the given data set using the model trained. |
RDD<Object> |
predict(RDD<Vector> features)
Predict values for the given data set using the model trained. |
double |
predict(Vector features)
Predict values for a single data point using the model trained. |
void |
save(SparkContext sc,
String path)
Save this model to the given path. |
String |
toDebugString()
Print the full model to a string. |
Node |
topNode()
|
String |
toString()
Print a summary of the model. |
| Methods inherited from class Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DecisionTreeModel(Node topNode,
scala.Enumeration.Value algo)
| Method Detail |
|---|
public static DecisionTreeModel load(SparkContext sc,
String path)
public Node topNode()
public scala.Enumeration.Value algo()
public double predict(Vector features)
features - array representing a single data point
public RDD<Object> predict(RDD<Vector> features)
features - RDD representing data points to be predicted
public JavaRDD<Object> predict(JavaRDD<Vector> features)
features - JavaRDD representing data points to be predicted
public int numNodes()
public int depth()
public String toString()
toString in class Objectpublic String toDebugString()
public void save(SparkContext sc,
String path)
SaveableThis saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/
The model may be loaded using Loader.load.
save in interface Saveablesc - Spark context used to save model data.path - Path specifying the directory in which to save this model.
If the directory already exists, this method throws an exception.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||