How it works...

In this recipe, we investigated generating evaluation metrics for the multilabel classification model. We began with manually creating a dataset for the model evaluation. Next, we passed our dataset as an argument to the MultilabelMetrics and generated evaluation metrics. Finally, we printed out various metrics such as micro recall, micro precision, micro f1-measure, Hamming loss, subset accuracy, and so on.

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.