April 2017
Intermediate to advanced
532 pages
12h 39m
English
We will illustrate the impact of tree depth in a similar manner as we did for our logistic regression model.
First, we will need to create another helper function in the Spark shell as follows:
import org.apache.spark.mllib.tree.impurity.Impurity import org.apache.spark.mllib.tree.impurity.Entropy import org.apache.spark.mllib.tree.impurity.Gini def trainDTWithParams(input: RDD[LabeledPoint], maxDepth: Int, impurity: Impurity) = { DecisionTree.train(input, Algo.Classification, impurity, maxDepth) }
Now, we're ready to compute our AUC metric for different settings of tree depth. We will simply use our original dataset in this example, since we do not need the data to be standardized.
Read now
Unlock full access