|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectorg.apache.spark.mllib.tree.model.RandomForestModel
public class RandomForestModel
:: Experimental :: Represents a random forest model.
param: algo algorithm for the ensemble model, either Classification or Regression param: trees tree ensembles
| Constructor Summary | |
|---|---|
RandomForestModel(scala.Enumeration.Value algo,
DecisionTreeModel[] trees)
|
|
| Method Summary | |
|---|---|
scala.Enumeration.Value |
algo()
|
static RandomForestModel |
load(SparkContext sc,
String path)
|
int |
numTrees()
Get number of trees in ensemble. |
JavaRDD<Double> |
predict(JavaRDD<Vector> features)
Java-friendly version of TreeEnsembleModel.predict(org.apache.spark.mllib.linalg.Vector). |
RDD<Object> |
predict(RDD<Vector> features)
Predict values for the given data set. |
double |
predict(Vector features)
Predict values for a single data point using the model trained. |
void |
save(SparkContext sc,
String path)
Save this model to the given path. |
String |
toDebugString()
Print the full model to a string. |
String |
toString()
Print a summary of the model. |
int |
totalNumNodes()
Get total number of nodes, summed over all trees in the ensemble. |
DecisionTreeModel[] |
trees()
|
| Methods inherited from class Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RandomForestModel(scala.Enumeration.Value algo,
DecisionTreeModel[] trees)
| Method Detail |
|---|
public static RandomForestModel load(SparkContext sc,
String path)
public scala.Enumeration.Value algo()
public DecisionTreeModel[] trees()
public void save(SparkContext sc,
String path)
SaveableThis saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/
The model may be loaded using Loader.load.
save in interface Saveablesc - Spark context used to save model data.path - Path specifying the directory in which to save this model.
If the directory already exists, this method throws an exception.public double predict(Vector features)
features - array representing a single data point
public RDD<Object> predict(RDD<Vector> features)
features - RDD representing data points to be predicted
public JavaRDD<Double> predict(JavaRDD<Vector> features)
TreeEnsembleModel.predict(org.apache.spark.mllib.linalg.Vector).
features - (undocumented)
public String toString()
toString in class Objectpublic String toDebugString()
public int numTrees()
public int totalNumNodes()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||