# Multi-class Using Dataset

**URL:** <https://discuss.huggingface.co/t/multi-class-using-dataset/8970>\
**Category:** 🤗Datasets\
**Created:** [August 5, 2021, 2:20am UTC](https://discuss.huggingface.co/t/multi-class-using-dataset/8970 "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](https://discuss.huggingface.co/u/lhoestq)\
**Post date:** [August 23, 2021, 4:20pm UTC](https://discuss.huggingface.co/t/multi-class-using-dataset/8970/2 "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](https://discuss.huggingface.co/t/multi-class-using-dataset/8970)._
