Classes on tabular data - FastAi2

I’m trying to use the tabular training from fastai2, but I’m having issues with categorical targets.

I’ve a binary classification problem and I realized that they change it to0 and 1. However, how can I know which class is 0 and 1?

I read the docs and found out about the “y_block = CategoryBlock”, but when I use it and dls.classes, I got an empty dict as response. Is it normal?


Yes, internally fastai changes your classes into 0 and 1 (or more if you have more than two classes). But you can easily access your class names with dls.vocab or learn.dls.vocab. By indexing into the vocab you can get the corresponding class name for 0 and 1.