Class: DecisionTreeModel

eclairjs/mllib/tree/model. DecisionTreeModel

new DecisionTreeModel(topNode, algo)

Parameters:
Name Type Description
topNode Node
algo Algo
Source:

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.
Source:
Returns:
Model instance
Type
module:eclairjs/mllib/tree/model.DecisionTreeModel

depth() → {integer}

Get depth of tree. E.g.: Depth 0 means 1 leaf node. Depth 1 means 1 internal node and 2 leaf nodes.
Source:
Returns:
Type
integer

numNodes() → {integer}

Get number of nodes in tree, including leaf nodes.
Source:
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
Source:
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.
Source:

toDebugString() → {string}

Print the full model to a string.
Source:
Returns:
Type
string

toString() → {string}

Print a summary of the model.
Source:
Returns:
Type
string