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.