Constructor
new RandomForestClassificationModel()
Extends
Methods
copy(extra) → {module:eclairjs/ml/classification.RandomForestClassificationModel}
Parameters:
| Name | Type | Description |
|---|---|---|
extra |
module:eclairjs/ml/param.ParamMap |
- Overrides:
- Source:
Returns:
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.
Returns:
featuresCol() → {module:eclairjs/ml/param.Param}
Param for features column name.
- Overrides:
- Source:
Returns:
getFeaturesCol() → {string}
- Overrides:
- Source:
Returns:
- Type
- string
getLabelCol() → {string}
- Overrides:
- Source:
Returns:
- Type
- string
getPredictionCol() → {string}
- Overrides:
- Source:
Returns:
- Type
- string
getRawPredictionCol() → {string}
Returns:
- Type
- string
hasParent() → {boolean}
- Inherited From:
- Source:
Returns:
- Type
- boolean
labelCol() → {module:eclairjs/ml/param.Param}
Param for label column name.
- Overrides:
- Source:
Returns:
numClasses() → {int}
- Inherited From:
- Source:
Returns:
- Type
- int
numFeatures() → {integer}
- Inherited From:
- Source:
Returns:
- Type
- integer
parent() → {module:eclairjs/ml.Estimator}
- Inherited From:
- Source:
Returns:
predictionCol() → {module:eclairjs/ml/param.Param}
Param for prediction column name.
- Overrides:
- Source:
Returns:
rawPredictionCol() → {module:eclairjs/ml/param.Param}
Param for raw prediction (a.k.a. confidence) column name.
Returns:
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:
setRawPredictionCol(value) → {module:eclairjs/ml/classification.ClassificationModel}
Parameters:
| Name | Type | Description |
|---|---|---|
value |
string |
- Inherited From:
- Source:
Returns:
setThresholds(value) → {module:eclairjs/ml/classification.ProbabilisticClassificationModel}
Parameters:
| Name | Type | Description |
|---|---|---|
value |
Array.<float> |
- Inherited From:
- Source:
Returns:
toDebugString() → {string}
Returns:
- Type
- string
toString() → {string}
Returns:
- Type
- string
transform(dataset) → {module:eclairjs/sql.DataFrame}
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.DataFrame | input dataset |
- Inherited From:
- Source:
Returns:
transformed dataset
transformSchema(schema) → {module:eclairjs/sql/types.StructType}
Parameters:
| Name | Type | Description |
|---|---|---|
schema |
module:eclairjs/sql/types.StructType |
- Inherited From:
- Source:
Returns:
trees() → {Array.<module:eclairjs/ml/tree.DecisionTreeModel>}
Returns:
- Type
- Array.<module:eclairjs/ml/tree.DecisionTreeModel>
treeWeights() → {Array.<float>}
Returns:
- Type
- Array.<float>
uid() → {string}
An immutable unique ID for the object and its derivatives.
Returns:
- Type
- string
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: