public class RandomForestRregression extends Object implements Serializable
Constructor and Description |
---|
RandomForestRregression() |
Modifier and Type | Method and Description |
---|---|
org.apache.spark.api.java.JavaPairRDD<Double,Double> |
test(org.apache.spark.mllib.tree.model.RandomForestModel model,
org.apache.spark.api.java.JavaRDD<org.apache.spark.mllib.regression.LabeledPoint> test)
This method applies a random forest model to a given dataset
|
org.apache.spark.mllib.tree.model.RandomForestModel |
train(org.apache.spark.api.java.JavaRDD<org.apache.spark.mllib.regression.LabeledPoint> train,
Map<Integer,Integer> categoricalFeatures,
int numTrees,
String featureSubsetStrategy,
String impurityCriteria,
int maxTreeDepth,
int maxBins,
int seed)
This method trains a Random Forest Rregression Model model
|
public org.apache.spark.mllib.tree.model.RandomForestModel train(org.apache.spark.api.java.JavaRDD<org.apache.spark.mllib.regression.LabeledPoint> train, Map<Integer,Integer> categoricalFeatures, int numTrees, String featureSubsetStrategy, String impurityCriteria, int maxTreeDepth, int maxBins, int seed)
train
- Training dataset as a JavaRDD of labeled pointscategoricalFeatures
- Map containing categorical feature indices and number of categories for each featureimpurityCriteria
- Impurity criteria - "gini" or "entropy" for classification, "variance" for regressionmaxTreeDepth
- Maximum tree depthmaxBins
- Maximum number of binspublic org.apache.spark.api.java.JavaPairRDD<Double,Double> test(org.apache.spark.mllib.tree.model.RandomForestModel model, org.apache.spark.api.java.JavaRDD<org.apache.spark.mllib.regression.LabeledPoint> test)
model
- Decision tree modeltest
- Test dataset as a JavaRDD of labeled pointsCopyright © 2016 WSO2, Inc.. All Rights Reserved.