From the course: Spark for Machine Learning & AI

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Decision trees classification

Decision trees classification - Apache Spark Tutorial

From the course: Spark for Machine Learning & AI

Start my 1-month free trial

Decision trees classification

- [Instructor] Once again, we're going to continue from our previous video. Now we're going to shift our attention to working with decision trees. Now once again we'll work with the iris data, which is in the iviris_df data frame and just to take a quick look at the data that we're probably all familiar with by now, we have four measures for irises, which are a type of flowers. We have a species and we've mapped this data into a feature vector, and also we've indexed the species into a numeric label. First thing I want to do is import some code for decision trees. And now that we have our decision tree classifier, let's create a decision tree object. So this pattern is probably familiar by now. So we'll call decision tree classifier and we'll indicate what our label is by specifying the labelCol, and it's simply label. Which again, just to remind everyone, is the indexed version of the species. And then we'll also indicate the feature column. And that's simply the features column…

Contents