Class: RandomForestClassificationModel

eclairjs/ml/classification.RandomForestClassificationModel

Random Forest model for classification. It supports both binary and multiclass labels, as well as both continuous and categorical features.

Constructor

new RandomForestClassificationModel()

Source:

Extends

Methods

(static) load(path) → {RandomForestClassificationModel}

Parameters:
Name Type Description
path string
Source:
Returns:
Type
RandomForestClassificationModel

(static) read() → {MLReader}

Source:
Returns:
Type
MLReader

copy(extra) → {module:eclairjs/ml/classification.RandomForestClassificationModel}

Parameters:
Name Type Description
extra module:eclairjs/ml/param.ParamMap
Overrides:
Source:
Returns:
Type
module:eclairjs/ml/classification.RandomForestClassificationModel

featureImportances() → {module:eclairjs/mllib/linalg.Vector}

Estimate of the importance of each feature. This generalizes the idea of "Gini" importance to other losses, following the explanation of Gini importance from "Random Forests" documentation by Leo Breiman and Adele Cutler, and following the implementation from scikit-learn. This feature importance is calculated as follows: - Average over trees: - importance(feature j) = sum (over nodes which split on feature j) of the gain, where gain is scaled by the number of instances passing through node - Normalize importances for tree based on total number of training instances used to build tree. - Normalize feature importance vector to sum to 1.
Source:
Returns:
Type
module:eclairjs/mllib/linalg.Vector

featuresCol() → {module:eclairjs/ml/param.Param}

Param for features column name.
Overrides:
Source:
Returns:
Type
module:eclairjs/ml/param.Param

getFeaturesCol() → {Promise.<string>}

Overrides:
Source:
Returns:
Type
Promise.<string>

getLabelCol() → {Promise.<string>}

Overrides:
Source:
Returns:
Type
Promise.<string>

getPredictionCol() → {Promise.<string>}

Overrides:
Source:
Returns:
Type
Promise.<string>

getRawPredictionCol() → {Promise.<string>}

Source:
Returns:
Type
Promise.<string>

hasParent() → {Promise.<boolean>}

Indicates whether this Model has a corresponding parent.
Inherited From:
Source:
Returns:
Type
Promise.<boolean>

labelCol() → {module:eclairjs/ml/param.Param}

Param for label column name.
Overrides:
Source:
Returns:
Type
module:eclairjs/ml/param.Param

numClasses() → {Promise.<number>}

Number of classes (values which the label can take).
Inherited From:
Source:
Returns:
Type
Promise.<number>

numFeatures() → {Promise.<number>}

Returns the number of features the model was trained on. If unknown, returns -1
Inherited From:
Source:
Returns:
Type
Promise.<number>

parent() → {module:eclairjs/ml.Estimator}

Inherited From:
Source:
Returns:
Type
module:eclairjs/ml.Estimator

predictionCol() → {module:eclairjs/ml/param.Param}

Param for prediction column name.
Overrides:
Source:
Returns:
Type
module:eclairjs/ml/param.Param

rawPredictionCol() → {module:eclairjs/ml/param.Param}

Param for raw prediction (a.k.a. confidence) column name.
Source:
Returns:
Type
module:eclairjs/ml/param.Param

setFeaturesCol(value) → {object}

Parameters:
Name Type Description
value string
Inherited From:
Source:
Returns:
Type
object

setParent(parent) → {object}

Sets the parent of this model.
Parameters:
Name Type Description
parent module:eclairjs/ml.Estimator
Inherited From:
Source:
Returns:
Type
object

setPredictionCol(value) → {object}

Parameters:
Name Type Description
value string
Inherited From:
Source:
Returns:
Type
object

setProbabilityCol(value) → {module:eclairjs/ml/classification.ProbabilisticClassificationModel}

Parameters:
Name Type Description
value string
Inherited From:
Source:
Returns:
Type
module:eclairjs/ml/classification.ProbabilisticClassificationModel

setRawPredictionCol(value) → {module:eclairjs/ml/classification.ClassificationModel}

Parameters:
Name Type Description
value string
Inherited From:
Source:
Returns:
Type
module:eclairjs/ml/classification.ClassificationModel

setThresholds(value) → {module:eclairjs/ml/classification.ProbabilisticClassificationModel}

Parameters:
Name Type Description
value Array.<number>
Inherited From:
Source:
Returns:
Type
module:eclairjs/ml/classification.ProbabilisticClassificationModel

toDebugString() → {Promise.<string>}

Source:
Returns:
Type
Promise.<string>

toString() → {Promise.<string>}

Source:
Returns:
Type
Promise.<string>

transform(dataset) → {module:eclairjs/sql.Dataset}

Transforms dataset by reading from featuresCol, and appending new columns as specified by parameters: - predicted labels as [[predictionCol]] of type Double - raw predictions (confidences) as [[rawPredictionCol]] of type Vector - probability of each class as [[probabilityCol]] of type Vector.
Parameters:
Name Type Description
dataset module:eclairjs/sql.Dataset input dataset
Inherited From:
Source:
Returns:
transformed dataset
Type
module:eclairjs/sql.Dataset

transformSchema(schema) → {module:eclairjs/sql/types.StructType}

Parameters:
Name Type Description
schema module:eclairjs/sql/types.StructType
Inherited From:
Source:
Returns:
Type
module:eclairjs/sql/types.StructType

trees() → {Array.<module:eclairjs/ml/tree.DecisionTreeModel>}

Source:
Returns:
Type
Array.<module:eclairjs/ml/tree.DecisionTreeModel>

treeWeights() → {Promise.<Array.<number>>}

Source:
Returns:
Type
Promise.<Array.<number>>

validateAndTransformSchema(schema, fitting, featuresDataType) → {module:eclairjs/sql/types.StructType}

Validates and transforms the input schema with the provided param map.
Parameters:
Name Type Description
schema module:eclairjs/sql/types.StructType
fitting boolean whether this is in fitting
featuresDataType module:eclairjs/sql/types.DataType SQL DataType for FeaturesType. E.g., module:eclairjs/sql/types.VectorUDTfor vector features
Inherited From:
Source:
Returns:
Type
module:eclairjs/sql/types.StructType

write() → {MLWriter}

Source:
Returns:
Type
MLWriter