The one-versus-rest form of multiclass classifier involves training a single class with positive samples, and labeling all other classes as negative. This method requires that the base class produces a confidence with real value, as we see in binary classification where a class label is produced. The following graph displays the results of this classification style:

The base classifier here is logistic regression, as shown in the following code:
l_regress = LogisticRegression(maxIter=10, regParam=0.001, elasticNetParam=0, tol=1E-6, fitIntercept=True )
We then train using the one-versus-rest classifier, as shown in the following code:
onvsrt = OneVsRest(classifier=lr)
onvsrtModel = onvsrt.fit(trainingUrlData)
We then compute the model score for the test data using the following code:
predictions = onvsrtModel.transform(testUrlData)
We then evaluate the performance of the model using the following code:
model_eval = MulticlassClassificationEvaluator(metricName="accuracy")
Finally, we compute the accuracy of the classification using the following code:
accuracy = model_eval.evaluate(predictions)
You might have noticed that we have not yet discussed classifying URLs using the decision tree method. We will be delving into this topic later in the chapter on decision trees.