public class DecisionTree extends Object implements Serializable
Constructor and Description |
---|
DecisionTree() |
Modifier and Type | Method and Description |
---|---|
org.apache.spark.api.java.JavaPairRDD<Double,Double> |
test(org.apache.spark.mllib.tree.model.DecisionTreeModel model,
org.apache.spark.api.java.JavaRDD<org.apache.spark.mllib.regression.LabeledPoint> test)
This method applies a decision tree model to a given dataset
|
org.apache.spark.mllib.tree.model.DecisionTreeModel |
train(org.apache.spark.api.java.JavaRDD<org.apache.spark.mllib.regression.LabeledPoint> train,
int noOfClasses,
Map<Integer,Integer> categoricalFeatures,
String impurityCriteria,
int maxTreeDepth,
int maxBins)
This method trains a decision tree model
|
public org.apache.spark.mllib.tree.model.DecisionTreeModel train(org.apache.spark.api.java.JavaRDD<org.apache.spark.mllib.regression.LabeledPoint> train, int noOfClasses, Map<Integer,Integer> categoricalFeatures, String impurityCriteria, int maxTreeDepth, int maxBins)
train
- Training dataset as a JavaRDD of labeled pointsnoOfClasses
- Number of classescategoricalFeatures
- 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.DecisionTreeModel 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 © 2015 WSO2, Inc.. All Rights Reserved.