Class: DecisionTreeModel

eclairjs/mllib/tree/model.DecisionTreeModel

new DecisionTreeModel(topNode, algo)

Decision tree model for classification or regression. This model stores the decision tree structure and parameters.
Parameters:
Name Type Description
topNode root node
algo algorithm type -- classification or regression
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() → {Promise.<number>}

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
Promise.<number>

numNodes() → {Promise.<number>}

Get number of nodes in tree, including leaf nodes.
Source:
Returns:
Type
Promise.<number>

predict0(features) → {Promise.<number>}

Predict values for a single data point using the model trained.
Parameters:
Name Type Description
features module:eclairjs/mllib/linalg.Vector array representing a single data point
Source:
Returns:
Double prediction from the trained model
Type
Promise.<number>

predict1(features) → {module:eclairjs/rdd.RDD}

Predict values for the given data set using the model trained.
Parameters:
Name Type Description
features module:eclairjs/rdd.RDD RDD representing data points to be predicted
Source:
Returns:
RDD of predictions for each of the given data points
Type
module:eclairjs/rdd.RDD

predict2(features) → {JavaRDD}

Predict values for the given data set using the model trained.
Parameters:
Name Type Description
features JavaRDD JavaRDD representing data points to be predicted
Source:
Returns:
JavaRDD of predictions for each of the given data points
Type
JavaRDD

save(sc, path) → {Promise.<Void>}

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:
Returns:
A Promise that resolves to nothing.
Type
Promise.<Void>

toDebugString() → {Promise.<string>}

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

toString() → {Promise.<string>}

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