One-vs-Rest classifier (One-vs-All) in Apache Spark 2.0

In this recipe, we demonstrate One-vs-Rest in Apache Spark 2.0. What we are trying to achieve with the OneVsRest() classifier is to make a binary logistic regression to work for a multi-class / multi-label classification problem. The recipe is a two-step approach in which we first configure a LogisticRegression() object and then use it in a OneVsRest() classifier to solve a multi-class classification problem using logistic regression.

Get Apache Spark 2.x Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.