In this recipe, we will use the breast cancer data and use classifications to demonstrate the Decision Tree implantation in Spark. We will use the IG and Gini to show how to use the facilities already provided by Spark to avoid redundant coding. This recipe attempts to fit a single tree using a binary classification to train and predict the label (benign (0.0) and malignant (1.0)) for the dataset.
Building a classification system with Decision Trees in Spark 2.0
How to do it
- Start a new project in IntelliJ or in an IDE of your choice. Make sure the necessary JAR files are included.
- Set up the package location where the program will reside:
package spark.ml.cookbook.chapter10
- Import the necessary packages for the Spark...