O'Reilly logo

Machine Learning with Spark - Second Edition by Nick Pentreath, Manpreet Singh Ghotra, Rajdeep Dua

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Random Forests

Random Forests are known as ensembles of decision trees, formed by combining many decision trees. Like decision trees, random forests can handle categorical features, support multiclass classification, and don't require feature scaling.

Spark ML supports random forests for both binary and multiclass classification and regression using both continuous and categorical features.

Let's train the sample lib SVM data by splitting it into 80% training and 20% testing, use Random Forest Classifier from Spark to build the model, and get evaluation metrics around the test data. The model can be persisted and loaded for later use.

Let's train the StumbleUpon dataset by splitting it into 80% training and 20% testing, use Random Forest ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required