Class RandomForestModel
Object
org.apache.spark.mllib.tree.model.TreeEnsembleModel
org.apache.spark.mllib.tree.model.RandomForestModel
- All Implemented Interfaces:
Serializable,Saveable
public class RandomForestModel
extends org.apache.spark.mllib.tree.model.TreeEnsembleModel
implements Saveable
Represents a random forest model.
param: algo algorithm for the ensemble model, either Classification or Regression param: trees tree ensembles
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.spark.mllib.tree.model.TreeEnsembleModel
org.apache.spark.mllib.tree.model.TreeEnsembleModel.SaveLoadV1_0$ -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionscala.Enumeration.Valuealgo()static RandomForestModelload(SparkContext sc, String path) voidsave(SparkContext sc, String path) Save this model to the given path.trees()Methods inherited from class org.apache.spark.mllib.tree.model.TreeEnsembleModel
combiningStrategy, LogStringContext, numTrees, predict, predict, predict, toDebugString, toString, totalNumNodes, treeWeights
-
Constructor Details
-
RandomForestModel
-
-
Method Details
-
load
- Parameters:
sc- Spark context used for loading model files.path- Path specifying the directory to which the model was saved.- Returns:
- Model instance
-
algo
public scala.Enumeration.Value algo()- Overrides:
algoin classorg.apache.spark.mllib.tree.model.TreeEnsembleModel
-
trees
- Overrides:
treesin classorg.apache.spark.mllib.tree.model.TreeEnsembleModel
-
save
Description copied from interface:SaveableSave this model to the given path.This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/
The model may be loaded using
Loader.load.
-