# Multi-class Using Dataset

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmulti-class-using-dataset%2F8970%3E%5C
**Category:** 🤗Datasets\
**Created:** [August 5, 2021, 2:20am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmulti-class-using-dataset%2F8970 "2021-08-05T02:20:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/52888_2.png) [@lhoestq](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flhoestq)%5C
**Post date:** [August 23, 2021, 4:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmulti-class-using-dataset%2F8970%2F2 "2021-08-23T16:20:16Z")

</div>

Hi !

The ClassLabel feature type is for single-label multi-class classification.  
For multi-label classification you can use

```python
from datasets.features import ClassLabel, Sequence
labels_type = Sequence(ClassLabel(names=classes))

```

and modify your the function you pass to `map` to convert your list of 21 booleans to the list of True indices. For example:

[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0] → [4, 12, 18]

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmulti-class-using-dataset%2F8970)._
