title: Getting the accuracy for multi-label prediction in scikit-learn
body: <p>In a <a href="https://stats.stackexchange.com/a/168945/12359">multilabel classification</a> setting, <a href="http://scikit-learn.org/stable/modules/generated/sklearn.metrics.accuracy_score.html#sklearn.metrics.accuracy_score" rel="noreferrer"><code>sklearn.metrics.accuracy_score</code></a> only computes the <em>subset accuracy</em> (3): i.e. the set of labels predicted for a sample must exactly match the corresponding set of labels in y_true.</p>
  
  <p>This way of computing the accuracy is sometime named, perhaps less ambiguously, <em>exact match ratio</em> (1):</p>
  
  <p><a href="https://i.stack.imgur.com/KPr89.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KPr89.png" alt="enter image description here"></a></p>
  
  <p>Is there any way to get the other typical way to compute the accuracy in scikit-learn, namely</p>
  
  <p><a href="https://i.stack.imgur.com/o9Aas.png" rel="noreferrer"><img src="https://i.stack.imgur.com/o9Aas.png" alt="enter image description here"></a></p>
  
  <p>(as defined in (1) and (2), and less ambiguously referred to as the <em>Hamming score</em> (4) (since it is closely related to the Hamming loss), or <em>label-based
  accuracy</em>)
  ?</p>
  
  <hr>
  
  <p>(1) Sorower, Mohammad S. "<a href="https://scholar.google.com/scholar?cluster=11211211207326445005&amp;hl=en&amp;as_sdt=0,5" rel="noreferrer">A literature survey on algorithms for multi-label learning.</a>" Oregon State University, Corvallis (2010).</p>
  
  <p>(2) Tsoumakas, Grigorios, and Ioannis Katakis. "<a href="https://scholar.google.com/scholar?cluster=6287724239179279830&amp;hl=en&amp;as_sdt=0,5" rel="noreferrer">Multi-label classification: An overview.</a>" Dept. of Informatics, Aristotle University of Thessaloniki, Greece (2006).</p>
  
  <p>(3) Ghamrawi, Nadia, and Andrew McCallum. "<a href="https://scholar.google.com/scholar?cluster=3196558257855553882&amp;hl=en&amp;as_sdt=0,5" rel="noreferrer">Collective multi-label classification.</a>" Proceedings of the 14th ACM international conference on Information and knowledge management. ACM, 2005.</p>
  
  <p>(4) Godbole, Shantanu, and Sunita Sarawagi. "<a href="https://scholar.google.com/scholar?cluster=8646809048732748859&amp;hl=en&amp;as_sdt=0,5" rel="noreferrer">Discriminative methods for multi-labeled classification.</a>" Advances in Knowledge Discovery and Data Mining. Springer Berlin Heidelberg, 2004. 22-30.</p>