new DecisionTreeModel(topNode, algo)
Parameters:
Name | Type | Description |
---|---|---|
topNode |
Node | |
algo |
Algo |
Methods
(static) load(sc, path) → {module:eclairjs/mllib/tree/model.DecisionTreeModel}
Parameters:
Name | Type | Description |
---|---|---|
sc |
module:eclairjs.SparkContext | Spark context used for loading model files. |
path |
string | Path specifying the directory to which the model was saved. |
Returns:
Model instance
depth() → {integer}
Get depth of tree.
E.g.: Depth 0 means 1 leaf node. Depth 1 means 1 internal node and 2 leaf nodes.
Returns:
- Type
- integer
numNodes() → {integer}
Get number of nodes in tree, including leaf nodes.
Returns:
- Type
- integer
predict() → {float|module:eclairjs.RDD}
Predict values for a single data point using the model trained.
Parameters:
Name | Type | Description |
---|---|---|
{@module:eclairjs/mllib/linalg.Vector |
| module:eclairjs.RDD} features Vector or RDD representing a single data point |
Returns:
float or RDD prediction from the trained model
- Type
- float | module:eclairjs.RDD
save(sc, path)
Parameters:
Name | Type | Description |
---|---|---|
sc |
module:eclairjs.SparkContext | Spark context used to save model data. |
path |
string | Path specifying the directory in which to save this model. If the directory already exists, this method throws an exception. |
toDebugString() → {string}
Print the full model to a string.
Returns:
- Type
- string
toString() → {string}
Print a summary of the model.
Returns:
- Type
- string