There's more...

Note that the multilabel and multiclass classifications sound similar, but they are two different things.

All multilabel MultilabelMetrics() method is trying to accomplish is to map a number of inputs (x) to a binary vector (y) rather than numerical values in a typical classification system.

The important metrics associated with the multilabel classification are (see the preceding code):

  • Accuracy
  • Hamming loss
  • Precision
  • Recall
  • F1

A full explanation of each parameter is out of scope, but the following link provides a short treatment for the multilabel metrics:

https://en.wikipedia.org/wiki/Multi-label_classification

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.