categoricalFeaturesInfo.put(1, 2); // feature 1 has 2 categories
int maxDepth = 4;
int numClasses = 2;
int maxBins = 100;
Strategy strategy = new Strategy(Algo.Classification(), Gini.instance(), maxDepth, numClasses,
maxBins, categoricalFeaturesInfo);
DecisionTreeModel model = DecisionTree$.MODULE$.train(rdd.rdd(), strategy);
int numCorrect = validatePrediction(arr, model);